diff --git a/bp_common/src/include/bp_common_aviary_pkg.vh b/bp_common/src/include/bp_common_aviary_pkg.vh index 6e20ae7b0b..609f687ea1 100644 --- a/bp_common/src/include/bp_common_aviary_pkg.vh +++ b/bp_common/src/include/bp_common_aviary_pkg.vh @@ -463,10 +463,10 @@ package bp_common_aviary_pkg; ,mem_noc_len_width : 4 ,async_io_clk : 1 - ,io_noc_did_width : 2 + ,io_noc_did_width : 3 ,io_noc_max_credits : 16 ,io_noc_flit_width : 64 - ,io_noc_cid_width : 2 + ,io_noc_cid_width : 1 ,io_noc_len_width : 4 }; diff --git a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link.v b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_bidir.v similarity index 75% rename from bp_me/src/v/wormhole/bp_me_cce_to_mem_link.v rename to bp_me/src/v/wormhole/bp_me_cce_to_mem_link_bidir.v index 135ba4fa4b..69be08b234 100644 --- a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link.v +++ b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_bidir.v @@ -1,5 +1,5 @@ -module bp_me_cce_to_mem_link +module bp_me_cce_to_mem_link_bidir import bp_cce_pkg::*; import bp_common_pkg::*; import bp_common_aviary_pkg::*; @@ -8,33 +8,40 @@ module bp_me_cce_to_mem_link `declare_bp_proc_params(bp_params_p) `declare_bp_me_if_widths(paddr_width_p, cce_block_width_p, lce_id_width_p, lce_assoc_p) - , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(mem_noc_flit_width_p) - ) + , parameter num_outstanding_req_p = "inv" + + , parameter flit_width_p = "inv" + , parameter cord_width_p = "inv" + , parameter cid_width_p = "inv" + , parameter len_width_p = "inv" + + , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(mem_noc_flit_width_p) + ) (input clk_i , input reset_i // Configuration - , input [mem_noc_cord_width_p-1:0] my_cord_i - , input [mem_noc_cid_width_p-1:0] my_cid_i - , input [mem_noc_cord_width_p-1:0] dst_cord_i - , input [mem_noc_cid_width_p-1:0] dst_cid_i + , input [cord_width_p-1:0] my_cord_i + , input [cid_width_p-1:0] my_cid_i + , input [cord_width_p-1:0] dst_cord_i + , input [cid_width_p-1:0] dst_cid_i // Master link - , input [cce_mem_msg_width_lp-1:0] mem_cmd_i + , input [cce_mem_msg_width_lp-1:0] mem_cmd_i , input mem_cmd_v_i , output mem_cmd_ready_o - , output [cce_mem_msg_width_lp-1:0] mem_resp_o + , output [cce_mem_msg_width_lp-1:0] mem_resp_o , output mem_resp_v_o , input mem_resp_yumi_i // Client link - , output [cce_mem_msg_width_lp-1:0] mem_cmd_o + , output [cce_mem_msg_width_lp-1:0] mem_cmd_o , output mem_cmd_v_o , input mem_cmd_yumi_i - , input [cce_mem_msg_width_lp-1:0] mem_resp_i + , input [cce_mem_msg_width_lp-1:0] mem_resp_i , input mem_resp_v_i , output mem_resp_ready_o @@ -77,7 +84,12 @@ assign resp_link_cast_o = '{data : client_resp_link_lo.data bp_me_cce_to_mem_link_master - #(.bp_params_p(bp_params_p)) + #(.bp_params_p(bp_params_p) + ,.flit_width_p(flit_width_p) + ,.cord_width_p(cord_width_p) + ,.cid_width_p(cid_width_p) + ,.len_width_p(len_width_p) + ) master_link (.clk_i(clk_i) ,.reset_i(reset_i) @@ -100,7 +112,13 @@ bp_me_cce_to_mem_link_master ); bp_me_cce_to_mem_link_client - #(.bp_params_p(bp_params_p)) + #(.bp_params_p(bp_params_p) + ,.num_outstanding_req_p(num_outstanding_req_p) + ,.flit_width_p(flit_width_p) + ,.cord_width_p(cord_width_p) + ,.cid_width_p(cid_width_p) + ,.len_width_p(len_width_p) + ) client_link (.clk_i(clk_i) ,.reset_i(reset_i) diff --git a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_client.v b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_client.v index 32e21a6540..792fed534d 100644 --- a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_client.v +++ b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_client.v @@ -13,9 +13,15 @@ module bp_me_cce_to_mem_link_client `declare_bp_proc_params(bp_params_p) `declare_bp_me_if_widths(paddr_width_p, cce_block_width_p, lce_id_width_p, lce_assoc_p) - , localparam num_outstanding_req_p = mem_noc_max_credits_p + , parameter num_outstanding_req_p = "inv" + + , parameter flit_width_p = "inv" + , parameter cord_width_p = "inv" + , parameter cid_width_p = "inv" + , parameter len_width_p = "inv" + // wormhole parameters - , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(mem_noc_flit_width_p) + , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(flit_width_p) ) (input clk_i @@ -35,24 +41,24 @@ module bp_me_cce_to_mem_link_client ); `declare_bp_me_if(paddr_width_p, cce_block_width_p, lce_id_width_p, lce_assoc_p); - `declare_bp_mem_wormhole_payload_s(mem_noc_cord_width_p, mem_noc_cid_width_p, cce_mem_msg_width_lp, mem_cmd_payload_s); - `declare_bp_mem_wormhole_payload_s(mem_noc_cord_width_p, mem_noc_cid_width_p, cce_mem_msg_width_lp, mem_resp_payload_s); - `declare_bsg_wormhole_concentrator_packet_s(mem_noc_cord_width_p, mem_noc_len_width_p, mem_noc_cid_width_p, $bits(mem_cmd_payload_s), mem_cmd_packet_s); - `declare_bsg_wormhole_concentrator_packet_s(mem_noc_cord_width_p, mem_noc_len_width_p, mem_noc_cid_width_p, $bits(mem_resp_payload_s), mem_resp_packet_s); + `declare_bp_mem_wormhole_payload_s(cord_width_p, cid_width_p, cce_mem_msg_width_lp, mem_cmd_payload_s); + `declare_bp_mem_wormhole_payload_s(cord_width_p, cid_width_p, cce_mem_msg_width_lp, mem_resp_payload_s); + `declare_bsg_wormhole_concentrator_packet_s(cord_width_p, len_width_p, cid_width_p, $bits(mem_cmd_payload_s), mem_cmd_packet_s); + `declare_bsg_wormhole_concentrator_packet_s(cord_width_p, len_width_p, cid_width_p, $bits(mem_resp_payload_s), mem_resp_packet_s); // We save coordinates between sending and receiving. This assumes we get responses in-order - logic [mem_noc_cord_width_p-1:0] fifo_cord_li, fifo_cord_lo; - logic [mem_noc_cid_width_p-1:0] fifo_cid_li, fifo_cid_lo; + logic [cord_width_p-1:0] fifo_cord_li, fifo_cord_lo; + logic [cid_width_p-1:0] fifo_cid_li, fifo_cid_lo; logic fifo_ready_lo, fifo_v_li, fifo_v_lo, fifo_yumi_li; mem_cmd_packet_s mem_cmd_packet_lo; logic mem_cmd_packet_v_lo, mem_cmd_packet_yumi_li; mem_resp_packet_s mem_resp_packet_lo; bsg_wormhole_router_adapter - #(.max_payload_width_p($bits(mem_cmd_payload_s)+mem_noc_cid_width_p) - ,.len_width_p(mem_noc_len_width_p) - ,.cord_width_p(mem_noc_cord_width_p) - ,.flit_width_p(mem_noc_flit_width_p) + #(.max_payload_width_p($bits(mem_cmd_payload_s)+cid_width_p) + ,.len_width_p(len_width_p) + ,.cord_width_p(cord_width_p) + ,.flit_width_p(flit_width_p) ) mem_cmd_adapter (.clk_i(clk_i) @@ -80,7 +86,7 @@ module bp_me_cce_to_mem_link_client assign fifo_cid_li = mem_cmd_payload_lo.src_cid; assign fifo_v_li = mem_cmd_yumi_i & ~bypass_fifo; bsg_fifo_1r1w_small - #(.width_p(mem_noc_cord_width_p+mem_noc_cid_width_p) + #(.width_p(cord_width_p+cid_width_p) ,.els_p(num_outstanding_req_p) ) cord_fifo @@ -97,11 +103,11 @@ module bp_me_cce_to_mem_link_client ); assign fifo_yumi_li = fifo_v_lo & mem_resp_v_i; - wire [mem_noc_cord_width_p-1:0] src_cord_lo = bypass_fifo ? mem_cmd_payload_lo.src_cord : fifo_cord_lo; - wire [mem_noc_cid_width_p-1:0] src_cid_lo = bypass_fifo ? mem_cmd_payload_lo.src_cid : fifo_cid_lo; + wire [cord_width_p-1:0] src_cord_lo = bypass_fifo ? mem_cmd_payload_lo.src_cord : fifo_cord_lo; + wire [cid_width_p-1:0] src_cid_lo = bypass_fifo ? mem_cmd_payload_lo.src_cid : fifo_cid_lo; - wire [mem_noc_cord_width_p-1:0] dst_cord_lo = src_cord_lo; - wire [mem_noc_cid_width_p-1:0] dst_cid_lo = src_cid_lo; + wire [cord_width_p-1:0] dst_cord_lo = src_cord_lo; + wire [cid_width_p-1:0] dst_cid_lo = src_cid_lo; bp_me_wormhole_packet_encode_mem_resp #(.bp_params_p(bp_params_p)) diff --git a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_master.v b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_master.v index b263b35dde..20bb8c8355 100644 --- a/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_master.v +++ b/bp_me/src/v/wormhole/bp_me_cce_to_mem_link_master.v @@ -13,7 +13,12 @@ module bp_me_cce_to_mem_link_master `declare_bp_proc_params(bp_params_p) `declare_bp_me_if_widths(paddr_width_p, cce_block_width_p, lce_id_width_p, lce_assoc_p) - , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(mem_noc_flit_width_p) + , parameter flit_width_p = "inv" + , parameter cord_width_p = "inv" + , parameter cid_width_p = "inv" + , parameter len_width_p = "inv" + + , localparam bsg_ready_and_link_sif_width_lp = `bsg_ready_and_link_sif_width(flit_width_p) ) (input clk_i , input reset_i @@ -28,10 +33,10 @@ module bp_me_cce_to_mem_link_master , input mem_resp_yumi_i // Configuration - , input [mem_noc_cord_width_p-1:0] my_cord_i - , input [mem_noc_cid_width_p-1:0] my_cid_i - , input [mem_noc_cord_width_p-1:0] dst_cord_i - , input [mem_noc_cid_width_p-1:0] dst_cid_i + , input [cord_width_p-1:0] my_cord_i + , input [cid_width_p-1:0] my_cid_i + , input [cord_width_p-1:0] dst_cord_i + , input [cid_width_p-1:0] dst_cid_i // bsg_noc_wormhole interface , output [bsg_ready_and_link_sif_width_lp-1:0] cmd_link_o @@ -47,10 +52,10 @@ assign mem_cmd_cast_i = mem_cmd_i; assign mem_resp_o = mem_resp_cast_o; // CCE-MEM IF to Wormhole routed interface -`declare_bp_mem_wormhole_payload_s(mem_noc_cord_width_p, mem_noc_cid_width_p, cce_mem_msg_width_lp, mem_cmd_payload_s); -`declare_bp_mem_wormhole_payload_s(mem_noc_cord_width_p, mem_noc_cid_width_p, cce_mem_msg_width_lp, mem_resp_payload_s); -`declare_bsg_wormhole_concentrator_packet_s(mem_noc_cord_width_p, mem_noc_len_width_p, mem_noc_cid_width_p, $bits(mem_cmd_payload_s), mem_cmd_packet_s); -`declare_bsg_wormhole_concentrator_packet_s(mem_noc_cord_width_p, mem_noc_len_width_p, mem_noc_cid_width_p, $bits(mem_resp_payload_s), mem_resp_packet_s); +`declare_bp_mem_wormhole_payload_s(cord_width_p, cid_width_p, cce_mem_msg_width_lp, mem_cmd_payload_s); +`declare_bp_mem_wormhole_payload_s(cord_width_p, cid_width_p, cce_mem_msg_width_lp, mem_resp_payload_s); +`declare_bsg_wormhole_concentrator_packet_s(cord_width_p, len_width_p, cid_width_p, $bits(mem_cmd_payload_s), mem_cmd_packet_s); +`declare_bsg_wormhole_concentrator_packet_s(cord_width_p, len_width_p, cid_width_p, $bits(mem_resp_payload_s), mem_resp_packet_s); mem_cmd_packet_s mem_cmd_packet_li; bp_me_wormhole_packet_encode_mem_cmd @@ -66,10 +71,10 @@ bp_me_wormhole_packet_encode_mem_cmd mem_resp_packet_s mem_resp_packet_lo; bsg_wormhole_router_adapter - #(.max_payload_width_p($bits(mem_cmd_payload_s)+mem_noc_cid_width_p) - ,.len_width_p(mem_noc_len_width_p) - ,.cord_width_p(mem_noc_cord_width_p) - ,.flit_width_p(mem_noc_flit_width_p) + #(.max_payload_width_p($bits(mem_cmd_payload_s)+cid_width_p) + ,.len_width_p(len_width_p) + ,.cord_width_p(cord_width_p) + ,.flit_width_p(flit_width_p) ) mem_adapter (.clk_i(clk_i) diff --git a/bp_top/src/v/bp_io_tile.v b/bp_top/src/v/bp_io_tile.v index cc6267002a..e212c7c265 100644 --- a/bp_top/src/v/bp_io_tile.v +++ b/bp_top/src/v/bp_io_tile.v @@ -183,8 +183,14 @@ module bp_io_tile assign dst_did_lo = is_host_addr ? '1 : global_addr_lo.did; assign dst_cord_lo = dst_did_lo; - bp_me_cce_to_mem_link - #(.bp_params_p(bp_params_p)) + bp_me_cce_to_mem_link_bidir + #(.bp_params_p(bp_params_p) + ,.num_outstanding_req_p(io_noc_max_credits_p) + ,.flit_width_p(io_noc_flit_width_p) + ,.cord_width_p(io_noc_cord_width_p) + ,.cid_width_p(io_noc_cid_width_p) + ,.len_width_p(io_noc_len_width_p) + ) mem_link (.clk_i(clk_i) ,.reset_i(reset_i) diff --git a/bp_top/src/v/bp_tile.v b/bp_top/src/v/bp_tile.v index 4dfef4620b..293f5598e7 100644 --- a/bp_top/src/v/bp_tile.v +++ b/bp_top/src/v/bp_tile.v @@ -522,7 +522,12 @@ for (genvar i = 0; i < 2; i++) localparam dram_y_cord_lp = ic_y_dim_p + cc_y_dim_p + mc_y_dim_p; wire [mem_noc_cord_width_p-1:0] dst_cord_li = dram_y_cord_lp; bp_me_cce_to_mem_link_master - #(.bp_params_p(bp_params_p)) + #(.bp_params_p(bp_params_p) + ,.flit_width_p(mem_noc_flit_width_p) + ,.cord_width_p(mem_noc_cord_width_p) + ,.cid_width_p(mem_noc_cid_width_p) + ,.len_width_p(mem_noc_len_width_p) + ) dma_link (.clk_i(clk_i) ,.reset_i(reset_r) diff --git a/bp_top/syn/flist.vcs b/bp_top/syn/flist.vcs index 0b3cdc0fb5..802cde3275 100644 --- a/bp_top/syn/flist.vcs +++ b/bp_top/syn/flist.vcs @@ -210,7 +210,7 @@ $BP_ME_DIR/src/v/cce/bp_io_cce.v # Network $BP_ME_DIR/src/v/wormhole/bp_me_addr_to_cce_id.v $BP_ME_DIR/src/v/wormhole/bp_me_cce_id_to_cord.v -$BP_ME_DIR/src/v/wormhole/bp_me_cce_to_mem_link.v +$BP_ME_DIR/src/v/wormhole/bp_me_cce_to_mem_link_bidir.v $BP_ME_DIR/src/v/wormhole/bp_me_cce_to_mem_link_client.v $BP_ME_DIR/src/v/wormhole/bp_me_cce_to_mem_link_master.v $BP_ME_DIR/src/v/wormhole/bp_me_cord_to_id.v diff --git a/bp_top/test/tb/bp_top_trace_demo/testbench.v b/bp_top/test/tb/bp_top_trace_demo/testbench.v index 8aaeee31a6..78ee7036ec 100644 --- a/bp_top/test/tb/bp_top_trace_demo/testbench.v +++ b/bp_top/test/tb/bp_top_trace_demo/testbench.v @@ -318,8 +318,14 @@ bind bp_be_top wire [io_noc_cord_width_p-1:0] dst_cord_lo = 1; -bp_me_cce_to_mem_link - #(.bp_params_p(bp_params_p)) +bp_me_cce_to_mem_link_bidir + #(.bp_params_p(bp_params_p) + ,.num_outstanding_req_p(io_noc_max_credits_p) + ,.flit_width_p(io_noc_flit_width_p) + ,.cord_width_p(io_noc_cord_width_p) + ,.cid_width_p(io_noc_cid_width_p) + ,.len_width_p(io_noc_len_width_p) + ) host_link (.clk_i(clk_i) ,.reset_i(reset_i) @@ -352,7 +358,13 @@ bp_me_cce_to_mem_link ); bp_me_cce_to_mem_link_client - #(.bp_params_p(bp_params_p)) + #(.bp_params_p(bp_params_p) + ,.num_outstanding_req_p(mem_noc_max_credits_p) + ,.flit_width_p(mem_noc_flit_width_p) + ,.cord_width_p(mem_noc_cord_width_p) + ,.cid_width_p(mem_noc_cid_width_p) + ,.len_width_p(mem_noc_len_width_p) + ) dram_link (.clk_i(clk_i) ,.reset_i(reset_i)