Skip to content

Commit

Permalink
Assert header ready earlier if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
alexforencich committed Nov 8, 2018
1 parent b223c94 commit 6b1b36d
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions rtl/arp_eth_rx.v
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 8'd0;
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;

if (s_eth_hdr_ready && s_eth_hdr_valid) begin
s_eth_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -291,7 +291,7 @@ always @* begin
// otherwise, transfer tuser
m_frame_valid_next = !s_eth_payload_axis_tuser;
end
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand All @@ -312,7 +312,7 @@ always @* begin
// otherwise, transfer tuser
m_frame_valid_next = !s_eth_payload_axis_tuser;
end
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
6 changes: 3 additions & 3 deletions rtl/arp_eth_rx_64.v
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 8'd0;
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;

if (s_eth_hdr_ready && s_eth_hdr_valid) begin
s_eth_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -216,7 +216,7 @@ always @* begin
end else begin
m_frame_valid_next = !s_eth_payload_axis_tuser;
end
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand All @@ -237,7 +237,7 @@ always @* begin
// otherwise, transfer tuser
m_frame_valid_next = !s_eth_payload_axis_tuser;
end
s_eth_hdr_ready_next = !m_frame_valid_reg;
s_eth_hdr_ready_next = !m_frame_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
4 changes: 2 additions & 2 deletions rtl/arp_eth_tx.v
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 8'd0;
s_frame_ready_next = !m_eth_hdr_valid_reg;
s_frame_ready_next = !m_eth_hdr_valid_next;

if (s_frame_ready && s_frame_valid) begin
store_frame = 1'b1;
Expand Down Expand Up @@ -212,7 +212,7 @@ always @* begin
8'h1B: begin
m_eth_payload_axis_tdata_int = arp_tpa_reg[ 7: 0];
m_eth_payload_axis_tlast_int = 1'b1;
s_frame_ready_next = !m_eth_hdr_valid_reg;
s_frame_ready_next = !m_eth_hdr_valid_next;
state_next = STATE_IDLE;
end
endcase
Expand Down
4 changes: 2 additions & 2 deletions rtl/arp_eth_tx_64.v
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 8'd0;
s_frame_ready_next = !m_eth_hdr_valid_reg;
s_frame_ready_next = !m_eth_hdr_valid_next;

if (s_frame_ready && s_frame_valid) begin
store_frame = 1'b1;
Expand Down Expand Up @@ -237,7 +237,7 @@ always @* begin
m_eth_payload_axis_tdata_int[63:56] = 0;
m_eth_payload_axis_tkeep_int = 8'h0f;
m_eth_payload_axis_tlast_int = 1'b1;
s_frame_ready_next = !m_eth_hdr_valid_reg;
s_frame_ready_next = !m_eth_hdr_valid_next;
state_next = STATE_IDLE;
end
endcase
Expand Down
10 changes: 5 additions & 5 deletions rtl/ip_eth_rx.v
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ always @* begin
// idle state - wait for header
frame_ptr_next = 16'd0;
hdr_sum_next = 16'd0;
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;

if (s_eth_hdr_ready && s_eth_hdr_valid) begin
s_eth_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -342,7 +342,7 @@ always @* begin
if (s_eth_payload_axis_tlast) begin
error_header_early_termination_next = 1'b1;
m_ip_hdr_valid_next = 1'b0;
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand All @@ -369,7 +369,7 @@ always @* begin
m_ip_payload_axis_tuser_int = 1'b1;
error_payload_early_termination_next = 1'b1;
end
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -396,7 +396,7 @@ always @* begin

if (s_eth_payload_axis_tready && s_eth_payload_axis_tvalid) begin
if (s_eth_payload_axis_tlast) begin
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -412,7 +412,7 @@ always @* begin

if (s_eth_payload_axis_tready && s_eth_payload_axis_tvalid) begin
if (s_eth_payload_axis_tlast) begin
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
8 changes: 4 additions & 4 deletions rtl/ip_eth_rx_64.v
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ always @* begin
frame_ptr_next = 16'd0;
hdr_sum_next = 32'd0;
flush_save = 1'b1;
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;

if (s_eth_hdr_ready && s_eth_hdr_valid) begin
s_eth_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -378,7 +378,7 @@ always @* begin
error_invalid_header_next = 1'b0;
error_invalid_checksum_next = 1'b0;
m_ip_hdr_valid_next = 1'b0;
s_eth_hdr_ready_next = !m_ip_hdr_valid_reg;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
s_eth_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand Down Expand Up @@ -472,7 +472,7 @@ always @* begin
if (shift_eth_payload_axis_tlast) begin
s_eth_payload_axis_tready_next = 1'b0;
flush_save = 1'b1;
s_eth_hdr_ready_next = 1'b1;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
state_next = STATE_READ_PAYLOAD_LAST;
Expand All @@ -490,7 +490,7 @@ always @* begin
if (shift_eth_payload_axis_tlast) begin
s_eth_payload_axis_tready_next = 1'b0;
flush_save = 1'b1;
s_eth_hdr_ready_next = 1'b1;
s_eth_hdr_ready_next = !m_ip_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
state_next = STATE_WAIT_LAST;
Expand Down
8 changes: 4 additions & 4 deletions rtl/ip_eth_tx.v
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 16'd0;
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;

