OpenCores
URL https://opencores.org/ocsvn/ethmac10g/ethmac10g/trunk

Subversion Repositories ethmac10g

[/] [ethmac10g/] [tags/] [V10/] [rtl/] [verilog/] [tx_engine/] [byte_counter.v] - Diff between revs 39 and 40

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 39 Rev 40
module byte_count_module(CLK, RESET, START, BYTE_COUNTER);
module byte_count_module(CLK, RESET, START, BYTE_COUNTER);
 
 
// Ports declaration
// Ports declaration
input CLK;
input CLK;
input RESET;
input RESET;
input START;
input START;
 
 
 
 
 
 
output [15:0] BYTE_COUNTER;
output [15:0] BYTE_COUNTER;
 
 
reg [15:0] BYTE_COUNTER;
reg [15:0] BYTE_COUNTER;
reg [15:0] counter;
reg [15:0] counter;
 
 
always @(posedge CLK or posedge RESET)
always @(posedge CLK or posedge RESET)
begin
begin
   if (RESET == 1) begin
   if (RESET == 1) begin
        counter = 16'h0000;
        counter = 16'h0000;
   end
   end
 
 
   // the ack is delayed which starts the counter
   // the ack is delayed which starts the counter
   else if (START == 1) begin
   else if (START == 1) begin
       counter = counter + 8;
       counter = counter + 8;
   end
   end
 
 
   BYTE_COUNTER = counter;
   BYTE_COUNTER = counter;
end
end
 
 
 
 
endmodule // End of Module 
endmodule // End of Module 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.