Skip to content

Commit 8ebf03c

Browse files
committed
Convert "hci-outstanding" modules back to "hci-core" modules
1 parent f5afba2 commit 8ebf03c

11 files changed

Lines changed: 118 additions & 1216 deletions

Bender.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,15 @@ sources:
4343
- rtl/core/hci_core_mux_ooo.sv
4444
- rtl/core/hci_core_r_valid_filter.sv
4545
- rtl/core/hci_core_r_id_filter.sv
46+
- rtl/core/hci_core_rob.sv
4647
- rtl/core/hci_core_source.sv
4748
- rtl/core/hci_core_source_v2.sv
4849
- rtl/core/hci_core_split.sv
4950
- rtl/ecc/hci_ecc_dec.sv
5051
- rtl/ecc/hci_ecc_enc.sv
5152
- rtl/ecc/hci_ecc_manager.sv
52-
- rtl/outstanding/hci_outstanding_assign.sv
53-
- rtl/outstanding/hci_outstanding_mux.sv
54-
- rtl/outstanding/hci_outstanding_rob.sv
55-
- rtl/outstanding/hci_outstanding_source.sv
56-
- rtl/outstanding/hci_outstanding_fifo.sv
53+
- rtl/variablelatency/hci_variablelatency_assign.sv
54+
- rtl/variablelatency/hci_variablelatency_tocore.sv
5755
- rtl/interco/hci_log_interconnect.sv
5856
- rtl/interco/deprecated/hci_log_interconnect_l2.sv
5957
- rtl/interco/hci_new_log_interconnect.sv # `new_XBAR_TCDM` dep. is a private repo
@@ -66,7 +64,6 @@ sources:
6664
- rtl/core/hci_core_sink.sv
6765
- rtl/ecc/hci_ecc_source.sv
6866
- rtl/core/hci_core_sink_v2.sv
69-
- rtl/outstanding/hci_outstanding_sink.sv
7067
- rtl/interco/hci_router.sv
7168
# Level 4
7269
- rtl/ecc/hci_ecc_interconnect.sv

rtl/common/hci_helpers.svh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@
346346
`define HCI_SIZE_CHECK_ASSERTS(__intf) `HCI_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(`HCI_SIZE_PARAM(__intf), __intf)
347347

348348
// Asserts (generic definition usable with any parameter name)
349-
`define HCI_OUTSTANDING_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(__xparam, __xintf) \
349+
`define HCI_VARIABLELATENCY_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(__xparam, __xintf) \
350350
initial __xparam``_intf_size_check_dw : assert(__xparam.DW == `HCI_SIZE_GET_DW_CHECK(__xintf)); \
351351
initial __xparam``_intf_size_check_bw : assert(__xparam.BW == `HCI_SIZE_GET_BW_CHECK(__xintf)); \
352352
initial __xparam``_intf_size_check_aw : assert(__xparam.AW == `HCI_SIZE_GET_AW_CHECK(__xintf)); \
353353
initial __xparam``_intf_size_check_uw : assert(__xparam.UW == `HCI_SIZE_GET_UW_CHECK(__xintf)); \
354354
initial __xparam``_intf_size_check_iw : assert(__xparam.IW == `HCI_SIZE_GET_IW_CHECK(__xintf));
355355

356356
// Asserts (specialized definition for conventional param names
357-
`define HCI_OUTSTANDING_SIZE_CHECK_ASSERTS(__intf) `HCI_OUTSTANDING_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(`HCI_SIZE_PARAM(__intf), __intf)
357+
`define HCI_VARIABLELATENCY_SIZE_CHECK_ASSERTS(__intf) `HCI_VARIABLELATENCY_SIZE_CHECK_ASSERTS_EXPLICIT_PARAM(`HCI_SIZE_PARAM(__intf), __intf)
358358

