Skip to content

Commit a628388

Browse files
committed
Add FD as a parameter
- Propagating FD through the HCI interface makes sure that multi-cycle support is correctly set, and the assertions are checked properly - Adds FD Fifo Depth parameter to package and interfaces - This allows support multiple cycle for HWPE interfaces using the FIFO
1 parent 5421524 commit a628388

File tree

7 files changed

+42
-21
lines changed

7 files changed

+42
-21
lines changed

rtl/common/hci_helpers.svh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
`define HCI_SIZE_GET_IW(__x) (`HCI_SIZE_PARAM(__x).IW)
207207
`define HCI_SIZE_GET_EW(__x) (`HCI_SIZE_PARAM(__x).EW)
208208
`define HCI_SIZE_GET_EHW(__x) (`HCI_SIZE_PARAM(__x).EHW)
209+
`define HCI_SIZE_GET_FD(__x) (`HCI_SIZE_PARAM(__x).FD)
209210

210211
// Shorthand for defining a HCI interface compatible with a parameter
211212
`define HCI_INTF_EXPLICIT_PARAM(__name, __clk, __param) \
@@ -216,7 +217,8 @@
216217
.UW ( __param.UW ), \
217218
.IW ( __param.IW ), \
218219
.EW ( __param.EW ), \
219-
.EHW ( __param.EHW ) \
220+
.EHW ( __param.EHW ), \
221+
.FD ( __param.FD ) \
220222
) __name ( \
221223
.clk ( __clk ) \
222224
)
@@ -231,6 +233,7 @@
231233
`define HCI_SIZE_GET_IW_CHECK(__x) (__x.IW)
232234
`define HCI_SIZE_GET_EW_CHECK(__x) (__x.EW)
233235
`define HCI_SIZE_GET_EHW_CHECK(__x) (__x.EHW)
236+
`define HCI_SIZE_GET_FD_CHECK(__x) (__x.FD)
234237

235238
// Asserts (generic definition usable with any parameter name)
236239
`define HCI_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(__xparam, __xintf) \
@@ -240,7 +243,8 @@
240243
initial __xparam``_intf_size_check_uw : assert(__xparam.UW == `HCI_SIZE_GET_UW_CHECK(__xintf)); \
241244
initial __xparam``_intf_size_check_iw : assert(__xparam.IW == `HCI_SIZE_GET_IW_CHECK(__xintf)); \
242245
initial __xparam``_intf_size_check_ew : assert(__xparam.EW == `HCI_SIZE_GET_EW_CHECK(__xintf)); \
243-
initial __xparam``_intf_size_check_ehw : assert(__xparam.EHW == `HCI_SIZE_GET_EHW_CHECK(__xintf))
246+
initial __xparam``_intf_size_check_ehw : assert(__xparam.EHW == `HCI_SIZE_GET_EHW_CHECK(__xintf)); \
247+
initial __xparam``_intf_size_check_fd : assert(__xparam.FD == `HCI_SIZE_GET_FD_CHECK(__xintf))
244248

