Skip to content

Commit f0cfdde

Browse files
cache: remove CMO-related deadcode (#3340)
Removes dead code related to the support of CMOs with the HPDcache. Previously, to support CMOs it was expected to have a dedicated port from the CVA6. Now, this has been enhanced, and CMO requests (Zicbom extension), are forwarded through the existing load/store ports. Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
1 parent c74e3ab commit f0cfdde

3 files changed

Lines changed: 20 additions & 94 deletions

File tree

core/cache_subsystem/cva6_hpdcache_subsystem.sv

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ module cva6_hpdcache_subsystem
3434
parameter type axi_b_chan_t = logic,
3535
parameter type axi_r_chan_t = logic,
3636
parameter type noc_req_t = logic,
37-
parameter type noc_resp_t = logic,
38-
parameter type cmo_req_t = logic,
39-
parameter type cmo_rsp_t = logic
37+
parameter type noc_resp_t = logic
4038
)
4139
// }}}
4240

@@ -91,10 +89,6 @@ module cva6_hpdcache_subsystem
9189
input ariane_pkg::amo_req_t dcache_amo_req_i,
9290
// AMO response - EX_STAGE
9391
output ariane_pkg::amo_resp_t dcache_amo_resp_o,
94-
// CMO interface request - TO_BE_COMPLETED
95-
input cmo_req_t dcache_cmo_req_i,
96-
// CMO interface response - TO_BE_COMPLETED
97-
output cmo_rsp_t dcache_cmo_resp_o,
9892
// Data cache input request ports - EX_STAGE
9993
input dcache_req_i_t [NumPorts-1:0] dcache_req_ports_i,
10094
// Data cache output request ports - EX_STAGE
@@ -185,9 +179,8 @@ module cva6_hpdcache_subsystem
185179
// .
186180
// .
187181
// .
188-
// NumPorts: CMO
189-
// NumPorts + 1: Hardware Memory Prefetcher (hwpf)
190-
localparam int HPDCACHE_NREQUESTERS = NumPorts + 2;
182+
// NumPorts: Hardware Memory Prefetcher (hwpf)
183+
localparam int HPDCACHE_NREQUESTERS = NumPorts + 1;
191184

192185
function automatic hpdcache_pkg::hpdcache_user_cfg_t hpdcacheSetConfig();
193186
hpdcache_pkg::hpdcache_user_cfg_t userCfg;
@@ -295,8 +288,6 @@ module cva6_hpdcache_subsystem
295288
.dcache_req_o_t(dcache_req_o_t),
296289
.NumPorts(NumPorts),
297290
.NrHwPrefetchers(NrHwPrefetchers),
298-
.cmo_req_t(cmo_req_t),
299-
.cmo_rsp_t(cmo_rsp_t),
300291
.hpdcache_mem_addr_t(hpdcache_mem_addr_t),
301292
.hpdcache_mem_id_t(hpdcache_mem_id_t),
302293
.hpdcache_mem_data_t(hpdcache_mem_data_t),
@@ -325,8 +316,6 @@ module cva6_hpdcache_subsystem
325316
.dcache_miss_o(dcache_miss_o),
326317
.dcache_amo_req_i(dcache_amo_req_i),
327318
.dcache_amo_resp_o(dcache_amo_resp_o),
328-
.dcache_cmo_req_i(dcache_cmo_req_i),
329-
.dcache_cmo_resp_o(dcache_cmo_resp_o),
330319
.dcache_req_ports_i(dcache_req_ports_i),
331320
.dcache_req_ports_o(dcache_req_ports_o),
332321
.wbuffer_empty_o(wbuffer_empty_o),

core/cache_subsystem/cva6_hpdcache_wrapper.sv

Lines changed: 16 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ module cva6_hpdcache_wrapper
2323
parameter int NumPorts = 4,
2424
parameter int NrHwPrefetchers = 4,
2525

26-
parameter type cmo_req_t = logic,
27-
parameter type cmo_rsp_t = logic,
2826
parameter type hpdcache_mem_addr_t = logic,
2927
parameter type hpdcache_mem_id_t = logic,
3028
parameter type hpdcache_mem_data_t = logic,
@@ -73,9 +71,6 @@ module cva6_hpdcache_wrapper
7371
// AMO request/response - EX_STAGE
7472
input ariane_pkg::amo_req_t dcache_amo_req_i,
7573
output ariane_pkg::amo_resp_t dcache_amo_resp_o,
76-
// CMO interface request/response
77-
input cmo_req_t dcache_cmo_req_i,
78-
output cmo_rsp_t dcache_cmo_resp_o,
7974
// Data cache input request/response ports - EX_STAGE
8075
input dcache_req_i_t [NumPorts-1:0] dcache_req_ports_i,
8176
output dcache_req_o_t [NumPorts-1:0] dcache_req_ports_o,
@@ -119,7 +114,7 @@ module cva6_hpdcache_wrapper
119114
input hpdcache_mem_resp_w_t dcache_mem_resp_write_i
120115
);
121116