359359
`endif
360360

rtl/common/hci_interfaces.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ interface hci_core_intf (
208208

209209
endinterface // hci_core_intf
210210

211-
interface hci_outstanding_intf (
211+
interface hci_variablelatency_intf (
212212
input logic clk
213213
);
214214

@@ -291,7 +291,7 @@ interface hci_outstanding_intf (
291291
input resp_ready
292292
);
293293

294-
endinterface // hci_outstanding_intf
294+
endinterface // hci_variablelatency_intf
295295

296296
`ifdef BUILD_DEPRECATED
297297
interface hci_mem_intf (
Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* hci_outstanding_rob.sv
2+
* hci_core_rob.sv
33
* Marco Bertuletti <mbertuletti@iis.ee.ethz.ch>
44
*
55
* Copyright (C) 2017-2023 ETH Zurich, University of Bologna
@@ -14,16 +14,16 @@
1414
*/
1515

1616
/**
17-
* The **HCI-Outstanding reorder buffer** issues requests with up to ROB_NW
17+
* The **HCI-Core reorder buffer** issues requests with up to ROB_NW
1818
* unique user-IDs. The responses can be retired out-of-order, by comparing
1919
* the incoming response user-ID with the issued IDs. As the user-ID is
2020
* implemented as user signal, any module coming after (i.e., nearer to memory
2121
* side) with respect to this block must respect user signals - specifically
2222
* it must return them identical in the response.
2323
*
2424
* .. tabularcolumns:: |l|l|J|
25-
* .. _hci_outstanding_rob_params:
26-
* .. table:: **hci_outstanding_mux** design-time parameters.
25+
* .. _hci_core_rob_params:
26+
* .. table:: **hci_core_rob** design-time parameters.
2727
*
2828
* +------------+-------------+-----------------------------------------------+
2929
* | **Name** | **Default** | **Description** |
@@ -35,7 +35,7 @@
3535

3636
`include "hci_helpers.svh"
3737

38-
module hci_outstanding_rob
38+
module hci_core_rob
3939
import hwpe_stream_package::*;
4040
import hci_package::*;
4141
import cf_math_pkg::idx_width;
@@ -48,15 +48,17 @@ module hci_outstanding_rob
4848
input logic clk_i,
4949
input logic rst_ni,
5050

51-
hci_outstanding_intf.target in,
52-
hci_outstanding_intf.initiator out
51+
hci_core_intf.target in,
52+
hci_core_intf.initiator out
5353
);
5454

5555
localparam int unsigned DW = `HCI_SIZE_GET_DW(out);
5656
localparam int unsigned BW = `HCI_SIZE_GET_BW(out);
5757
localparam int unsigned AW = `HCI_SIZE_GET_AW(out);
5858
localparam int unsigned UW = `HCI_SIZE_GET_UW(out);
5959
localparam int unsigned IW = `HCI_SIZE_GET_IW(out);
60+
localparam int unsigned EW = `HCI_SIZE_GET_EW(out);
61+
localparam int unsigned EHW = `HCI_SIZE_GET_EHW(out);
6062

6163
// Pointers to memory queue and total words counter
6264
logic [ROB_IW-1:0] read_pointer_p, read_pointer_q;
@@ -72,39 +74,55 @@ module hci_outstanding_rob
7274
// Memory queue
7375
logic [ROB_NW-1:0][IW-1:0] mem_req_id_p, mem_req_id_q;
7476
logic [ROB_NW-1:0][DW-1:0] mem_resp_data_p, mem_resp_data_q;
77+
logic [ROB_NW-1:0][EW-1:0] mem_resp_ecc_p, mem_resp_ecc_q;
7578
logic [ROB_NW-1:0] mem_resp_opc_p, mem_resp_opc_q;
7679
logic [ROB_NW-1:0] mem_resp_valid_p, mem_resp_valid_q;
7780

7881
// HCI Port Left assignment
79-
assign out.req_add = in.req_add;
80-
assign out.req_wen = in.req_wen;
81-
assign out.req_be = in.req_be;
82-
assign out.req_data = in.req_data;
82+
assign out.add = in.add;
83+
assign out.wen = in.wen;
84+
assign out.be = in.be;
85+
assign out.data = in.data;
86+
assign out.ecc = in.ecc;
8387

8488
// Assign unique ROB ID to the user field
85-
assign out.req_user = write_pointer_q;
86-
assign out.req_id = in.req_id;
87-
assign out.req_valid = !full & in.req_valid;
88-
assign in.req_ready = !full & out.req_ready;
89+
assign out.user = write_pointer_q;
90+
assign out.id = in.id;
91+
assign out.req = !full & in.req;
92+
assign in.gnt = !full & out.gnt;
8993

9094
// HCI Port Right assignment
91-
assign in.resp_data = mem_resp_data_q[read_pointer_q];
92-
assign in.resp_opc = mem_resp_opc_q[read_pointer_q];
93-
assign in.resp_user = '0;
95+
assign in.r_data = mem_resp_data_q[read_pointer_q];
96+
assign in.r_opc = mem_resp_opc_q[read_pointer_q];
97+
assign in.r_user = '0;
98+
assign in.r_ecc = mem_resp_ecc_q[read_pointer_q];
9499

95100
// ROB ID of the incoming response
96-
assign in.resp_id = mem_req_id_q[read_pointer_q];
97-
assign in.resp_valid = mem_resp_valid_q[read_pointer_q];
98-
assign out.resp_ready = !empty;
101+
assign in.r_id = mem_req_id_q[read_pointer_q];
102+
assign in.r_valid = mem_resp_valid_q[read_pointer_q];
103+
assign out.r_ready = !empty;
104+
105+
if (EHW > 0) begin : ecc_handshake_gen
106+
assign out.ereq = '{default: {out.req}};
107+
assign in.egnt = '{default: {in.gnt}};
108+
assign in.r_evalid = '{default: {in.r_valid}};
109+
assign out.r_eready = '{default: {out.r_ready}};
110+
end
111+
else begin : no_ecc_handshake_gen
112+
assign out.ereq = '0;
113+
assign in.egnt = '1;
114+
assign in.r_evalid = '0;
115+
assign out.r_eready = '1;
116+
end
99117

100118
// Assign status flags
101119
assign full = (status_cnt_q == ROB_NW-1);
102120
assign empty = (status_cnt_q == 'd0);
103121

104122
// Assign buffer commands
105-
assign request_id = in.req_valid & in.req_ready;
106-
assign pop = mem_resp_valid_q[read_pointer_q] & in.resp_ready;
107-
assign push = out.resp_valid & out.resp_ready;
123+
assign request_id = in.req & in.gnt;
124+
assign pop = mem_resp_valid_q[read_pointer_q] & in.r_ready;
125+
assign push = out.r_valid & out.r_ready;
108126

109127
// Read and Write logic
110128
always_comb begin: read_write_comb
@@ -117,13 +135,14 @@ module hci_outstanding_rob
117135
// Maintain response queue & initiator_id queue
118136
mem_req_id_p = mem_req_id_q;
119137
mem_resp_data_p = mem_resp_data_q;
138+
mem_resp_ecc_p = mem_resp_ecc_q;
120139
mem_resp_opc_p = mem_resp_opc_q;
121140
mem_resp_valid_p = mem_resp_valid_q;
122141

123142
// Request an ID.
124143
if (request_id) begin
125144
// Store in the initiator_id queue
126-
mem_req_id_p[write_pointer_q] = in.req_id;
145+
mem_req_id_p[write_pointer_q] = in.id;
127146

128147
// Increment the write pointer
129148
if (write_pointer_q == ROB_NW-1) begin
@@ -139,16 +158,18 @@ module hci_outstanding_rob
139158

140159
// Push data
141160
if (push) begin
142-
resp_write_id = out.resp_user;
143-
mem_resp_data_p [resp_write_id] = out.resp_data;
144-
mem_resp_opc_p [resp_write_id] = out.resp_opc;
145-
mem_resp_valid_p [resp_write_id] = out.resp_valid;
161+
resp_write_id = out.r_user;
162+
mem_resp_data_p [resp_write_id] = out.r_data;
163+
mem_resp_ecc_p [resp_write_id] = out.r_ecc;
164+
mem_resp_opc_p [resp_write_id] = out.r_opc;
165+
mem_resp_valid_p [resp_write_id] = out.r_valid;
146166
end
147167

148168
// Pop data
149169
if (pop) begin
150170
// Word was consumed
151171
mem_req_id_p[read_pointer_q] = 1'b0;
172+
mem_resp_ecc_p[read_pointer_q] = '0;
152173
mem_resp_valid_p[read_pointer_q] = 1'b0;
153174

154175
// Increment the read pointer
@@ -178,6 +199,7 @@ module hci_outstanding_rob
178199
// Memory queues
179200
mem_req_id_q <= '0;
180201
mem_resp_data_q <= '0;
202+
mem_resp_ecc_q <= '0;
181203
mem_resp_opc_q <= '0;
182204
mem_resp_valid_q <= '0;
183205
end
@@ -188,6 +210,7 @@ module hci_outstanding_rob
188210
// Memory queues
189211
mem_req_id_q <= mem_req_id_p;
190212
mem_resp_data_q <= mem_resp_data_p;
213+
mem_resp_ecc_q <= mem_resp_ecc_p;
191214
mem_resp_opc_q <= mem_resp_opc_p;
192215
mem_resp_valid_q <= mem_resp_valid_p;
193216
end
@@ -216,10 +239,10 @@ module hci_outstanding_rob
216239
initial
217240
iw_out : assert(out.UW >= $clog2(ROB_NW));
218241

219-
`HCI_OUTSTANDING_SIZE_CHECK_ASSERTS(out);
242+
`HCI_VARIABLELATENCY_SIZE_CHECK_ASSERTS(out);
220243

221244
`endif
222245
`endif
223246
`endif;
224247

225-
endmodule: hci_outstanding_rob
248+
endmodule: hci_core_rob

rtl/core/hci_core_source.sv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ module hci_core_source
223223
);
224224
assign addr_misaligned_push.data = {6'b0, addr_pop.data[1:0]};
225225
assign addr_misaligned_push.strb = '1;
226-
assign addr_misaligned_push.valid = enable_i & tcdm.req & tcdm.gnt; // BEWARE: considered always ready!!!
226+
assign addr_misaligned_push.valid = enable_i & tcdm.gnt; // BEWARE: considered always ready!!!
227227
assign addr_misaligned_pop.ready = (tcdm.r_valid | stream_valid_q) & stream.ready;
228228
assign addr_misaligned_q = addr_misaligned_pop.data[1:0];
229229

@@ -245,7 +245,7 @@ module hci_core_source
245245
end
246246

247247
assign tcdm.r_ready = stream.ready;
248-
assign tcdm.req = (cs != STREAMER_IDLE) ? addr_pop.valid & stream.ready : '0;
248+
assign tcdm.req = (cs != STREAMER_IDLE) ? addr_pop.valid : '0;
249249
assign tcdm.add = (cs != STREAMER_IDLE) ? {addr_pop.data[31:2],2'b0} : '0;
250250
assign tcdm.wen = 1'b1;
251251
assign tcdm.be = 4'h0;
@@ -256,7 +256,7 @@ module hci_core_source
256256
assign stream.strb = '1;
257257
assign stream.data = stream_data_aligned;
258258
assign stream.valid = enable_i & (tcdm.r_valid | stream_valid_q); // is this strictly necessary to keep the HWPE-Stream protocol? or can be avoided with a FIFO q?
259-
assign addr_pop.ready = (cs != STREAMER_IDLE) ? addr_pop.valid & stream.ready & tcdm.gnt : 1'b0;
259+
assign addr_pop.ready = (cs != STREAMER_IDLE) ? tcdm.gnt : 1'b0;
260260

261261
always_ff @(posedge clk_i or negedge rst_ni)
262262
begin

0 commit comments

Comments
 (0)