mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-14 06:43:18 +08:00
Properly reset all registers
This commit is contained in:
parent
87fe1a561f
commit
6bd7309b9d
@ -125,6 +125,7 @@ end
|
||||
always @(posedge input_clk or posedge input_rst_sync2) begin
|
||||
if (input_rst_sync2) begin
|
||||
wr_ptr <= 0;
|
||||
wr_ptr_gray <= 0;
|
||||
end else if (write) begin
|
||||
mem[wr_ptr[ADDR_WIDTH-1:0]] <= data_in;
|
||||
wr_ptr_next = wr_ptr + 1;
|
||||
@ -148,6 +149,7 @@ end
|
||||
always @(posedge output_clk or posedge output_rst_sync2) begin
|
||||
if (output_rst_sync2) begin
|
||||
rd_ptr <= 0;
|
||||
rd_ptr_gray <= 0;
|
||||
end else if (read) begin
|
||||
data_out_reg <= mem[rd_ptr[ADDR_WIDTH-1:0]];
|
||||
rd_ptr_next = rd_ptr + 1;
|
||||
|
@ -128,6 +128,7 @@ end
|
||||
always @(posedge input_clk or posedge input_rst_sync2) begin
|
||||
if (input_rst_sync2) begin
|
||||
wr_ptr <= 0;
|
||||
wr_ptr_gray <= 0;
|
||||
end else if (write) begin
|
||||
mem[wr_ptr[ADDR_WIDTH-1:0]] <= data_in;
|
||||
wr_ptr_next = wr_ptr + 1;
|
||||
@ -151,6 +152,7 @@ end
|
||||
always @(posedge output_clk or posedge output_rst_sync2) begin
|
||||
if (output_rst_sync2) begin
|
||||
rd_ptr <= 0;
|
||||
rd_ptr_gray <= 0;
|
||||
end else if (read) begin
|
||||
data_out_reg <= mem[rd_ptr[ADDR_WIDTH-1:0]];
|
||||
rd_ptr_next = rd_ptr + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user