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
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** |
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
0 commit comments