245249
// Asserts (specialized definition for conventional param names
246250
`define HCI_SIZE_CHECK_ASSERTS(__intf) `HCI_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(`HCI_SIZE_PARAM(__intf), __intf)

rtl/common/hci_interfaces.sv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface hci_core_intf (
4343
parameter int unsigned IW = hci_package::DEFAULT_IW; /// ID Width
4444
parameter int unsigned EW = hci_package::DEFAULT_EW; /// ECC Width
4545
parameter int unsigned EHW = hci_package::DEFAULT_EHW; /// Handshake ECC Width
46+
parameter int unsigned FD = hci_package::DEFAULT_FD; /// FIFO Depth
4647

4748
// handshake signals
4849
logic req;

rtl/common/hci_package.sv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package hci_package;
2727
parameter int unsigned DEFAULT_IW = 8; // Default ID Width
2828
parameter int unsigned DEFAULT_EW = 1; // Default ECC for Data Width
2929
parameter int unsigned DEFAULT_EHW = 1; // Default ECC for Handhshake Width
30+
parameter int unsigned DEFAULT_FD = 0; // Default FIFO Depth
3031

3132
typedef struct packed {
3233
int unsigned DW;
@@ -36,6 +37,7 @@ package hci_package;
3637
int unsigned IW;
3738
int unsigned EW;
3839
int unsigned EHW;
40+
int unsigned FD;
3941
} hci_size_parameter_t;
4042

4143
parameter hci_size_parameter_t DEFAULT_HCI_SIZE = '{
@@ -45,7 +47,8 @@ package hci_package;
4547
UW : DEFAULT_UW,
4648
IW : DEFAULT_IW,
4749
EW : DEFAULT_EW,
48-
EHW : DEFAULT_EHW
50+
EHW : DEFAULT_EHW,
51+
FD : DEFAULT_FD
4952
};
5053

5154
typedef struct packed {

rtl/core/hci_core_mux_static.sv

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ module hci_core_mux_static
153153
ehw : assert(in[i].EHW == out.EHW);
154154
end
155155

156-
`HCI_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(`HCI_SIZE_PARAM(in), in[0]);
156+
initial HCI_SIZE_in_intf_size_check_dw : assert(`HCI_SIZE_PARAM(in).DW == in[0].DW);
157+
initial HCI_SIZE_in_intf_size_check_bw : assert(`HCI_SIZE_PARAM(in).BW == in[0].BW);
158+
initial HCI_SIZE_in_intf_size_check_aw : assert(`HCI_SIZE_PARAM(in).AW == in[0].AW);
159+
initial HCI_SIZE_in_intf_size_check_uw : assert(`HCI_SIZE_PARAM(in).UW == in[0].UW);
160+
initial HCI_SIZE_in_intf_size_check_iw : assert(`HCI_SIZE_PARAM(in).IW == in[0].IW);
161+
initial HCI_SIZE_in_intf_size_check_ew : assert(`HCI_SIZE_PARAM(in).EW == in[0].EW);
162+
initial HCI_SIZE_in_intf_size_check_ehw : assert(`HCI_SIZE_PARAM(in).EHW == in[0].EHW);
163+
// initial HCI_SIZE_in_intf_size_check_fd : assert(`HCI_SIZE_PARAM(in).FD == in[0].FD);
157164

158165
`endif
159166
`endif

rtl/core/hci_core_r_id_filter.sv

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ module hci_core_r_id_filter
2626
import hwpe_stream_package::*;
2727
import hci_package::*;
2828
#(
29-
parameter hci_size_parameter_t `HCI_SIZE_PARAM(tcdm_target) = '0,
30-
parameter int unsigned N_OUTSTANDING = 2,
31-
parameter bit MULTICYCLE_SUPPORT = 1'b0
29+
parameter hci_size_parameter_t `HCI_SIZE_PARAM(tcdm_target) = '0
3230
)
3331
(
3432
input logic clk_i,
@@ -41,6 +39,8 @@ module hci_core_r_id_filter
4139

4240
localparam int unsigned IW = `HCI_SIZE_GET_IW(tcdm_target);
4341
localparam int unsigned EHW = `HCI_SIZE_GET_EHW(tcdm_target);
42+
localparam int unsigned FD = `HCI_SIZE_GET_FD(tcdm_target);
43+
localparam bit MULTICYCLE_SUPPORT = (FD > 1);
4444

4545
logic [IW-1:0] target_r_id;
4646

@@ -69,7 +69,7 @@ module hci_core_r_id_filter
6969
fifo_v3 #(
7070
.FALL_THROUGH(1'b0),
7171
.DATA_WIDTH(IW),
72-
.DEPTH(N_OUTSTANDING)
72+
.DEPTH(FD)
7373
) i_r_id_fifo (
7474
.clk_i,
7575
.rst_ni,
@@ -129,6 +129,8 @@ module hci_core_r_id_filter
129129
`ifndef SYNTHESIS
130130
`ifndef VERILATOR
131131
`ifndef VCS
132+
// Only check single-cycle timing when FD = 1 (no multicycle support)
133+
if (!MULTICYCLE_SUPPORT) begin : single_cycle_asserts
132134
// gnt=1 & wen=1 => the following cycle r_valid=1
133135
property p_gnt_wen_high_then_r_valid_high_next_cycle;
134136
@(posedge clk_i) (tcdm_initiator.gnt && tcdm_initiator.wen) |-> ##1 tcdm_initiator.r_valid;
@@ -144,6 +146,7 @@ module hci_core_r_id_filter
144146

145147
assert_gnt_low_then_r_valid_low_next_cycle: assert property (p_gnt_low_then_r_valid_low_next_cycle)
146148
else $warning("`r_valid` did not follow `gnt` by 1 cycle in a read: are you sure the `r_id` filter is at the 1-cycle latency boundary?");
149+
end : single_cycle_asserts
147150
`endif
148151
`endif
149152
`endif

rtl/ecc/hci_ecc_interconnect.sv

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@
4242
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
4343
* | *IW* | `N_HWPE+N_CORE+N_DMA+N_EXT` | ID Width. |
4444
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
45-
* | *EXPFIFO* | 0 | Depth of HCI router FIFO. |
45+
* | *FD* | 0 | Depth of HCI router FIFO. |
4646
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
4747
* | *SEL_LIC* | 0 | Kind of LIC to instantiate (0=regular L1, 1=L2). |
4848
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
49-
* | *CHUNK_SIZE* | 32 | Width in bits of each chunk of data to protect individually. |
50-
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
5149
*/
5250

5351
`include "hci_helpers.svh"
@@ -63,7 +61,6 @@ module hci_ecc_interconnect
6361
parameter int unsigned N_MEM = 16 , // Number of Memory banks
6462
parameter int unsigned TS_BIT = 21 , // TEST_SET_BIT (for Log Interconnect)
6563
parameter int unsigned IW = N_HWPE+N_CORE+N_DMA+N_EXT, // ID Width
66-
parameter int unsigned EXPFIFO = 0 , // FIFO Depth for HWPE Interconnect
6764
parameter int unsigned SEL_LIC = 0 , // Log interconnect type selector
6865
parameter int unsigned FILTER_WRITE_R_VALID[0:N_HWPE-1] = '{default: 0},
6966
parameter int unsigned CHUNK_SIZE = 32 , // Chunk size of data to be encoded separately (HWPE branch)
@@ -98,6 +95,7 @@ module hci_ecc_interconnect
9895
localparam int unsigned BWH = `HCI_SIZE_GET_BW(hwpe);
9996
localparam int unsigned UWH = `HCI_SIZE_GET_UW(hwpe);
10097
localparam int unsigned EWH = `HCI_SIZE_GET_EW(hwpe);
98+
localparam int unsigned FDH = `HCI_SIZE_GET_FD(hwpe);
10199
localparam int unsigned N_CHUNK = DWH / CHUNK_SIZE;
102100
localparam int unsigned EW_DW = $clog2(CHUNK_SIZE)+2;
103101

@@ -362,7 +360,7 @@ module hci_ecc_interconnect
362360
);
363361

