diff --git a/env/bfm/tnoc_bfm_flit_if.sv b/env/bfm/tnoc_bfm_flit_if.sv index 9fba41f..81979ba 100644 --- a/env/bfm/tnoc_bfm_flit_if.sv +++ b/env/bfm/tnoc_bfm_flit_if.sv @@ -10,12 +10,16 @@ interface tnoc_bfm_flit_if ( bit ready; tnoc_bfm_flit flit; bit vc_available; + bit acknowledgement; + + assign acknowledgement = (valid && ready) ? '1 : '0; clocking master_cb @(posedge clk); output valid; input ready; output flit; input vc_available; + input acknowledgement; endclocking clocking slave_cb @(posedge clk); @@ -23,6 +27,7 @@ interface tnoc_bfm_flit_if ( output ready; input flit; output vc_available; + input acknowledgement; endclocking clocking monitor_cb @(posedge clk); @@ -30,20 +35,23 @@ interface tnoc_bfm_flit_if ( input ready; input flit; input vc_available; + input acknowledgement; endclocking modport initiator( output valid, input ready, output flit, - input vc_available + input vc_available, + input acknowledgement ); modport target( input valid, output ready, input flit, - output vc_available + output vc_available, + input acknowledgement ); endinterface `endif diff --git a/env/bfm/tnoc_bfm_packet_vc_driver.svh b/env/bfm/tnoc_bfm_packet_vc_driver.svh index 30be3d5..00a7f44 100644 --- a/env/bfm/tnoc_bfm_packet_vc_driver.svh +++ b/env/bfm/tnoc_bfm_packet_vc_driver.svh @@ -26,7 +26,7 @@ class tnoc_bfm_packet_vc_driver extends tnoc_bfm_component_base #( do_reset(); end else begin - if (vif.monitor_cb.valid && vif.monitor_cb.ready) begin + if (vif.monitor_cb.acknowledgement) begin finish_flit(); end diff --git a/env/bfm/tnoc_bfm_packet_vc_monitor.svh b/env/bfm/tnoc_bfm_packet_vc_monitor.svh index f0e1e4a..13d2262 100644 --- a/env/bfm/tnoc_bfm_packet_vc_monitor.svh +++ b/env/bfm/tnoc_bfm_packet_vc_monitor.svh @@ -35,7 +35,7 @@ class tnoc_bfm_packet_vc_monitor extends tnoc_bfm_component_base #( flit_item = sample_flit_item(); end - if (!(vif.monitor_cb.valid && vif.monitor_cb.ready)) begin + if (!vif.monitor_cb.acknowledgement) begin continue; end diff --git a/rtl/common/tnoc_flit_if.sv b/rtl/common/tnoc_flit_if.sv index e9cfd54..9b3920d 100644 --- a/rtl/common/tnoc_flit_if.sv +++ b/rtl/common/tnoc_flit_if.sv @@ -50,7 +50,7 @@ interface tnoc_flit_if localparam int FLIT_INDEX = (is_local_port(PORT_TYPE)) ? i : 0; tnoc_common_header header = '0; always @* begin - if (valid[i] && ready[i] && is_header_flit(flit[FLIT_INDEX])) begin + if (acknowledgement[i] && is_header_flit(flit[FLIT_INDEX])) begin header = get_common_header(flit[FLIT_INDEX]); end end diff --git a/rtl/common/tnoc_flit_if_arbiter.sv b/rtl/common/tnoc_flit_if_arbiter.sv index 7df7b19..dcb3f2b 100644 --- a/rtl/common/tnoc_flit_if_arbiter.sv +++ b/rtl/common/tnoc_flit_if_arbiter.sv @@ -57,12 +57,8 @@ module tnoc_flit_if_arbiter for (genvar j = 0;j < ENTRIES;++j) begin : g localparam int IF_INDEX = ENTRIES*i+j; - assign request[j] = ( - (flit_in[IF_INDEX].valid != '0) && is_header_flit(flit_in[IF_INDEX].flit[0]) - ) ? '1 : '0; - assign free[j] = ( - (flit_in[IF_INDEX].acknowledgement != '0) && is_tail_flit(flit_in[IF_INDEX].flit[0]) - ) ? '1 : '0; + assign request[j] = ((flit_in[IF_INDEX].valid != '0) && is_head_flit(flit_in[IF_INDEX].flit[0])) ? '1 : '0; + assign free[j] = ((flit_in[IF_INDEX].acknowledgement != '0) && is_tail_flit(flit_in[IF_INDEX].flit[0])) ? '1 : '0; end tbcm_round_robin_arbiter #( diff --git a/rtl/common/tnoc_flit_if_fifo.sv b/rtl/common/tnoc_flit_if_fifo.sv index 4220572..85b3680 100644 --- a/rtl/common/tnoc_flit_if_fifo.sv +++ b/rtl/common/tnoc_flit_if_fifo.sv @@ -98,7 +98,7 @@ module tnoc_flit_if_fifo assign push = |flit_in_if.valid; assign push_data.valid = flit_in_if.valid; assign push_data.flit = flit_in_if.flit[0]; - assign pop = |(flit_out_if.valid & flit_out_if.ready); + assign pop = |flit_out_if.acknowledgement; tbcm_fifo #( .DATA_TYPE (s_fifo_data ), diff --git a/rtl/common/tnoc_vc_selector.sv b/rtl/common/tnoc_vc_selector.sv index f00116b..ebc33c2 100644 --- a/rtl/common/tnoc_vc_selector.sv +++ b/rtl/common/tnoc_vc_selector.sv @@ -11,6 +11,10 @@ module tnoc_vc_selector tnoc_flit_if.target flit_in_if, tnoc_flit_if.initiator flit_out_if ); + `include "tnoc_packet.svh" + `include "tnoc_flit.svh" + `include "tnoc_flit_utils.svh" + localparam int CHANNELS = CONFIG.virtual_channels; tnoc_flit_if #(CONFIG, 1) flit_fifo_in_if[CHANNELS](); @@ -43,8 +47,8 @@ module tnoc_vc_selector logic [CHANNELS-1:0] vc_free; for (genvar i = 0;i < CHANNELS;++i) begin - assign vc_request[i] = flit_fifo_out_if[i].valid; - assign vc_free[i] = (flit_fifo_out_if[i].flit[0].tail) ? flit_fifo_out_if[i].valid & flit_fifo_out_if[i].ready : '0; + assign vc_request[i] = (flit_fifo_out_if[i].valid && is_head_flit(flit_fifo_out_if[i].flit[0])) ? '1 : '0; + assign vc_free[i] = (flit_fifo_out_if[i].acknowledgement && is_tail_flit(flit_fifo_out_if[i].flit[0])) ? '1 : '0; end tbcm_round_robin_arbiter #( diff --git a/rtl/router/tnoc_error_checker.sv b/rtl/router/tnoc_error_checker.sv index fbca93f..9f6b16e 100644 --- a/rtl/router/tnoc_error_checker.sv +++ b/rtl/router/tnoc_error_checker.sv @@ -113,12 +113,8 @@ module tnoc_error_checker logic start_of_error_request; logic end_of_error_request; - assign start_of_error_request = ( - start_of_packet && invalid_destination - ) ? '1 : '0; - assign end_of_error_request = ( - flit_demux_out_if[1].valid && flit_demux_out_if[1].ready && is_tail_flit(flit_demux_out_if[1].flit[0]) - ) ? '1 : '0; + assign start_of_error_request = (start_of_packet && invalid_destination) ? '1 : '0; + assign end_of_error_request = (flit_demux_out_if[1].acknowledgement && is_tail_flit(flit_demux_out_if[1].flit[0])) ? '1 : '0; always_ff @(posedge clk, negedge rst_n) begin if (!rst_n) begin error_route_busy[0] <= '0; @@ -138,7 +134,7 @@ module tnoc_error_checker start_of_packet && invalid_destination && is_non_posted_request_packet_type(common_header.packet_type) ) ? '1 : '0; assign end_of_error_response = ( - flit_mux_in_if[1].valid && flit_mux_in_if[1].ready && is_tail_flit(flit_mux_in_if[1].flit[0]) + flit_mux_in_if[1].acknowledgement && is_tail_flit(flit_mux_in_if[1].flit[0]) ) ? '1 : '0; always_ff @(posedge clk, negedge rst_n) begin if (!rst_n) begin diff --git a/rtl/router/tnoc_route_selector.sv b/rtl/router/tnoc_route_selector.sv index f484a64..38837b8 100644 --- a/rtl/router/tnoc_route_selector.sv +++ b/rtl/router/tnoc_route_selector.sv @@ -84,12 +84,8 @@ module tnoc_route_selector e_route route_next; e_route route_latched; - assign start_of_packet = ( - flit_in_if[i].valid && is_head_flit(flit_in_if[i].flit[0]) - ) ? '1 : '0; - assign end_of_packet = ( - flit_in_if[i].valid && flit_in_if[i].ready && is_tail_flit(flit_in_if[i].flit[0]) - ) ? '1 : '0; + assign start_of_packet = (flit_in_if[i].valid && is_head_flit(flit_in_if[i].flit[0])) ? '1 : '0; + assign end_of_packet = (flit_in_if[i].acknowledgement && is_tail_flit(flit_in_if[i].flit[0])) ? '1 : '0; assign route = (start_of_packet) ? route_next : route_latched; assign route_next = select_route(flit_in_if[i].flit[0], i_id_x, i_id_y);