122-
localparam int HPDCACHE_NREQUESTERS = NumPorts + 2;
117+
localparam int HPDCACHE_NREQUESTERS = NumPorts + 1;
123118

124119
typedef logic [63:0] hwpf_stride_param_t;
125120

@@ -133,13 +128,11 @@ module cva6_hpdcache_wrapper
133128
hpdcache_rsp_t dcache_rsp [HPDCACHE_NREQUESTERS];
134129
logic dcache_read_miss, dcache_write_miss;
135130

136-
logic [ 2:0] snoop_valid;
137-
logic [ 2:0] snoop_abort;
138-
hpdcache_req_offset_t [ 2:0] snoop_addr_offset;
139-
hpdcache_tag_t [ 2:0] snoop_addr_tag;
140-
logic [ 2:0] snoop_phys_indexed;
141-
142-
logic dcache_cmo_req_is_prefetch;
131+
logic [ 1:0] snoop_valid;
132+
logic [ 1:0] snoop_abort;
133+
hpdcache_req_offset_t [ 1:0] snoop_addr_offset;
134+
hpdcache_tag_t [ 1:0] snoop_addr_tag;
135+
logic [ 1:0] snoop_phys_indexed;
143136

144137
hwpf_stride_pkg::hwpf_stride_throttle_t [NrHwPrefetchers-1:0] hwpf_throttle_in;
145138
hwpf_stride_pkg::hwpf_stride_throttle_t [NrHwPrefetchers-1:0] hwpf_throttle_out;
@@ -224,37 +217,6 @@ module cva6_hpdcache_wrapper
224217
.hpdcache_rsp_valid_i(dcache_rsp_valid[NumPorts-1]),
225218
.hpdcache_rsp_i (dcache_rsp[NumPorts-1])
226219
);
227-
228-
`ifdef HPDCACHE_ENABLE_CMO
229-
cva6_hpdcache_cmo_if_adapter #(
230-
.cmo_req_t(cmo_req_t),
231-
.cmo_rsp_t(cmo_rsp_t)
232-
) i_cva6_hpdcache_cmo_if_adapter (
233-
.clk_i,
234-
.rst_ni,
235-
236-
.dcache_req_sid_i(hpdcache_req_sid_t'(NumPorts)),
237-
238-
.cva6_cmo_req_i (dcache_cmo_req_i),
239-
.cva6_cmo_resp_o(dcache_cmo_resp_o),
240-
241-
.dcache_req_valid_o(dcache_req_valid[NumPorts]),
242-
.dcache_req_ready_i(dcache_req_ready[NumPorts]),
243-
.dcache_req_o (dcache_req[NumPorts]),
244-
.dcache_req_abort_o(dcache_req_abort[NumPorts]),
245-
.dcache_req_tag_o (dcache_req_tag[NumPorts]),
246-
.dcache_req_pma_o (dcache_req_pma[NumPorts]),
247-
248-
.dcache_rsp_valid_i(dcache_rsp_valid[NumPorts]),
249-
.dcache_rsp_i (dcache_rsp[NumPorts])
250-
);
251-
`else
252-
assign dcache_req_valid[NumPorts] = 1'b0,
253-
dcache_req[NumPorts] = '0,
254-
dcache_req_abort[NumPorts] = 1'b0,
255-
dcache_req_tag[NumPorts] = '0,
256-
dcache_req_pma[NumPorts] = '0;
257-
`endif
258220
endgenerate
259221

260222
// Snoop load port
@@ -271,26 +233,6 @@ module cva6_hpdcache_wrapper
271233
snoop_addr_tag[1] = dcache_req_tag[NumPorts-1],
272234
snoop_phys_indexed[1] = dcache_req[NumPorts-1].phys_indexed;
273235

274-
`ifdef HPDCACHE_ENABLE_CMO
275-
// Snoop CMO port (in case of read prefetch accesses)
276-
assign dcache_cmo_req_is_prefetch = hpdcache_pkg::is_cmo_prefetch(
277-
dcache_req[NumPorts].op, dcache_req[NumPorts].size
278-
);
279-
assign snoop_valid[2] = dcache_req_valid[NumPorts]
280-
& dcache_req_ready[NumPorts]
281-
& dcache_cmo_req_is_prefetch,
282-
snoop_abort[2] = dcache_req_abort[NumPorts],
283-
snoop_addr_offset[2] = dcache_req[NumPorts].addr_offset,
284-
snoop_addr_tag[2] = dcache_req_tag[NumPorts],
285-
snoop_phys_indexed[2] = dcache_req[NumPorts].phys_indexed;
286-
`else
287-
assign snoop_valid[2] = 1'b0,
288-
snoop_abort[2] = 1'b0,
289-
snoop_addr_offset[2] = '0,
290-
snoop_addr_tag[2] = '0,
291-
snoop_phys_indexed[2] = 1'b0;
292-
`endif
293-
294236
generate
295237
for (genvar h = 0; h < NrHwPrefetchers; h++) begin : gen_hwpf_throttle
296238
assign hwpf_throttle_in[h] = hwpf_stride_pkg::hwpf_stride_throttle_t'(hwpf_throttle_i[h]);
@@ -301,7 +243,7 @@ module cva6_hpdcache_wrapper
301243
hwpf_stride_wrapper #(
302244
.HPDcacheCfg (HPDcacheCfg),
303245
.NUM_HW_PREFETCH (NrHwPrefetchers),
304-
.NUM_SNOOP_PORTS (3),
246+
.NUM_SNOOP_PORTS (2),
305247
.hpdcache_tag_t (hpdcache_tag_t),
306248
.hpdcache_req_offset_t(hpdcache_req_offset_t),
307249
.hpdcache_req_data_t (hpdcache_req_data_t),
@@ -331,16 +273,16 @@ module cva6_hpdcache_wrapper
331273
.snoop_addr_tag_i (snoop_addr_tag),
332274
.snoop_phys_indexed_i(snoop_phys_indexed),
333275