364362
hci_router #(
365-
.FIFO_DEPTH ( EXPFIFO ),
363+
.FIFO_DEPTH ( FDH ),
366364
.NB_OUT_CHAN ( N_MEM ),
367365
.USE_ECC ( 1 ),
368366
.FILTER_WRITE_R_VALID ( FILTER_WRITE_R_VALID[0] ),

rtl/hci_interconnect.sv

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
4343
* | *IW* | `N_HWPE+N_CORE+N_DMA+N_EXT` | ID Width. |
4444
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
45-
* | *EXPFIFO* | 0 | Depth of HCI router FIFO. |
45+
* | *FD* | 0 | Depth of HCI router FIFO. |
4646
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
4747
* | *SEL_LIC* | 0 | Kind of LIC to instantiate (0=regular L1, 1=L2). |
4848
* +---------------------+-----------------------------+----------------------------------------------------------------------------------+
@@ -60,7 +60,6 @@ module hci_interconnect
6060
parameter int unsigned N_MEM = 16 , // Number of Memory banks
6161
parameter int unsigned TS_BIT = 21 , // TEST_SET_BIT (for Log Interconnect)
6262
parameter int unsigned IW = N_HWPE+N_CORE+N_DMA+N_EXT, // ID Width
63-
parameter int unsigned EXPFIFO = 0 , // FIFO Depth for HWPE Interconnect
6463
parameter int unsigned SEL_LIC = 0 , // Log interconnect type selector
6564
parameter int unsigned FILTER_WRITE_R_VALID[0:N_HWPE-1] = '{default: 0},
6665
parameter hci_size_parameter_t `HCI_SIZE_PARAM(cores) = '0,
@@ -93,6 +92,7 @@ module hci_interconnect
9392
localparam int unsigned BWH = `HCI_SIZE_GET_BW(hwpe);
9493
localparam int unsigned UWH = `HCI_SIZE_GET_UW(hwpe);
9594
localparam int unsigned IWH = `HCI_SIZE_GET_IW(hwpe);
95+
localparam int unsigned FDH = `HCI_SIZE_GET_FD(hwpe);
9696

9797
localparam hci_size_parameter_t `HCI_SIZE_PARAM(all_except_hwpe) = '{
9898
DW: DEFAULT_DW,
@@ -101,7 +101,8 @@ module hci_interconnect
101101
UW: UW_LIC,
102102
IW: DEFAULT_IW,
103103
EW: DEFAULT_EW,
104-
EHW: DEFAULT_EHW
104+
EHW: DEFAULT_EHW,
105+
FD: DEFAULT_FD
105106
};
106107
hci_core_intf #(
107108
.DW ( DEFAULT_DW ),
@@ -129,7 +130,8 @@ module hci_interconnect
129130
UW: UW_LIC,
130131
IW: IW,
131132
EW: DEFAULT_EW,
132-
EHW: DEFAULT_EHW
133+
EHW: DEFAULT_EHW,
134+
FD: DEFAULT_FD
133135
};
134136
`HCI_INTF_ARRAY(all_except_hwpe_mem, clk_i, 0:N_MEM-1);
135137

@@ -140,7 +142,8 @@ module hci_interconnect
140142
UW: UW_LIC,
141143
IW: IW,
142144
EW: DEFAULT_EW,
143-
EHW: DEFAULT_EHW
145+
EHW: DEFAULT_EHW,
146+
FD: DEFAULT_FD
144147
};
145148
`HCI_INTF_ARRAY(hwpe_mem_muxed, clk_i, 0:N_MEM-1);
146149

