Skip to content

Commit

Permalink
Seperating out mem and io noc parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetrisko committed Jan 23, 2020
1 parent 84bbbd8 commit 99c39b7
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 52 deletions.
4 changes: 2 additions & 2 deletions bp_common/src/include/bp_common_aviary_pkg.vh
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
Original file line number Diff line number Diff line change
@@ -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::*;
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
40 changes: 23 additions & 17 deletions bp_me/src/v/wormhole/bp_me_cce_to_mem_link_client.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down
31 changes: 18 additions & 13 deletions bp_me/src/v/wormhole/bp_me_cce_to_mem_link_master.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions bp_top/src/v/bp_io_tile.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion bp_top/src/v/bp_tile.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bp_top/syn/flist.vcs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions bp_top/test/tb/bp_top_trace_demo/testbench.v
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 99c39b7

Please sign in to comment.