334-
.hpdcache_req_sid_i(hpdcache_req_sid_t'(NumPorts + 1)),
276+
.hpdcache_req_sid_i(hpdcache_req_sid_t'(NumPorts)),
335277

336-
.hpdcache_req_valid_o(dcache_req_valid[NumPorts+1]),
337-
.hpdcache_req_ready_i(dcache_req_ready[NumPorts+1]),
338-
.hpdcache_req_o (dcache_req[NumPorts+1]),
339-
.hpdcache_req_abort_o(dcache_req_abort[NumPorts+1]),
340-
.hpdcache_req_tag_o (dcache_req_tag[NumPorts+1]),
341-
.hpdcache_req_pma_o (dcache_req_pma[NumPorts+1]),
342-
.hpdcache_rsp_valid_i(dcache_rsp_valid[NumPorts+1]),
343-
.hpdcache_rsp_i (dcache_rsp[NumPorts+1])
278+
.hpdcache_req_valid_o(dcache_req_valid[NumPorts]),
279+
.hpdcache_req_ready_i(dcache_req_ready[NumPorts]),
280+
.hpdcache_req_o (dcache_req[NumPorts]),
281+
.hpdcache_req_abort_o(dcache_req_abort[NumPorts]),
282+
.hpdcache_req_tag_o (dcache_req_tag[NumPorts]),
283+
.hpdcache_req_pma_o (dcache_req_pma[NumPorts]),
284+
.hpdcache_rsp_valid_i(dcache_rsp_valid[NumPorts]),
285+
.hpdcache_rsp_i (dcache_rsp[NumPorts])
344286
);
345287

346288
hpdcache #(

core/cva6.sv

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,9 +1466,7 @@ module cva6
14661466
.axi_b_chan_t (b_chan_t),
14671467
.axi_r_chan_t (r_chan_t),
14681468
.noc_req_t (noc_req_t),
1469-
.noc_resp_t(noc_resp_t),
1470-
.cmo_req_t (logic /*FIXME*/),
1471-
.cmo_rsp_t (logic /*FIXME*/)
1469+
.noc_resp_t(noc_resp_t)
14721470
) i_cache_subsystem (
14731471
.clk_i (clk_i),
14741472
.rst_ni(rst_ni),
@@ -1489,9 +1487,6 @@ module cva6
14891487
.dcache_amo_req_i (amo_req),
14901488
.dcache_amo_resp_o(amo_resp),
14911489

1492-
.dcache_cmo_req_i ('0 /*FIXME*/),
1493-
.dcache_cmo_resp_o( /*FIXME*/),
1494-
14951490
.dcache_req_ports_i(dcache_req_to_cache),
14961491
.dcache_req_ports_o(dcache_req_from_cache),
14971492

0 commit comments

Comments
 (0)