@@ -152,7 +155,8 @@ module hci_interconnect
152155
UW: UW_LIC,
153156
IW: IW,
154157
EW: DEFAULT_EW,
155-
EHW: DEFAULT_EHW
158+
EHW: DEFAULT_EHW,
159+
FD: DEFAULT_FD
156160
};
157161
`HCI_INTF_ARRAY(hwpe_mem, clk_i, 0:N_HWPE*N_MEM-1);
158162

@@ -165,7 +169,8 @@ module hci_interconnect
165169
.UW(UWH),
166170
.IW(IWH),
167171
.EW(DEFAULT_EW),
168-
.EHW(DEFAULT_EHW)
172+
.EHW(DEFAULT_EHW),
173+
.FD(FDH)
169174
) hwpe_to_router (
170175
.clk(clk_i)
171176
);
@@ -239,7 +244,7 @@ module hci_interconnect
239244
for(genvar ii=0; ii<N_HWPE; ii++) begin : hwpe_req2mem
240245

241246
hci_router #(
242-
.FIFO_DEPTH ( EXPFIFO ),
247+
.FIFO_DEPTH ( FDH ),
243248
.NB_OUT_CHAN ( N_MEM ),
244249
.FILTER_WRITE_R_VALID ( FILTER_WRITE_R_VALID[ii] ),
245250
.`HCI_SIZE_PARAM(in) ( `HCI_SIZE_PARAM(hwpe) ),

0 commit comments

Comments
 (0)