Skip to content

Commit 7d0a4f8

Browse files
authored
Merge pull request #10 from pulp-platform/fixes
Fix `variable_latency_interco` corner case
2 parents 1506713 + 6306650 commit 7d0a4f8

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed

Bender.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ dependencies:
77
workspace:
88
checkout_dir: "./deps"
99

10+
export_include_dirs:
11+
- rtl/low_latency_interco
12+
- rtl/peripheral_interco
13+
1014
sources:
1115
# Source files grouped in levels. Files in level 0 have no dependencies on files in this
1216
# package. Files in level 1 only depend on files in level 0, files in level 2 on files in
@@ -29,41 +33,38 @@ sources:
2933
# Level 4
3034
- rtl/variable_latency_interconnect/variable_latency_interconnect.sv
3135

32-
- include_dirs:
33-
- rtl/low_latency_interco
34-
files:
35-
- rtl/low_latency_interco/FanInPrimitive_Req.sv
36-
- rtl/low_latency_interco/ArbitrationTree.sv
37-
- rtl/low_latency_interco/MUX2_REQ.sv
38-
- rtl/low_latency_interco/AddressDecoder_Resp.sv
39-
- rtl/low_latency_interco/TestAndSet.sv
40-
- rtl/low_latency_interco/RequestBlock2CH.sv
41-
- rtl/low_latency_interco/RequestBlock1CH.sv
42-
- rtl/low_latency_interco/FanInPrimitive_Resp.sv
43-
- rtl/low_latency_interco/ResponseTree.sv
44-
- rtl/low_latency_interco/ResponseBlock.sv
45-
- rtl/low_latency_interco/AddressDecoder_Req.sv
46-
- rtl/low_latency_interco/XBAR_TCDM.sv
47-
- rtl/low_latency_interco/XBAR_TCDM_WRAPPER.sv
48-
- rtl/low_latency_interco/TCDM_PIPE_REQ.sv
49-
- rtl/low_latency_interco/TCDM_PIPE_RESP.sv
50-
- rtl/low_latency_interco/grant_mask.sv
51-
- rtl/low_latency_interco/priority_Flag_Req.sv
52-
- include_dirs:
53-
- rtl/peripheral_interco
54-
files:
55-
- rtl/peripheral_interco/AddressDecoder_PE_Req.sv
56-
- rtl/peripheral_interco/AddressDecoder_Resp_PE.sv
57-
- rtl/peripheral_interco/ArbitrationTree_PE.sv
58-
- rtl/peripheral_interco/FanInPrimitive_Req_PE.sv
59-
- rtl/peripheral_interco/RR_Flag_Req_PE.sv
60-
- rtl/peripheral_interco/MUX2_REQ_PE.sv
61-
- rtl/peripheral_interco/FanInPrimitive_PE_Resp.sv
62-
- rtl/peripheral_interco/RequestBlock1CH_PE.sv
63-
- rtl/peripheral_interco/RequestBlock2CH_PE.sv
64-
- rtl/peripheral_interco/ResponseBlock_PE.sv
65-
- rtl/peripheral_interco/ResponseTree_PE.sv
66-
- rtl/peripheral_interco/XBAR_PE.sv
36+
# Low-Latency Interco
37+
- rtl/low_latency_interco/FanInPrimitive_Req.sv
38+
- rtl/low_latency_interco/ArbitrationTree.sv
39+
- rtl/low_latency_interco/MUX2_REQ.sv
40+
- rtl/low_latency_interco/AddressDecoder_Resp.sv
41+
- rtl/low_latency_interco/TestAndSet.sv
42+
- rtl/low_latency_interco/RequestBlock2CH.sv
43+
- rtl/low_latency_interco/RequestBlock1CH.sv
44+
- rtl/low_latency_interco/FanInPrimitive_Resp.sv
45+
- rtl/low_latency_interco/ResponseTree.sv
46+
- rtl/low_latency_interco/ResponseBlock.sv
47+
- rtl/low_latency_interco/AddressDecoder_Req.sv
48+
- rtl/low_latency_interco/XBAR_TCDM.sv
49+
- rtl/low_latency_interco/XBAR_TCDM_WRAPPER.sv
50+
- rtl/low_latency_interco/TCDM_PIPE_REQ.sv
51+
- rtl/low_latency_interco/TCDM_PIPE_RESP.sv
52+
- rtl/low_latency_interco/grant_mask.sv
53+
- rtl/low_latency_interco/priority_Flag_Req.sv
54+
55+
# Peripheral Interco
56+
- rtl/peripheral_interco/AddressDecoder_PE_Req.sv
57+
- rtl/peripheral_interco/AddressDecoder_Resp_PE.sv
58+
- rtl/peripheral_interco/ArbitrationTree_PE.sv
59+
- rtl/peripheral_interco/FanInPrimitive_Req_PE.sv
60+
- rtl/peripheral_interco/RR_Flag_Req_PE.sv
61+
- rtl/peripheral_interco/MUX2_REQ_PE.sv
62+
- rtl/peripheral_interco/FanInPrimitive_PE_Resp.sv
63+
- rtl/peripheral_interco/RequestBlock1CH_PE.sv
64+
- rtl/peripheral_interco/RequestBlock2CH_PE.sv
65+
- rtl/peripheral_interco/ResponseBlock_PE.sv
66+
- rtl/peripheral_interco/ResponseTree_PE.sv
67+
- rtl/peripheral_interco/XBAR_PE.sv
6768

6869
- target: tcdm_test
6970
include_dirs:

rtl/variable_latency_interconnect/variable_latency_interconnect.sv

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,18 @@ module variable_latency_interconnect import tcdm_interconnect_pkg::topo_e; #(
8282

8383
logic [NumIn-1:0][IniAggDataWidth-1:0] data_agg_in;
8484
logic [NumOut-1:0][IniAggDataWidth-1:0] data_agg_out;
85-
logic [NumIn-1:0][NumOutLog2-1:0] tgt_sel;
85+
logic [NumIn-1:0][cf_math_pkg::idx_width(NumOut)-1:0] tgt_sel;
8686

8787
for (genvar j = 0; unsigned'(j) < NumIn; j++) begin : gen_inputs
8888
// Extract target index
8989
if (NumIn == 1) begin
9090
assign tgt_sel[j] = '0;
9191
end else begin
92-
assign tgt_sel[j] = req_tgt_addr_i[j][ByteOffWidth +: NumOutLog2];
92+
if (NumOut == 1) begin
93+
assign tgt_sel[j] = 0;
94+
end else begin
95+
assign tgt_sel[j] = req_tgt_addr_i[j][ByteOffWidth +: NumOutLog2];
96+
end
9397
end
9498

9599
// Aggregate data to be routed to targets
@@ -255,7 +259,7 @@ module variable_latency_interconnect import tcdm_interconnect_pkg::topo_e; #(
255259
* Assertions *
256260
******************/
257261

258-
if (AddrMemWidth + NumOutLog2 > AddrWidth)
262+
if (NumOut != 1 && AddrMemWidth + NumOutLog2 > AddrWidth)
259263
$fatal(1, "[variable_latency_interconnect] Address is not wide enough to accommodate the requested TCDM configuration.");
260264

261265
if (Topology != tcdm_interconnect_pkg::LIC && NumOut < NumIn)

0 commit comments

Comments
 (0)