if (s_ip_hdr_ready && s_ip_hdr_valid) begin
store_ip_hdr = 1'b1;
Expand Down Expand Up @@ -305,7 +305,7 @@ always @* begin
m_eth_payload_axis_tuser_int = 1'b1;
error_payload_early_termination_next = 1'b1;
end
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -332,7 +332,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -348,7 +348,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
12 changes: 6 additions & 6 deletions rtl/ip_eth_tx_64.v
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ always @* begin
// idle state - wait for data
frame_ptr_next = 16'd0;
flush_save = 1'b1;
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;

if (s_ip_hdr_ready && s_ip_hdr_valid) begin
store_ip_hdr = 1'b1;
Expand Down Expand Up @@ -374,7 +374,7 @@ always @* begin
frame_ptr_next = ip_length_reg;
m_eth_payload_axis_tkeep_int = count2keep(ip_length_reg - frame_ptr_reg);
if (shift_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down Expand Up @@ -419,7 +419,7 @@ always @* begin
if (shift_ip_payload_axis_tlast) begin
s_ip_payload_axis_tready_next = 1'b0;
flush_save = 1'b1;
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
store_last_word = 1'b1;
Expand All @@ -433,7 +433,7 @@ always @* begin
m_eth_payload_axis_tuser_int = 1'b1;
s_ip_payload_axis_tready_next = 1'b0;
flush_save = 1'b1;
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
state_next = STATE_WRITE_PAYLOAD;
Expand All @@ -456,7 +456,7 @@ always @* begin
if (m_eth_payload_axis_tready_int_reg && shift_ip_payload_axis_tvalid) begin
transfer_in_save = 1'b1;
if (shift_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -473,7 +473,7 @@ always @* begin
if (shift_ip_payload_axis_tvalid) begin
transfer_in_save = 1'b1;
if (shift_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_eth_hdr_valid_reg;
s_ip_hdr_ready_next = !m_eth_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
10 changes: 5 additions & 5 deletions rtl/udp_ip_rx.v
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for header
frame_ptr_next = 16'd0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;

if (s_ip_hdr_ready && s_ip_hdr_valid) begin
s_ip_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -301,7 +301,7 @@ always @* begin
if (s_ip_payload_axis_tlast) begin
error_header_early_termination_next = 1'b1;
m_udp_hdr_valid_next = 1'b0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand All @@ -328,7 +328,7 @@ always @* begin
m_udp_payload_axis_tuser_int = 1'b1;
error_payload_early_termination_next = 1'b1;
end
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -355,7 +355,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -371,7 +371,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
12 changes: 6 additions & 6 deletions rtl/udp_ip_rx_64.v
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for header
frame_ptr_next = 16'd0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;

if (s_ip_hdr_ready && s_ip_hdr_valid) begin
s_ip_hdr_ready_next = 1'b0;
Expand Down Expand Up @@ -315,7 +315,7 @@ always @* begin
if (s_ip_payload_axis_tlast) begin
error_header_early_termination_next = 1'b1;
m_udp_hdr_valid_next = 1'b0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end
Expand Down Expand Up @@ -343,7 +343,7 @@ always @* begin
m_udp_payload_axis_tkeep_int = s_ip_payload_axis_tkeep & count2keep(m_udp_length_reg - frame_ptr_reg);
if (s_ip_payload_axis_tlast) begin
s_ip_payload_axis_tready_next = 1'b0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
store_last_word = 1'b1;
Expand All @@ -356,7 +356,7 @@ always @* begin
error_payload_early_termination_next = 1'b1;
m_udp_payload_axis_tuser_int = 1'b1;
s_ip_payload_axis_tready_next = 1'b0;
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
state_next = STATE_IDLE;
end else begin
state_next = STATE_READ_PAYLOAD;
Expand All @@ -378,7 +378,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -394,7 +394,7 @@ always @* begin

if (s_ip_payload_axis_tready && s_ip_payload_axis_tvalid) begin
if (s_ip_payload_axis_tlast) begin
s_ip_hdr_ready_next = !m_udp_hdr_valid_reg;
s_ip_hdr_ready_next = !m_udp_hdr_valid_next;
s_ip_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
8 changes: 4 additions & 4 deletions rtl/udp_ip_tx.v
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ always @* begin
STATE_IDLE: begin
// idle state - wait for data
frame_ptr_next = 16'd0;
s_udp_hdr_ready_next = !m_ip_hdr_valid_reg;
s_udp_hdr_ready_next = !m_ip_hdr_valid_next;

if (s_udp_hdr_ready && s_udp_hdr_valid) begin
store_udp_hdr = 1'b1;
Expand Down Expand Up @@ -296,7 +296,7 @@ always @* begin
m_ip_payload_axis_tuser_int = 1'b1;
error_payload_early_termination_next = 1'b1;
end
s_udp_hdr_ready_next = !m_ip_hdr_valid_reg;
s_udp_hdr_ready_next = !m_ip_hdr_valid_next;
s_udp_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -323,7 +323,7 @@ always @* begin

if (s_udp_payload_axis_tready && s_udp_payload_axis_tvalid) begin
if (s_udp_payload_axis_tlast) begin
s_udp_hdr_ready_next = !m_ip_hdr_valid_reg;
s_udp_hdr_ready_next = !m_ip_hdr_valid_next;
s_udp_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand All @@ -339,7 +339,7 @@ always @* begin

if (s_udp_payload_axis_tvalid) begin
if (s_udp_payload_axis_tlast) begin
s_udp_hdr_ready_next = !m_ip_hdr_valid_reg;
s_udp_hdr_ready_next = !m_ip_hdr_valid_next;
s_udp_payload_axis_tready_next = 1'b0;
state_next = STATE_IDLE;
end else begin
Expand Down
Loading

0 comments on commit 6b1b36d

Please sign in to comment.