Line data Source code
1 : // SPDX-License-Identifier: Apache-2.0
2 : // Copyright 2020 Western Digital Corporation or its affiliates.
3 : //
4 : // Licensed under the Apache License, Version 2.0 (the "License");
5 : // you may not use this file except in compliance with the License.
6 : // You may obtain a copy of the License at
7 : //
8 : // http://www.apache.org/licenses/LICENSE-2.0
9 : //
10 : // Unless required by applicable law or agreed to in writing, software
11 : // distributed under the License is distributed on an "AS IS" BASIS,
12 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 : // See the License for the specific language governing permissions and
14 : // limitations under the License.
15 :
16 : //********************************************************************************
17 : // $Id$
18 : //
19 : // Function: Top level VeeR core file
20 : // Comments:
21 : //
22 : //********************************************************************************
23 : module el2_veer
24 : import el2_pkg::*;
25 : #(
26 : `include "el2_param.vh"
27 : )
28 : (
29 69887189 : input logic clk,
30 338 : input logic rst_l,
31 338 : input logic dbg_rst_l,
32 0 : input logic [31:1] rst_vec,
33 3 : input logic nmi_int,
34 16 : input logic [31:1] nmi_vec,
35 338 : output logic core_rst_l, // This is "rst_l | dbg_rst_l"
36 :
37 69887189 : output logic active_l2clk,
38 69887189 : output logic free_l2clk,
39 :
40 579463 : output logic [31:0] trace_rv_i_insn_ip,
41 340 : output logic [31:0] trace_rv_i_address_ip,
42 6173412 : output logic trace_rv_i_valid_ip,
43 5208 : output logic trace_rv_i_exception_ip,
44 4 : output logic [4:0] trace_rv_i_ecause_ip,
45 28 : output logic trace_rv_i_interrupt_ip,
46 62 : output logic [31:0] trace_rv_i_tval_ip,
47 :
48 :
49 2 : output logic dccm_clk_override,
50 2 : output logic icm_clk_override,
51 8 : output logic dec_tlu_core_ecc_disable,
52 :
53 : // external halt/run interface
54 108 : input logic i_cpu_halt_req, // Asynchronous Halt request to CPU
55 108 : input logic i_cpu_run_req, // Asynchronous Restart request to CPU
56 108 : output logic o_cpu_halt_ack, // Core Acknowledge to Halt request
57 108 : output logic o_cpu_halt_status, // 1'b1 indicates processor is halted
58 108 : output logic o_cpu_run_ack, // Core Acknowledge to run request
59 118 : output logic o_debug_mode_status, // Core to the PMU that core is in debug mode. When core is in debug mode, the PMU should refrain from sendng a halt or run request
60 :
61 0 : input logic [31:4] core_id, // CORE ID
62 :
63 : // external MPC halt/run interface
64 108 : input logic mpc_debug_halt_req, // Async halt request
65 108 : input logic mpc_debug_run_req, // Async run request
66 338 : input logic mpc_reset_run_req, // Run/halt after reset
67 108 : output logic mpc_debug_halt_ack, // Halt ack
68 108 : output logic mpc_debug_run_ack, // Run ack
69 2 : output logic debug_brkpt_status, // debug breakpoint
70 :
71 340148 : output logic dec_tlu_perfcnt0, // toggles when slot0 perf counter 0 has an event inc
72 514626 : output logic dec_tlu_perfcnt1,
73 312914 : output logic dec_tlu_perfcnt2,
74 48468 : output logic dec_tlu_perfcnt3,
75 :
76 : // DCCM ports
77 262894 : output logic dccm_wren,
78 561000 : output logic dccm_rden,
79 18811 : output logic [pt.DCCM_BITS-1:0] dccm_wr_addr_lo,
80 18811 : output logic [pt.DCCM_BITS-1:0] dccm_wr_addr_hi,
81 471334 : output logic [pt.DCCM_BITS-1:0] dccm_rd_addr_lo,
82 677729 : output logic [pt.DCCM_BITS-1:0] dccm_rd_addr_hi,
83 5376 : output logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_wr_data_lo,
84 5376 : output logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_wr_data_hi,
85 :
86 47176 : input logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_rd_data_lo,
87 47176 : input logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_rd_data_hi,
88 :
89 : // ICCM ports
90 160275 : output logic [pt.ICCM_BITS-1:1] iccm_rw_addr,
91 74 : output logic iccm_wren,
92 133206 : output logic iccm_rden,
93 0 : output logic [2:0] iccm_wr_size,
94 14 : output logic [77:0] iccm_wr_data,
95 8 : output logic iccm_buf_correct_ecc,
96 8 : output logic iccm_correction_state,
97 :
98 136532 : input logic [63:0] iccm_rd_data,
99 161264 : input logic [77:0] iccm_rd_data_ecc,
100 :
101 : // ICache , ITAG ports
102 490 : output logic [31:1] ic_rw_addr,
103 255918 : output logic [pt.ICACHE_NUM_WAYS-1:0] ic_tag_valid,
104 10432 : output logic [pt.ICACHE_NUM_WAYS-1:0] ic_wr_en,
105 680962 : output logic ic_rd_en,
106 :
107 560643 : output logic [pt.ICACHE_BANKS_WAY-1:0][70:0] ic_wr_data, // Data to fill to the Icache. With ECC
108 2137096 : input logic [63:0] ic_rd_data , // Data read from Icache. 2x64bits + parity bits. F2 stage. With ECC
109 231587 : input logic [70:0] ic_debug_rd_data , // Data read from Icache. 2x64bits + parity bits. F2 stage. With ECC
110 0 : input logic [25:0] ictag_debug_rd_data,// Debug icache tag.
111 0 : output logic [70:0] ic_debug_wr_data, // Debug wr cache.
112 :
113 0 : input logic [pt.ICACHE_BANKS_WAY-1:0] ic_eccerr,
114 0 : input logic [pt.ICACHE_BANKS_WAY-1:0] ic_parerr,
115 1738678 : output logic [63:0] ic_premux_data, // Premux data to be muxed with each way of the Icache.
116 5605501 : output logic ic_sel_premux_data, // Select premux data
117 :
118 :
119 0 : output logic [pt.ICACHE_INDEX_HI:3] ic_debug_addr, // Read/Write addresss to the Icache.
120 0 : output logic ic_debug_rd_en, // Icache debug rd
121 0 : output logic ic_debug_wr_en, // Icache debug wr
122 0 : output logic ic_debug_tag_array, // Debug tag array
123 0 : output logic [pt.ICACHE_NUM_WAYS-1:0] ic_debug_way, // Debug way. Rd or Wr.
124 :
125 :
126 :
127 109586 : input logic [pt.ICACHE_NUM_WAYS-1:0] ic_rd_hit,
128 0 : input logic ic_tag_perr, // Icache Tag parity error
129 :
130 : //-------------------------- LSU AXI signals--------------------------
131 : // AXI Write Channels
132 863680 : output logic lsu_axi_awvalid,
133 669548 : input logic lsu_axi_awready,
134 0 : output logic [pt.LSU_BUS_TAG-1:0] lsu_axi_awid,
135 292 : output logic [31:0] lsu_axi_awaddr,
136 336 : output logic [3:0] lsu_axi_awregion,
137 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
138 : /*verilator coverage_off*/
139 : output logic [7:0] lsu_axi_awlen,
140 : /*verilator coverage_on*/
141 0 : output logic [2:0] lsu_axi_awsize,
142 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
143 : /*verilator coverage_off*/
144 : output logic [1:0] lsu_axi_awburst,
145 : output logic lsu_axi_awlock,
146 : /*verilator coverage_on*/
147 3029 : output logic [3:0] lsu_axi_awcache,
148 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
149 : /*verilator coverage_off*/
150 : output logic [2:0] lsu_axi_awprot,
151 : output logic [3:0] lsu_axi_awqos,
152 : /*verilator coverage_on*/
153 :
154 863680 : output logic lsu_axi_wvalid,
155 669548 : input logic lsu_axi_wready,
156 31437 : output logic [63:0] lsu_axi_wdata,
157 225031 : output logic [7:0] lsu_axi_wstrb,
158 339 : output logic lsu_axi_wlast,
159 :
160 669290 : input logic lsu_axi_bvalid,
161 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
162 : /*verilator coverage_off*/
163 : output logic lsu_axi_bready,
164 : /*verilator coverage_on*/
165 2 : input logic [1:0] lsu_axi_bresp,
166 0 : input logic [pt.LSU_BUS_TAG-1:0] lsu_axi_bid,
167 :
168 : // AXI Read Channels
169 868996 : output logic lsu_axi_arvalid,
170 673312 : input logic lsu_axi_arready,
171 0 : output logic [pt.LSU_BUS_TAG-1:0] lsu_axi_arid,
172 292 : output logic [31:0] lsu_axi_araddr,
173 336 : output logic [3:0] lsu_axi_arregion,
174 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
175 : /*verilator coverage_off*/
176 : output logic [7:0] lsu_axi_arlen,
177 : /*verilator coverage_on*/
178 0 : output logic [2:0] lsu_axi_arsize,
179 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
180 : /*verilator coverage_off*/
181 : output logic [1:0] lsu_axi_arburst,
182 : output logic lsu_axi_arlock,
183 : /*verilator coverage_on*/
184 3029 : output logic [3:0] lsu_axi_arcache,
185 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
186 : /*verilator coverage_off*/
187 : output logic [2:0] lsu_axi_arprot,
188 : output logic [3:0] lsu_axi_arqos,
189 : /*verilator coverage_on*/
190 :
191 672996 : input logic lsu_axi_rvalid,
192 : /* exclude signals that are tied to constant value in el2_lsu_bus_buffer.sv */
193 : /*verilator coverage_off*/
194 : output logic lsu_axi_rready,
195 : /*verilator coverage_on*/
196 0 : input logic [pt.LSU_BUS_TAG-1:0] lsu_axi_rid,
197 26505 : input logic [63:0] lsu_axi_rdata,
198 2 : input logic [1:0] lsu_axi_rresp,
199 673648 : input logic lsu_axi_rlast,
200 :
201 : //-------------------------- IFU AXI signals--------------------------
202 : // AXI Write Channels
203 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
204 : /*verilator coverage_off*/
205 : output logic ifu_axi_awvalid,
206 : /*verilator coverage_on*/
207 20 : input logic ifu_axi_awready,
208 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
209 : /*verilator coverage_off*/
210 : output logic [pt.IFU_BUS_TAG-1:0] ifu_axi_awid,
211 : output logic [31:0] ifu_axi_awaddr,
212 : output logic [3:0] ifu_axi_awregion,
213 : output logic [7:0] ifu_axi_awlen,
214 : output logic [2:0] ifu_axi_awsize,
215 : output logic [1:0] ifu_axi_awburst,
216 : output logic ifu_axi_awlock,
217 : output logic [3:0] ifu_axi_awcache,
218 : output logic [2:0] ifu_axi_awprot,
219 : output logic [3:0] ifu_axi_awqos,
220 :
221 : output logic ifu_axi_wvalid,
222 : /*verilator coverage_on*/
223 20 : input logic ifu_axi_wready,
224 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
225 : /*verilator coverage_off*/
226 : output logic [63:0] ifu_axi_wdata,
227 : output logic [7:0] ifu_axi_wstrb,
228 : output logic ifu_axi_wlast,
229 : /*verilator coverage_on*/
230 :
231 0 : input logic ifu_axi_bvalid,
232 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
233 : /*verilator coverage_off*/
234 : output logic ifu_axi_bready,
235 : /*verilator coverage_on*/
236 0 : input logic [1:0] ifu_axi_bresp,
237 0 : input logic [pt.IFU_BUS_TAG-1:0] ifu_axi_bid,
238 :
239 : // AXI Read Channels
240 5895001 : output logic ifu_axi_arvalid,
241 8917946 : input logic ifu_axi_arready,
242 3590060 : output logic [pt.IFU_BUS_TAG-1:0] ifu_axi_arid,
243 2455058 : output logic [31:0] ifu_axi_araddr,
244 545 : output logic [3:0] ifu_axi_arregion,
245 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
246 : /*verilator coverage_off*/
247 : output logic [7:0] ifu_axi_arlen,
248 : output logic [2:0] ifu_axi_arsize,
249 : output logic [1:0] ifu_axi_arburst,
250 : output logic ifu_axi_arlock,
251 : output logic [3:0] ifu_axi_arcache,
252 : output logic [2:0] ifu_axi_arprot,
253 : output logic [3:0] ifu_axi_arqos,
254 : /*verilator coverage_on*/
255 :
256 8917628 : input logic ifu_axi_rvalid,
257 : /* exclude signals that are tied to constant value in el2_ifu_mem_ctl.sv */
258 : /*verilator coverage_off*/
259 : output logic ifu_axi_rready,
260 : /*verilator coverage_on*/
261 897349 : input logic [pt.IFU_BUS_TAG-1:0] ifu_axi_rid,
262 744641 : input logic [63:0] ifu_axi_rdata,
263 20 : input logic [1:0] ifu_axi_rresp,
264 8917628 : input logic ifu_axi_rlast,
265 :
266 : //-------------------------- SB AXI signals--------------------------
267 : // AXI Write Channels
268 244 : output logic sb_axi_awvalid,
269 122 : input logic sb_axi_awready,
270 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
271 : /*verilator coverage_off*/
272 : output logic [pt.SB_BUS_TAG-1:0] sb_axi_awid,
273 : /*verilator coverage_on*/
274 4 : output logic [31:0] sb_axi_awaddr,
275 196 : output logic [3:0] sb_axi_awregion,
276 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
277 : /*verilator coverage_off*/
278 : output logic [7:0] sb_axi_awlen,
279 : /*verilator coverage_on*/
280 0 : output logic [2:0] sb_axi_awsize,
281 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
282 : /*verilator coverage_off*/
283 : output logic [1:0] sb_axi_awburst,
284 : output logic sb_axi_awlock,
285 : output logic [3:0] sb_axi_awcache,
286 : output logic [2:0] sb_axi_awprot,
287 : output logic [3:0] sb_axi_awqos,
288 : /*verilator coverage_on*/
289 :
290 244 : output logic sb_axi_wvalid,
291 122 : input logic sb_axi_wready,
292 62 : output logic [63:0] sb_axi_wdata,
293 536 : output logic [7:0] sb_axi_wstrb,
294 339 : output logic sb_axi_wlast,
295 :
296 122 : input logic sb_axi_bvalid,
297 339 : output logic sb_axi_bready,
298 0 : input logic [1:0] sb_axi_bresp,
299 0 : input logic [pt.SB_BUS_TAG-1:0] sb_axi_bid,
300 :
301 : // AXI Read Channels
302 1504 : output logic sb_axi_arvalid,
303 652 : input logic sb_axi_arready,
304 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
305 : /*verilator coverage_off*/
306 : output logic [pt.SB_BUS_TAG-1:0] sb_axi_arid,
307 : /*verilator coverage_on*/
308 4 : output logic [31:0] sb_axi_araddr,
309 196 : output logic [3:0] sb_axi_arregion,
310 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
311 : /*verilator coverage_off*/
312 : output logic [7:0] sb_axi_arlen,
313 : /*verilator coverage_on*/
314 0 : output logic [2:0] sb_axi_arsize,
315 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
316 : /*verilator coverage_off*/
317 : output logic [1:0] sb_axi_arburst,
318 : output logic sb_axi_arlock,
319 : output logic [3:0] sb_axi_arcache,
320 : output logic [2:0] sb_axi_arprot,
321 : output logic [3:0] sb_axi_arqos,
322 : /*verilator coverage_on*/
323 :
324 652 : input logic sb_axi_rvalid,
325 : /* exclude signals that are tied to constant value in dbg/el2_dbg.sv */
326 : /*verilator coverage_off*/
327 : output logic sb_axi_rready,
328 : /*verilator coverage_on*/
329 0 : input logic [pt.SB_BUS_TAG-1:0] sb_axi_rid,
330 5 : input logic [63:0] sb_axi_rdata,
331 0 : input logic [1:0] sb_axi_rresp,
332 652 : input logic sb_axi_rlast,
333 :
334 : //-------------------------- DMA AXI signals--------------------------
335 : // AXI Write Channels
336 66 : input logic dma_axi_awvalid,
337 339 : output logic dma_axi_awready,
338 0 : input logic [pt.DMA_BUS_TAG-1:0] dma_axi_awid,
339 282 : input logic [31:0] dma_axi_awaddr,
340 0 : input logic [2:0] dma_axi_awsize,
341 0 : input logic [2:0] dma_axi_awprot,
342 0 : input logic [7:0] dma_axi_awlen,
343 0 : input logic [1:0] dma_axi_awburst,
344 :
345 :
346 66 : input logic dma_axi_wvalid,
347 339 : output logic dma_axi_wready,
348 29795 : input logic [63:0] dma_axi_wdata,
349 185761 : input logic [7:0] dma_axi_wstrb,
350 318 : input logic dma_axi_wlast,
351 :
352 66 : output logic dma_axi_bvalid,
353 66 : input logic dma_axi_bready,
354 4 : output logic [1:0] dma_axi_bresp,
355 0 : output logic [pt.DMA_BUS_TAG-1:0] dma_axi_bid,
356 :
357 : // AXI Read Channels
358 0 : input logic dma_axi_arvalid,
359 339 : output logic dma_axi_arready,
360 0 : input logic [pt.DMA_BUS_TAG-1:0] dma_axi_arid,
361 282 : input logic [31:0] dma_axi_araddr,
362 0 : input logic [2:0] dma_axi_arsize,
363 0 : input logic [2:0] dma_axi_arprot,
364 0 : input logic [7:0] dma_axi_arlen,
365 0 : input logic [1:0] dma_axi_arburst,
366 :
367 0 : output logic dma_axi_rvalid,
368 0 : input logic dma_axi_rready,
369 0 : output logic [pt.DMA_BUS_TAG-1:0] dma_axi_rid,
370 12 : output logic [63:0] dma_axi_rdata,
371 4 : output logic [1:0] dma_axi_rresp,
372 339 : output logic dma_axi_rlast,
373 :
374 :
375 : //// AHB LITE BUS
376 17 : output logic [31:0] haddr,
377 : /* exclude signals that are tied to constant value in axi4_to_ahb.sv */
378 : /*verilator coverage_off*/
379 : output logic [2:0] hburst,
380 : output logic hmastlock,
381 : /*verilator coverage_on*/
382 0 : output logic [3:0] hprot,
383 0 : output logic [2:0] hsize,
384 1445965 : output logic [1:0] htrans,
385 0 : output logic hwrite,
386 :
387 240915 : input logic [63:0] hrdata,
388 20 : input logic hready,
389 0 : input logic hresp,
390 :
391 : // LSU AHB Master
392 10 : output logic [31:0] lsu_haddr,
393 : /* exclude signals that are tied to constant value in axi4_to_ahb.sv */
394 : /*verilator coverage_off*/
395 : output logic [2:0] lsu_hburst,
396 : output logic lsu_hmastlock,
397 : /*verilator coverage_on*/
398 0 : output logic [3:0] lsu_hprot,
399 0 : output logic [2:0] lsu_hsize,
400 445416 : output logic [1:0] lsu_htrans,
401 89186 : output logic lsu_hwrite,
402 5340 : output logic [63:0] lsu_hwdata,
403 :
404 2335 : input logic [63:0] lsu_hrdata,
405 20 : input logic lsu_hready,
406 0 : input logic lsu_hresp,
407 :
408 : //System Bus Debug Master
409 2 : output logic [31:0] sb_haddr,
410 : /* exclude signals that are tied to constant value in axi4_to_ahb.sv */
411 : /*verilator coverage_off*/
412 : output logic [2:0] sb_hburst,
413 : output logic sb_hmastlock,
414 : /*verilator coverage_on*/
415 0 : output logic [3:0] sb_hprot,
416 0 : output logic [2:0] sb_hsize,
417 974 : output logic [1:0] sb_htrans,
418 119 : output logic sb_hwrite,
419 35 : output logic [63:0] sb_hwdata,
420 :
421 8 : input logic [63:0] sb_hrdata,
422 2 : input logic sb_hready,
423 0 : input logic sb_hresp,
424 :
425 : // DMA Slave
426 20 : input logic dma_hsel,
427 0 : input logic [31:0] dma_haddr,
428 0 : input logic [2:0] dma_hburst,
429 0 : input logic dma_hmastlock,
430 0 : input logic [3:0] dma_hprot,
431 0 : input logic [2:0] dma_hsize,
432 0 : input logic [1:0] dma_htrans,
433 0 : input logic dma_hwrite,
434 0 : input logic [63:0] dma_hwdata,
435 20 : input logic dma_hreadyin,
436 :
437 0 : output logic [63:0] dma_hrdata,
438 20 : output logic dma_hreadyout,
439 0 : output logic dma_hresp,
440 :
441 338 : input logic lsu_bus_clk_en,
442 338 : input logic ifu_bus_clk_en,
443 338 : input logic dbg_bus_clk_en,
444 338 : input logic dma_bus_clk_en,
445 :
446 16322 : input logic dmi_reg_en, // read or write
447 0 : input logic [6:0] dmi_reg_addr, // address of DM register
448 6018 : input logic dmi_reg_wr_en, // write instruction
449 80 : input logic [31:0] dmi_reg_wdata, // write data
450 106 : output logic [31:0] dmi_reg_rdata,
451 :
452 : // ICCM/DCCM ECC status
453 8 : output logic iccm_ecc_single_error,
454 4 : output logic iccm_ecc_double_error,
455 4 : output logic dccm_ecc_single_error,
456 4 : output logic dccm_ecc_double_error,
457 :
458 0 : input logic [pt.PIC_TOTAL_INT:1] extintsrc_req,
459 18 : input logic timer_int,
460 19 : input logic soft_int,
461 0 : input logic scan_mode
462 : );
463 :
464 :
465 :
466 :
467 192575 : logic [63:0] hwdata_nc;
468 : //----------------------------------------------------------------------
469 : //
470 : //----------------------------------------------------------------------
471 :
472 6202913 : logic ifu_pmu_instr_aligned;
473 0 : logic ifu_ic_error_start;
474 0 : logic ifu_iccm_dma_rd_ecc_single_err;
475 8 : logic ifu_iccm_rd_ecc_single_err;
476 4 : logic ifu_iccm_rd_ecc_double_err;
477 4 : logic lsu_dccm_rd_ecc_single_err;
478 4 : logic lsu_dccm_rd_ecc_double_err;
479 :
480 446299 : logic lsu_axi_awready_ahb;
481 446299 : logic lsu_axi_wready_ahb;
482 207618 : logic lsu_axi_bvalid_ahb;
483 0 : logic lsu_axi_bready_ahb;
484 0 : logic [1:0] lsu_axi_bresp_ahb;
485 0 : logic [pt.LSU_BUS_TAG-1:0] lsu_axi_bid_ahb;
486 442237 : logic lsu_axi_arready_ahb;
487 256790 : logic lsu_axi_rvalid_ahb;
488 0 : logic [pt.LSU_BUS_TAG-1:0] lsu_axi_rid_ahb;
489 2335 : logic [63:0] lsu_axi_rdata_ahb;
490 0 : logic [1:0] lsu_axi_rresp_ahb;
491 20 : logic lsu_axi_rlast_ahb;
492 :
493 1115847 : logic lsu_axi_awready_int;
494 1115847 : logic lsu_axi_wready_int;
495 876908 : logic lsu_axi_bvalid_int;
496 319 : logic lsu_axi_bready_int;
497 2 : logic [1:0] lsu_axi_bresp_int;
498 0 : logic [pt.LSU_BUS_TAG-1:0] lsu_axi_bid_int;
499 1115549 : logic lsu_axi_arready_int;
500 929786 : logic lsu_axi_rvalid_int;
501 0 : logic [pt.LSU_BUS_TAG-1:0] lsu_axi_rid_int;
502 28840 : logic [63:0] lsu_axi_rdata_int;
503 2 : logic [1:0] lsu_axi_rresp_int;
504 673668 : logic lsu_axi_rlast_int;
505 :
506 1445978 : logic ifu_axi_awready_ahb;
507 1445978 : logic ifu_axi_wready_ahb;
508 0 : logic ifu_axi_bvalid_ahb;
509 0 : logic ifu_axi_bready_ahb;
510 0 : logic [1:0] ifu_axi_bresp_ahb;
511 285270 : logic [pt.IFU_BUS_TAG-1:0] ifu_axi_bid_ahb;
512 1445978 : logic ifu_axi_arready_ahb;
513 2891920 : logic ifu_axi_rvalid_ahb;
514 285270 : logic [pt.IFU_BUS_TAG-1:0] ifu_axi_rid_ahb;
515 240914 : logic [63:0] ifu_axi_rdata_ahb;
516 0 : logic [1:0] ifu_axi_rresp_ahb;
517 20 : logic ifu_axi_rlast_ahb;
518 :
519 1445978 : logic ifu_axi_awready_int;
520 1445978 : logic ifu_axi_wready_int;
521 0 : logic ifu_axi_bvalid_int;
522 0 : logic ifu_axi_bready_int;
523 0 : logic [1:0] ifu_axi_bresp_int;
524 285270 : logic [pt.IFU_BUS_TAG-1:0] ifu_axi_bid_int;
525 10363924 : logic ifu_axi_arready_int;
526 11809548 : logic ifu_axi_rvalid_int;
527 1182619 : logic [pt.IFU_BUS_TAG-1:0] ifu_axi_rid_int;
528 985555 : logic [63:0] ifu_axi_rdata_int;
529 20 : logic [1:0] ifu_axi_rresp_int;
530 8917648 : logic ifu_axi_rlast_int;
531 :
532 994 : logic sb_axi_awready_ahb;
533 994 : logic sb_axi_wready_ahb;
534 122 : logic sb_axi_bvalid_ahb;
535 0 : logic sb_axi_bready_ahb;
536 0 : logic [1:0] sb_axi_bresp_ahb;
537 0 : logic [pt.SB_BUS_TAG-1:0] sb_axi_bid_ahb;
538 994 : logic sb_axi_arready_ahb;
539 852 : logic sb_axi_rvalid_ahb;
540 0 : logic [pt.SB_BUS_TAG-1:0] sb_axi_rid_ahb;
541 8 : logic [63:0] sb_axi_rdata_ahb;
542 0 : logic [1:0] sb_axi_rresp_ahb;
543 20 : logic sb_axi_rlast_ahb;
544 :
545 1116 : logic sb_axi_awready_int;
546 1116 : logic sb_axi_wready_int;
547 244 : logic sb_axi_bvalid_int;
548 319 : logic sb_axi_bready_int;
549 0 : logic [1:0] sb_axi_bresp_int;
550 0 : logic [pt.SB_BUS_TAG-1:0] sb_axi_bid_int;
551 1646 : logic sb_axi_arready_int;
552 1504 : logic sb_axi_rvalid_int;
553 0 : logic [pt.SB_BUS_TAG-1:0] sb_axi_rid_int;
554 13 : logic [63:0] sb_axi_rdata_int;
555 0 : logic [1:0] sb_axi_rresp_int;
556 672 : logic sb_axi_rlast_int;
557 :
558 0 : logic dma_axi_awvalid_ahb;
559 : /* exclude signals that are tied to constant value in ahb_to_axi4.sv */
560 : /*verilator coverage_off*/
561 : logic [pt.DMA_BUS_TAG-1:0] dma_axi_awid_ahb;
562 : /*verilator coverage_on*/
563 0 : logic [31:0] dma_axi_awaddr_ahb;
564 0 : logic [2:0] dma_axi_awsize_ahb;
565 : /* exclude signals that are tied to constant value in ahb_to_axi4.sv */
566 : /*verilator coverage_off*/
567 : logic [2:0] dma_axi_awprot_ahb;
568 : logic [7:0] dma_axi_awlen_ahb;
569 : logic [1:0] dma_axi_awburst_ahb;
570 : /*verilator coverage_on*/
571 0 : logic dma_axi_wvalid_ahb;
572 0 : logic [63:0] dma_axi_wdata_ahb;
573 0 : logic [7:0] dma_axi_wstrb_ahb;
574 : /* exclude signals that are tied to constant value in ahb_to_axi4.sv */
575 : /*verilator coverage_off*/
576 : logic dma_axi_wlast_ahb;
577 : logic dma_axi_bready_ahb;
578 : /*verilator coverage_on*/
579 0 : logic dma_axi_arvalid_ahb;
580 : /* exclude signals that are tied to constant value in ahb_to_axi4.sv */
581 : /*verilator coverage_off*/
582 : logic [pt.DMA_BUS_TAG-1:0] dma_axi_arid_ahb;
583 : /*verilator coverage_on*/
584 0 : logic [31:0] dma_axi_araddr_ahb;
585 0 : logic [2:0] dma_axi_arsize_ahb;
586 : /* exclude signals that are tied to constant value in ahb_to_axi4.sv */
587 : /*verilator coverage_off*/
588 : logic [2:0] dma_axi_arprot_ahb;
589 : logic [7:0] dma_axi_arlen_ahb;
590 : logic [1:0] dma_axi_arburst_ahb;
591 : logic dma_axi_rready_ahb;
592 : /*verilator coverage_on*/
593 :
594 66 : logic dma_axi_awvalid_int;
595 0 : logic [pt.DMA_BUS_TAG-1:0] dma_axi_awid_int;
596 282 : logic [31:0] dma_axi_awaddr_int;
597 0 : logic [2:0] dma_axi_awsize_int;
598 0 : logic [2:0] dma_axi_awprot_int;
599 0 : logic [7:0] dma_axi_awlen_int;
600 0 : logic [1:0] dma_axi_awburst_int;
601 66 : logic dma_axi_wvalid_int;
602 29795 : logic [63:0] dma_axi_wdata_int;
603 185761 : logic [7:0] dma_axi_wstrb_int;
604 338 : logic dma_axi_wlast_int;
605 86 : logic dma_axi_bready_int;
606 0 : logic dma_axi_arvalid_int;
607 0 : logic [pt.DMA_BUS_TAG-1:0] dma_axi_arid_int;
608 282 : logic [31:0] dma_axi_araddr_int;
609 0 : logic [2:0] dma_axi_arsize_int;
610 0 : logic [2:0] dma_axi_arprot_int;
611 0 : logic [7:0] dma_axi_arlen_int;
612 0 : logic [1:0] dma_axi_arburst_int;
613 20 : logic dma_axi_rready_int;
614 :
615 :
616 : // Icache debug
617 0 : logic [70:0] ifu_ic_debug_rd_data; // diagnostic icache read data
618 0 : logic ifu_ic_debug_rd_data_valid; // diagnostic icache read data valid
619 0 : el2_cache_debug_pkt_t dec_tlu_ic_diag_pkt; // packet of DICAWICS, DICAD0/1, DICAGO info for icache diagnostics
620 :
621 :
622 5141266 : logic dec_i0_rs1_en_d;
623 3573314 : logic dec_i0_rs2_en_d;
624 407930 : logic [31:0] gpr_i0_rs1_d;
625 598734 : logic [31:0] gpr_i0_rs2_d;
626 :
627 314097 : logic [31:0] dec_i0_result_r;
628 614729 : logic [31:0] exu_i0_result_x;
629 340 : logic [31:1] exu_i0_pc_x;
630 345 : logic [31:1] exu_npc_r;
631 :
632 1460 : el2_alu_pkt_t i0_ap;
633 :
634 : // Trigger signals
635 0 : el2_trigger_pkt_t [3:0] trigger_pkt_any;
636 0 : logic [3:0] lsu_trigger_match_m;
637 :
638 :
639 2170163 : logic [31:0] dec_i0_immed_d;
640 123658 : logic [12:1] dec_i0_br_immed_d;
641 555739 : logic dec_i0_select_pc_d;
642 :
643 1322 : logic [31:1] dec_i0_pc_d;
644 80590 : logic [3:0] dec_i0_rs1_bypass_en_d;
645 8620 : logic [3:0] dec_i0_rs2_bypass_en_d;
646 :
647 5413935 : logic dec_i0_alu_decode_d;
648 3885652 : logic dec_i0_branch_d;
649 :
650 5894212 : logic ifu_miss_state_idle;
651 232 : logic dec_tlu_flush_noredir_r;
652 2 : logic dec_tlu_flush_leak_one_r;
653 8 : logic dec_tlu_flush_err_r;
654 6017619 : logic ifu_i0_valid;
655 468824 : logic [31:0] ifu_i0_instr;
656 1322 : logic [31:1] ifu_i0_pc;
657 :
658 674192 : logic exu_flush_final;
659 :
660 227634 : logic [31:1] exu_flush_path_final;
661 :
662 413433 : logic [31:0] exu_lsu_rs1_d;
663 81510 : logic [31:0] exu_lsu_rs2_d;
664 :
665 :
666 624113 : el2_lsu_pkt_t lsu_p;
667 5496332 : logic dec_qual_lsu_d;
668 :
669 2284800 : logic dec_lsu_valid_raw_d;
670 270506 : logic [11:0] dec_lsu_offset_d;
671 :
672 45891 : logic [31:0] lsu_result_m;
673 36629 : logic [31:0] lsu_result_corr_r; // This is the ECC corrected data going to RF
674 4 : logic lsu_single_ecc_error_incr; // Increment the ecc counter
675 4 : el2_lsu_error_pkt_t lsu_error_pkt_r;
676 2 : logic lsu_imprecise_error_load_any;
677 2 : logic lsu_imprecise_error_store_any;
678 292 : logic [31:0] lsu_imprecise_error_addr_any;
679 48822 : logic lsu_load_stall_any; // This is for blocking loads
680 59146 : logic lsu_store_stall_any; // This is for blocking stores
681 1347305 : logic lsu_idle_any; // doesn't include DMA
682 1346966 : logic lsu_active; // lsu is active. used for clock
683 :
684 :
685 24696 : logic [31:1] lsu_fir_addr; // fast interrupt address
686 0 : logic [1:0] lsu_fir_error; // Error during fast interrupt lookup
687 :
688 : // Non-blocking loads
689 881678 : logic lsu_nonblock_load_valid_m;
690 505169 : logic [pt.LSU_NUM_NBLOAD_WIDTH-1:0] lsu_nonblock_load_tag_m;
691 0 : logic lsu_nonblock_load_inv_r;
692 505166 : logic [pt.LSU_NUM_NBLOAD_WIDTH-1:0] lsu_nonblock_load_inv_tag_r;
693 920958 : logic lsu_nonblock_load_data_valid;
694 36608 : logic [pt.LSU_NUM_NBLOAD_WIDTH-1:0] lsu_nonblock_load_data_tag;
695 71610 : logic [31:0] lsu_nonblock_load_data;
696 :
697 77246 : logic dec_csr_ren_d;
698 9492 : logic [31:0] dec_csr_rddata_d;
699 :
700 3978 : logic [31:0] exu_csr_rs1_x;
701 :
702 6172688 : logic dec_tlu_i0_commit_cmt;
703 59242 : logic dec_tlu_flush_lower_r;
704 59242 : logic dec_tlu_flush_lower_wb;
705 29690 : logic dec_tlu_i0_kill_writeb_r; // I0 is flushed, don't writeback any results to arch state
706 18868 : logic dec_tlu_fence_i_r; // flush is a fence_i rfnpc, flush icache
707 :
708 24770 : logic [31:1] dec_tlu_flush_path_r;
709 0 : logic [31:0] dec_tlu_mrac_ff; // CSR for memory region control
710 :
711 5773422 : logic ifu_i0_pc4;
712 :
713 0 : el2_mul_pkt_t mul_p;
714 :
715 78134 : el2_div_pkt_t div_p;
716 2628 : logic dec_div_cancel;
717 :
718 24784 : logic [31:0] exu_div_result;
719 156860 : logic exu_div_wren;
720 :
721 6202913 : logic dec_i0_decode_d;
722 :
723 :
724 139003 : logic [31:1] pred_correct_npc_x;
725 :
726 782421 : el2_br_tlu_pkt_t dec_tlu_br0_r_pkt;
727 :
728 34484 : el2_predict_pkt_t exu_mp_pkt;
729 300180 : logic [pt.BHT_GHR_SIZE-1:0] exu_mp_eghr;
730 379114 : logic [pt.BHT_GHR_SIZE-1:0] exu_mp_fghr;
731 196224 : logic [pt.BTB_ADDR_HI:pt.BTB_ADDR_LO] exu_mp_index;
732 115620 : logic [pt.BTB_BTAG_SIZE-1:0] exu_mp_btag;
733 :
734 367236 : logic [pt.BHT_GHR_SIZE-1:0] exu_i0_br_fghr_r;
735 2722426 : logic [1:0] exu_i0_br_hist_r;
736 26468 : logic exu_i0_br_error_r;
737 9608 : logic exu_i0_br_start_error_r;
738 3014030 : logic exu_i0_br_valid_r;
739 410710 : logic exu_i0_br_mp_r;
740 2382213 : logic exu_i0_br_middle_r;
741 :
742 2111118 : logic exu_i0_br_way_r;
743 :
744 187591 : logic [pt.BTB_ADDR_HI:pt.BTB_ADDR_LO] exu_i0_br_index_r;
745 :
746 0 : logic dma_dccm_req;
747 66 : logic dma_iccm_req;
748 12 : logic [2:0] dma_mem_tag;
749 0 : logic [31:0] dma_mem_addr;
750 0 : logic [2:0] dma_mem_sz;
751 22 : logic dma_mem_write;
752 12 : logic [63:0] dma_mem_wdata;
753 :
754 0 : logic dccm_dma_rvalid;
755 4 : logic dccm_dma_ecc_error;
756 12 : logic [2:0] dccm_dma_rtag;
757 39564 : logic [63:0] dccm_dma_rdata;
758 0 : logic iccm_dma_rvalid;
759 4 : logic iccm_dma_ecc_error;
760 12 : logic [2:0] iccm_dma_rtag;
761 0 : logic [63:0] iccm_dma_rdata;
762 :
763 0 : logic dma_dccm_stall_any; // Stall the ld/st in decode if asserted
764 26 : logic dma_iccm_stall_any; // Stall the fetch
765 2234025 : logic dccm_ready;
766 638324 : logic iccm_ready;
767 :
768 0 : logic dma_pmu_dccm_read;
769 0 : logic dma_pmu_dccm_write;
770 0 : logic dma_pmu_any_read;
771 66 : logic dma_pmu_any_write;
772 :
773 208 : logic ifu_i0_icaf;
774 274 : logic [1:0] ifu_i0_icaf_type;
775 :
776 :
777 86 : logic ifu_i0_icaf_second;
778 2 : logic ifu_i0_dbecc;
779 0 : logic iccm_dma_sb_error;
780 :
781 206676 : el2_br_pkt_t i0_brp;
782 651206 : logic [pt.BTB_ADDR_HI:pt.BTB_ADDR_LO] ifu_i0_bp_index;
783 631053 : logic [pt.BHT_GHR_SIZE-1:0] ifu_i0_bp_fghr;
784 21223 : logic [pt.BTB_BTAG_SIZE-1:0] ifu_i0_bp_btag;
785 :
786 0 : logic [$clog2(pt.BTB_SIZE)-1:0] ifu_i0_fa_index;
787 0 : logic [$clog2(pt.BTB_SIZE)-1:0] dec_fa_error_index; // Fully associative btb error index
788 :
789 :
790 506497 : el2_predict_pkt_t dec_i0_predict_p_d;
791 :
792 631053 : logic [pt.BHT_GHR_SIZE-1:0] i0_predict_fghr_d; // DEC predict fghr
793 651206 : logic [pt.BTB_ADDR_HI:pt.BTB_ADDR_LO] i0_predict_index_d; // DEC predict index
794 21223 : logic [pt.BTB_BTAG_SIZE-1:0] i0_predict_btag_d; // DEC predict branch tag
795 :
796 : // PIC ports
797 8 : logic picm_wren;
798 2 : logic picm_rden;
799 10 : logic picm_mken;
800 316 : logic [31:0] picm_rdaddr;
801 316 : logic [31:0] picm_wraddr;
802 92728 : logic [31:0] picm_wr_data;
803 0 : logic [31:0] picm_rd_data;
804 :
805 : // feature disable from mfdc
806 0 : logic dec_tlu_external_ldfwd_disable; // disable external load forwarding
807 0 : logic dec_tlu_bpred_disable;
808 6 : logic dec_tlu_wb_coalescing_disable;
809 322 : logic dec_tlu_sideeffect_posted_disable;
810 345 : logic [2:0] dec_tlu_dma_qos_prty; // DMA QoS priority coming from MFDC [18:16]
811 :
812 : // clock gating overrides from mcgc
813 2 : logic dec_tlu_misc_clk_override;
814 2 : logic dec_tlu_ifu_clk_override;
815 2 : logic dec_tlu_lsu_clk_override;
816 2 : logic dec_tlu_bus_clk_override;
817 2 : logic dec_tlu_pic_clk_override;
818 2 : logic dec_tlu_dccm_clk_override;
819 2 : logic dec_tlu_icm_clk_override;
820 :
821 341 : logic dec_tlu_picio_clk_override;
822 :
823 : assign dccm_clk_override = dec_tlu_dccm_clk_override; // dccm memory
824 : assign icm_clk_override = dec_tlu_icm_clk_override; // icache/iccm memory
825 :
826 : // PMP Signals
827 0 : el2_pmp_cfg_pkt_t pmp_pmpcfg [pt.PMP_ENTRIES];
828 : logic [31:0] pmp_pmpaddr [pt.PMP_ENTRIES];
829 593687 : logic [31:0] pmp_chan_addr [3];
830 0 : el2_pmp_type_pkt_t pmp_chan_type [3];
831 137210 : logic pmp_chan_err [3];
832 :
833 444 : logic [31:1] ifu_pmp_addr;
834 110 : logic ifu_pmp_error;
835 593665 : logic [31:0] lsu_pmp_addr_start;
836 167064 : logic lsu_pmp_error_start;
837 593691 : logic [31:0] lsu_pmp_addr_end;
838 167064 : logic lsu_pmp_error_end;
839 1073866 : logic lsu_pmp_we;
840 1424380 : logic lsu_pmp_re;
841 :
842 : // -----------------------DEBUG START -------------------------------
843 :
844 6 : logic [31:0] dbg_cmd_addr; // the address of the debug command to used by the core
845 122 : logic [31:0] dbg_cmd_wrdata; // If the debug command is a write command, this has the data to be written to the CSR/GPR
846 2382 : logic dbg_cmd_valid; // commad is being driven by the dbg module. One pulse. Only dirven when core_halted has been seen
847 272 : logic dbg_cmd_write; // 1: write command; 0: read_command
848 1456 : logic [1:0] dbg_cmd_type; // 0:gpr 1:csr 2: memory
849 1162 : logic [1:0] dbg_cmd_size; // size of the abstract mem access debug command
850 8 : logic dbg_halt_req; // Sticky signal indicating that the debug module wants to start the entering of debug mode ( start the halting sequence )
851 10 : logic dbg_resume_req; // Sticky signal indicating that the debug module wants to resume from debug mode
852 339 : logic dbg_core_rst_l; // Core reset from DM
853 :
854 2382 : logic core_dbg_cmd_done; // Final muxed cmd done to debug
855 4 : logic core_dbg_cmd_fail; // Final muxed cmd done to debug
856 314097 : logic [31:0] core_dbg_rddata; // Final muxed cmd done to debug
857 :
858 4 : logic dma_dbg_cmd_done; // Abstarct memory command sent to dma is done
859 4 : logic dma_dbg_cmd_fail; // Abstarct memory command sent to dma failed
860 0 : logic [31:0] dma_dbg_rddata; // Read data for abstract memory access
861 :
862 2382 : logic dbg_dma_bubble; // Debug needs a bubble to send a valid
863 2382 : logic dma_dbg_ready; // DMA is ready to accept debug request
864 :
865 314097 : logic [31:0] dec_dbg_rddata; // The core drives this data ( intercepts the pipe and sends it here )
866 2378 : logic dec_dbg_cmd_done; // This will be treated like a valid signal
867 0 : logic dec_dbg_cmd_fail; // Abstract command failed
868 108 : logic dec_tlu_mpc_halted_only; // Only halted due to MPC
869 120 : logic dec_tlu_dbg_halted; // The core has finished the queiscing sequence. Sticks this signal high
870 10 : logic dec_tlu_resume_ack;
871 118 : logic dec_tlu_debug_mode; // Core is in debug mode
872 58 : logic dec_debug_wdata_rs1_d;
873 0 : logic dec_tlu_force_halt; // halt has been forced
874 :
875 6202296 : logic [1:0] dec_data_en;
876 5996566 : logic [1:0] dec_ctl_en;
877 :
878 : // PMU Signals
879 410710 : logic exu_pmu_i0_br_misp;
880 2911858 : logic exu_pmu_i0_br_ataken;
881 3495916 : logic exu_pmu_i0_pc4;
882 :
883 891818 : logic lsu_pmu_load_external_m;
884 814508 : logic lsu_pmu_store_external_m;
885 48802 : logic lsu_pmu_misaligned_m;
886 1675628 : logic lsu_pmu_bus_trxn;
887 36422 : logic lsu_pmu_bus_misaligned;
888 4 : logic lsu_pmu_bus_error;
889 67776 : logic lsu_pmu_bus_busy;
890 :
891 615066 : logic ifu_pmu_fetch_stall;
892 5895206 : logic ifu_pmu_ic_miss;
893 745274 : logic ifu_pmu_ic_hit;
894 10 : logic ifu_pmu_bus_error;
895 4468407 : logic ifu_pmu_bus_busy;
896 10363593 : logic ifu_pmu_bus_trxn;
897 :
898 449 : logic active_state;
899 69887189 : logic free_clk;
900 69887189 : logic active_clk;
901 2 : logic dec_pause_state_cg;
902 :
903 2 : logic lsu_nonblock_load_data_error;
904 :
905 1428514 : logic [15:0] ifu_i0_cinst;
906 :
907 : // fast interrupt
908 0 : logic [31:2] dec_tlu_meihap;
909 0 : logic dec_extint_stall;
910 :
911 5525760 : el2_trace_pkt_t trace_rv_trace_pkt;
912 :
913 :
914 4 : logic lsu_fastint_stall_any;
915 :
916 0 : logic [7:0] pic_claimid;
917 0 : logic [3:0] pic_pl, dec_tlu_meicurpl, dec_tlu_meipt;
918 0 : logic mexintpend;
919 0 : logic mhwakeup;
920 :
921 70 : logic dma_active;
922 :
923 :
924 2 : logic pause_state;
925 108 : logic halt_state;
926 :
927 2092048 : logic dec_tlu_core_empty;
928 :
929 : assign pause_state = dec_pause_state_cg & ~(dma_active | lsu_active) & dec_tlu_core_empty;
930 :
931 : assign halt_state = o_cpu_halt_status & ~(dma_active | lsu_active);
932 :
933 :
934 : assign active_state = (~(halt_state | pause_state) | dec_tlu_flush_lower_r | dec_tlu_flush_lower_wb) | dec_tlu_misc_clk_override;
935 :
936 : rvoclkhdr free_cg2 ( .clk(clk), .en(1'b1), .l1clk(free_l2clk), .* );
937 : rvoclkhdr active_cg2 ( .clk(clk), .en(active_state), .l1clk(active_l2clk), .* );
938 :
939 : // all other clock headers are 1st level
940 : rvoclkhdr free_cg1 ( .clk(free_l2clk), .en(1'b1), .l1clk(free_clk), .* );
941 : rvoclkhdr active_cg1 ( .clk(active_l2clk), .en(1'b1), .l1clk(active_clk), .* );
942 :
943 :
944 : assign core_dbg_cmd_done = dma_dbg_cmd_done | dec_dbg_cmd_done;
945 : assign core_dbg_cmd_fail = dma_dbg_cmd_fail | dec_dbg_cmd_fail;
946 : assign core_dbg_rddata[31:0] = dma_dbg_cmd_done ? dma_dbg_rddata[31:0] : dec_dbg_rddata[31:0];
947 :
948 : el2_dbg #(.pt(pt)) dbg (
949 : .rst_l(core_rst_l),
950 : .clk(free_l2clk),
951 : .clk_override(dec_tlu_misc_clk_override),
952 :
953 : // AXI signals
954 : .sb_axi_awready(sb_axi_awready_int),
955 : .sb_axi_wready(sb_axi_wready_int),
956 : .sb_axi_bvalid(sb_axi_bvalid_int),
957 : .sb_axi_bresp(sb_axi_bresp_int[1:0]),
958 :
959 : .sb_axi_arready(sb_axi_arready_int),
960 : .sb_axi_rvalid(sb_axi_rvalid_int),
961 : .sb_axi_rdata(sb_axi_rdata_int[63:0]),
962 : .sb_axi_rresp(sb_axi_rresp_int[1:0]),
963 : .*
964 : );
965 :
966 : `ifdef RV_ASSERT_ON
967 : assert_fetch_indbghalt: assert #0 (~(ifu.ifc_fetch_req_f & dec.tlu.dbg_tlu_halted_f & ~dec.tlu.dcsr_single_step_running)) else $display("ERROR: Fetching in dBG halt!");
968 : `endif
969 :
970 : // ----------------- DEBUG END -----------------------------
971 :
972 : assign core_rst_l = rst_l & (dbg_core_rst_l | scan_mode);
973 :
974 : `ifdef RV_USER_MODE
975 :
976 : // Operating privilege mode, 0 - machine, 1 - user
977 864 : logic priv_mode;
978 : // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv)
979 960 : logic priv_mode_eff;
980 : // Next privilege mode
981 864 : logic priv_mode_ns;
982 :
983 2 : el2_mseccfg_pkt_t mseccfg; // mseccfg CSR for PMP
984 :
985 : `endif
986 :
987 : // fetch
988 : el2_ifu #(.pt(pt)) ifu (
989 : .clk(active_l2clk),
990 : .rst_l(core_rst_l),
991 : .dec_tlu_flush_err_wb (dec_tlu_flush_err_r ),
992 : .dec_tlu_flush_noredir_wb (dec_tlu_flush_noredir_r ),
993 : .dec_tlu_fence_i_wb (dec_tlu_fence_i_r ),
994 : .dec_tlu_flush_leak_one_wb (dec_tlu_flush_leak_one_r ),
995 : .dec_tlu_flush_lower_wb (dec_tlu_flush_lower_r ),
996 :
997 : // AXI signals
998 : .ifu_axi_arready(ifu_axi_arready_int),
999 : .ifu_axi_rvalid(ifu_axi_rvalid_int),
1000 : .ifu_axi_rid(ifu_axi_rid_int[pt.IFU_BUS_TAG-1:0]),
1001 : .ifu_axi_rdata(ifu_axi_rdata_int[63:0]),
1002 : .ifu_axi_rresp(ifu_axi_rresp_int[1:0]),
1003 :
1004 : .*
1005 : );
1006 :
1007 :
1008 : assign iccm_ecc_single_error = ifu_iccm_rd_ecc_single_err || ifu_iccm_dma_rd_ecc_single_err;
1009 : assign iccm_ecc_double_error = ifu_iccm_rd_ecc_double_err;
1010 :
1011 : el2_dec #(.pt(pt)) dec (
1012 : .clk(active_l2clk),
1013 : .dbg_cmd_wrdata(dbg_cmd_wrdata[1:0]),
1014 : .rst_l(core_rst_l),
1015 : .*
1016 : );
1017 :
1018 : el2_exu #(.pt(pt)) exu (
1019 : .clk(active_l2clk),
1020 : .rst_l(core_rst_l),
1021 : .*
1022 : );
1023 :
1024 : el2_lsu #(.pt(pt)) lsu (
1025 : .clk(active_l2clk),
1026 : .rst_l(core_rst_l),
1027 : .clk_override(dec_tlu_lsu_clk_override),
1028 : .dec_tlu_i0_kill_writeb_r(dec_tlu_i0_kill_writeb_r),
1029 :
1030 : // AXI signals
1031 : .lsu_axi_awready(lsu_axi_awready_int),
1032 : .lsu_axi_wready(lsu_axi_wready_int),
1033 : .lsu_axi_bvalid(lsu_axi_bvalid_int),
1034 : .lsu_axi_bid(lsu_axi_bid_int[pt.LSU_BUS_TAG-1:0]),
1035 : .lsu_axi_bresp(lsu_axi_bresp_int[1:0]),
1036 :
1037 : .lsu_axi_arready(lsu_axi_arready_int),
1038 : .lsu_axi_rvalid(lsu_axi_rvalid_int),
1039 : .lsu_axi_rid(lsu_axi_rid_int[pt.LSU_BUS_TAG-1:0]),
1040 : .lsu_axi_rdata(lsu_axi_rdata_int[63:0]),
1041 : .lsu_axi_rresp(lsu_axi_rresp_int[1:0]),
1042 : .lsu_axi_rlast(lsu_axi_rlast_int),
1043 :
1044 : .*
1045 :
1046 : );
1047 :
1048 : assign dccm_ecc_single_error = lsu_dccm_rd_ecc_single_err;
1049 : assign dccm_ecc_double_error = lsu_dccm_rd_ecc_double_err;
1050 :
1051 : el2_pic_ctrl #(.pt(pt)) pic_ctrl_inst (
1052 : .clk(free_l2clk),
1053 : .clk_override(dec_tlu_pic_clk_override),
1054 : .io_clk_override(dec_tlu_picio_clk_override),
1055 : .picm_mken (picm_mken),
1056 : .extintsrc_req({extintsrc_req[pt.PIC_TOTAL_INT:1],1'b0}),
1057 : .pl(pic_pl[3:0]),
1058 : .claimid(pic_claimid[7:0]),
1059 : .meicurpl(dec_tlu_meicurpl[3:0]),
1060 : .meipt(dec_tlu_meipt[3:0]),
1061 : .rst_l(core_rst_l),
1062 : .*);
1063 :
1064 : el2_dma_ctrl #(.pt(pt)) dma_ctrl (
1065 : .clk(free_l2clk),
1066 : .rst_l(core_rst_l),
1067 : .clk_override(dec_tlu_misc_clk_override),
1068 :
1069 : // AXI signals
1070 : .dma_axi_awvalid(dma_axi_awvalid_int),
1071 : .dma_axi_awid(dma_axi_awid_int[pt.DMA_BUS_TAG-1:0]),
1072 : .dma_axi_awaddr(dma_axi_awaddr_int[31:0]),
1073 : .dma_axi_awsize(dma_axi_awsize_int[2:0]),
1074 : .dma_axi_wvalid(dma_axi_wvalid_int),
1075 : .dma_axi_wdata(dma_axi_wdata_int[63:0]),
1076 : .dma_axi_wstrb(dma_axi_wstrb_int[7:0]),
1077 : .dma_axi_bready(dma_axi_bready_int),
1078 :
1079 : .dma_axi_arvalid(dma_axi_arvalid_int),
1080 : .dma_axi_arid(dma_axi_arid_int[pt.DMA_BUS_TAG-1:0]),
1081 : .dma_axi_araddr(dma_axi_araddr_int[31:0]),
1082 : .dma_axi_arsize(dma_axi_arsize_int[2:0]),
1083 : .dma_axi_rready(dma_axi_rready_int),
1084 :
1085 : .*
1086 : );
1087 :
1088 : assign pmp_chan_addr[0] = {ifu_pmp_addr, 1'b0};
1089 : assign pmp_chan_type[0] = EXEC;
1090 : assign ifu_pmp_error = pmp_chan_err[0];
1091 : assign pmp_chan_addr[1] = lsu_pmp_addr_start;
1092 : assign pmp_chan_type[1] = lsu_pmp_we ? WRITE : (lsu_pmp_re ? READ : NONE);
1093 : assign lsu_pmp_error_start = pmp_chan_err[1];
1094 : assign pmp_chan_addr[2] = lsu_pmp_addr_end;
1095 : assign pmp_chan_type[2] = lsu_pmp_we ? WRITE : (lsu_pmp_re ? READ : NONE);
1096 : assign lsu_pmp_error_end = pmp_chan_err[2];
1097 :
1098 : el2_pmp #(
1099 : .PMP_CHANNELS(3),
1100 : .pt(pt)
1101 : ) pmp (
1102 : .clk (active_l2clk),
1103 : .rst_l(core_rst_l),
1104 : .*
1105 : );
1106 :
1107 : if (pt.BUILD_AHB_LITE == 1) begin: Gen_AXI_To_AHB
1108 :
1109 : // AXI4 -> AHB Gasket for LSU
1110 : axi4_to_ahb #(.pt(pt),
1111 : .TAG(pt.LSU_BUS_TAG)) lsu_axi4_to_ahb (
1112 :
1113 : .clk(free_l2clk),
1114 : .free_clk(free_clk),
1115 : .rst_l(core_rst_l),
1116 : .clk_override(dec_tlu_bus_clk_override),
1117 : .bus_clk_en(lsu_bus_clk_en),
1118 : .dec_tlu_force_halt(dec_tlu_force_halt),
1119 :
1120 : // AXI Write Channels
1121 : .axi_awvalid(lsu_axi_awvalid),
1122 : .axi_awready(lsu_axi_awready_ahb),
1123 : .axi_awid(lsu_axi_awid[pt.LSU_BUS_TAG-1:0]),
1124 : .axi_awaddr(lsu_axi_awaddr[31:0]),
1125 : .axi_awsize(lsu_axi_awsize[2:0]),
1126 : .axi_awprot(lsu_axi_awprot[2:0]),
1127 :
1128 : .axi_wvalid(lsu_axi_wvalid),
1129 : .axi_wready(lsu_axi_wready_ahb),
1130 : .axi_wdata(lsu_axi_wdata[63:0]),
1131 : .axi_wstrb(lsu_axi_wstrb[7:0]),
1132 : .axi_wlast(lsu_axi_wlast),
1133 :
1134 : .axi_bvalid(lsu_axi_bvalid_ahb),
1135 : .axi_bready(lsu_axi_bready),
1136 : .axi_bresp(lsu_axi_bresp_ahb[1:0]),
1137 : .axi_bid(lsu_axi_bid_ahb[pt.LSU_BUS_TAG-1:0]),
1138 :
1139 : // AXI Read Channels
1140 : .axi_arvalid(lsu_axi_arvalid),
1141 : .axi_arready(lsu_axi_arready_ahb),
1142 : .axi_arid(lsu_axi_arid[pt.LSU_BUS_TAG-1:0]),
1143 : .axi_araddr(lsu_axi_araddr[31:0]),
1144 : .axi_arsize(lsu_axi_arsize[2:0]),
1145 : .axi_arprot(lsu_axi_arprot[2:0]),
1146 :
1147 : .axi_rvalid(lsu_axi_rvalid_ahb),
1148 : .axi_rready(lsu_axi_rready),
1149 : .axi_rid(lsu_axi_rid_ahb[pt.LSU_BUS_TAG-1:0]),
1150 : .axi_rdata(lsu_axi_rdata_ahb[63:0]),
1151 : .axi_rresp(lsu_axi_rresp_ahb[1:0]),
1152 : .axi_rlast(lsu_axi_rlast_ahb),
1153 :
1154 : // AHB-LITE signals
1155 : .ahb_haddr(lsu_haddr[31:0]),
1156 : .ahb_hburst(lsu_hburst),
1157 : .ahb_hmastlock(lsu_hmastlock),
1158 : .ahb_hprot(lsu_hprot[3:0]),
1159 : .ahb_hsize(lsu_hsize[2:0]),
1160 : .ahb_htrans(lsu_htrans[1:0]),
1161 : .ahb_hwrite(lsu_hwrite),
1162 : .ahb_hwdata(lsu_hwdata[63:0]),
1163 :
1164 : .ahb_hrdata(lsu_hrdata[63:0]),
1165 : .ahb_hready(lsu_hready),
1166 : .ahb_hresp(lsu_hresp),
1167 :
1168 : .*
1169 : );
1170 :
1171 : axi4_to_ahb #(.pt(pt),
1172 : .TAG(pt.IFU_BUS_TAG)) ifu_axi4_to_ahb (
1173 : .clk(free_l2clk),
1174 : .free_clk(free_clk),
1175 : .rst_l(core_rst_l),
1176 : .clk_override(dec_tlu_bus_clk_override),
1177 : .bus_clk_en(ifu_bus_clk_en),
1178 : .dec_tlu_force_halt(dec_tlu_force_halt),
1179 :
1180 : // AHB-Lite signals
1181 : .ahb_haddr(haddr[31:0]),
1182 : .ahb_hburst(hburst),
1183 : .ahb_hmastlock(hmastlock),
1184 : .ahb_hprot(hprot[3:0]),
1185 : .ahb_hsize(hsize[2:0]),
1186 : .ahb_htrans(htrans[1:0]),
1187 : .ahb_hwrite(hwrite),
1188 : .ahb_hwdata(hwdata_nc[63:0]),
1189 :
1190 : .ahb_hrdata(hrdata[63:0]),
1191 : .ahb_hready(hready),
1192 : .ahb_hresp(hresp),
1193 :
1194 : // AXI Write Channels
1195 : .axi_awvalid(ifu_axi_awvalid),
1196 : .axi_awready(ifu_axi_awready_ahb),
1197 : .axi_awid(ifu_axi_awid[pt.IFU_BUS_TAG-1:0]),
1198 : .axi_awaddr(ifu_axi_awaddr[31:0]),
1199 : .axi_awsize(ifu_axi_awsize[2:0]),
1200 : .axi_awprot(ifu_axi_awprot[2:0]),
1201 :
1202 : .axi_wvalid(ifu_axi_wvalid),
1203 : .axi_wready(ifu_axi_wready_ahb),
1204 : .axi_wdata(ifu_axi_wdata[63:0]),
1205 : .axi_wstrb(ifu_axi_wstrb[7:0]),
1206 : .axi_wlast(ifu_axi_wlast),
1207 :
1208 : .axi_bvalid(ifu_axi_bvalid_ahb),
1209 : .axi_bready(1'b1),
1210 : .axi_bresp(ifu_axi_bresp_ahb[1:0]),
1211 : .axi_bid(ifu_axi_bid_ahb[pt.IFU_BUS_TAG-1:0]),
1212 :
1213 : // AXI Read Channels
1214 : .axi_arvalid(ifu_axi_arvalid),
1215 : .axi_arready(ifu_axi_arready_ahb),
1216 : .axi_arid(ifu_axi_arid[pt.IFU_BUS_TAG-1:0]),
1217 : .axi_araddr(ifu_axi_araddr[31:0]),
1218 : .axi_arsize(ifu_axi_arsize[2:0]),
1219 : .axi_arprot(ifu_axi_arprot[2:0]),
1220 :
1221 : .axi_rvalid(ifu_axi_rvalid_ahb),
1222 : .axi_rready(ifu_axi_rready),
1223 : .axi_rid(ifu_axi_rid_ahb[pt.IFU_BUS_TAG-1:0]),
1224 : .axi_rdata(ifu_axi_rdata_ahb[63:0]),
1225 : .axi_rresp(ifu_axi_rresp_ahb[1:0]),
1226 : .axi_rlast(ifu_axi_rlast_ahb),
1227 : .*
1228 : );
1229 :
1230 : // AXI4 -> AHB Gasket for System Bus
1231 : axi4_to_ahb #(.pt(pt),
1232 : .TAG(pt.SB_BUS_TAG)) sb_axi4_to_ahb (
1233 : .clk(free_l2clk),
1234 : .free_clk(free_clk),
1235 : .rst_l(dbg_rst_l),
1236 : .clk_override(dec_tlu_bus_clk_override),
1237 : .bus_clk_en(dbg_bus_clk_en),
1238 : .dec_tlu_force_halt(1'b0),
1239 :
1240 : // AXI Write Channels
1241 : .axi_awvalid(sb_axi_awvalid),
1242 : .axi_awready(sb_axi_awready_ahb),
1243 : .axi_awid(sb_axi_awid[pt.SB_BUS_TAG-1:0]),
1244 : .axi_awaddr(sb_axi_awaddr[31:0]),
1245 : .axi_awsize(sb_axi_awsize[2:0]),
1246 : .axi_awprot(sb_axi_awprot[2:0]),
1247 :
1248 : .axi_wvalid(sb_axi_wvalid),
1249 : .axi_wready(sb_axi_wready_ahb),
1250 : .axi_wdata(sb_axi_wdata[63:0]),
1251 : .axi_wstrb(sb_axi_wstrb[7:0]),
1252 : .axi_wlast(sb_axi_wlast),
1253 :
1254 : .axi_bvalid(sb_axi_bvalid_ahb),
1255 : .axi_bready(sb_axi_bready),
1256 : .axi_bresp(sb_axi_bresp_ahb[1:0]),
1257 : .axi_bid(sb_axi_bid_ahb[pt.SB_BUS_TAG-1:0]),
1258 :
1259 : // AXI Read Channels
1260 : .axi_arvalid(sb_axi_arvalid),
1261 : .axi_arready(sb_axi_arready_ahb),
1262 : .axi_arid(sb_axi_arid[pt.SB_BUS_TAG-1:0]),
1263 : .axi_araddr(sb_axi_araddr[31:0]),
1264 : .axi_arsize(sb_axi_arsize[2:0]),
1265 : .axi_arprot(sb_axi_arprot[2:0]),
1266 :
1267 : .axi_rvalid(sb_axi_rvalid_ahb),
1268 : .axi_rready(sb_axi_rready),
1269 : .axi_rid(sb_axi_rid_ahb[pt.SB_BUS_TAG-1:0]),
1270 : .axi_rdata(sb_axi_rdata_ahb[63:0]),
1271 : .axi_rresp(sb_axi_rresp_ahb[1:0]),
1272 : .axi_rlast(sb_axi_rlast_ahb),
1273 : // AHB-LITE signals
1274 : .ahb_haddr(sb_haddr[31:0]),
1275 : .ahb_hburst(sb_hburst),
1276 : .ahb_hmastlock(sb_hmastlock),
1277 : .ahb_hprot(sb_hprot[3:0]),
1278 : .ahb_hsize(sb_hsize[2:0]),
1279 : .ahb_htrans(sb_htrans[1:0]),
1280 : .ahb_hwrite(sb_hwrite),
1281 : .ahb_hwdata(sb_hwdata[63:0]),
1282 :
1283 : .ahb_hrdata(sb_hrdata[63:0]),
1284 : .ahb_hready(sb_hready),
1285 : .ahb_hresp(sb_hresp),
1286 :
1287 : .*
1288 : );
1289 :
1290 : //AHB -> AXI4 Gasket for DMA
1291 : ahb_to_axi4 #(.pt(pt),
1292 : .TAG(pt.DMA_BUS_TAG)) dma_ahb_to_axi4 (
1293 : .clk(free_l2clk),
1294 : .rst_l(core_rst_l),
1295 : .clk_override(dec_tlu_bus_clk_override),
1296 : .bus_clk_en(dma_bus_clk_en),
1297 :
1298 : // AXI Write Channels
1299 : .axi_awvalid(dma_axi_awvalid_ahb),
1300 : .axi_awready(dma_axi_awready),
1301 : .axi_awid(dma_axi_awid_ahb[pt.DMA_BUS_TAG-1:0]),
1302 : .axi_awaddr(dma_axi_awaddr_ahb[31:0]),
1303 : .axi_awsize(dma_axi_awsize_ahb[2:0]),
1304 : .axi_awprot(dma_axi_awprot_ahb[2:0]),
1305 : .axi_awlen(dma_axi_awlen_ahb[7:0]),
1306 : .axi_awburst(dma_axi_awburst_ahb[1:0]),
1307 :
1308 : .axi_wvalid(dma_axi_wvalid_ahb),
1309 : .axi_wready(dma_axi_wready),
1310 : .axi_wdata(dma_axi_wdata_ahb[63:0]),
1311 : .axi_wstrb(dma_axi_wstrb_ahb[7:0]),
1312 : .axi_wlast(dma_axi_wlast_ahb),
1313 :
1314 : .axi_bvalid(dma_axi_bvalid),
1315 : .axi_bready(dma_axi_bready_ahb),
1316 : .axi_bresp(dma_axi_bresp[1:0]),
1317 : .axi_bid(dma_axi_bid[pt.DMA_BUS_TAG-1:0]),
1318 :
1319 : // AXI Read Channels
1320 : .axi_arvalid(dma_axi_arvalid_ahb),
1321 : .axi_arready(dma_axi_arready),
1322 : .axi_arid(dma_axi_arid_ahb[pt.DMA_BUS_TAG-1:0]),
1323 : .axi_araddr(dma_axi_araddr_ahb[31:0]),
1324 : .axi_arsize(dma_axi_arsize_ahb[2:0]),
1325 : .axi_arprot(dma_axi_arprot_ahb[2:0]),
1326 : .axi_arlen(dma_axi_arlen_ahb[7:0]),
1327 : .axi_arburst(dma_axi_arburst_ahb[1:0]),
1328 :
1329 : .axi_rvalid(dma_axi_rvalid),
1330 : .axi_rready(dma_axi_rready_ahb),
1331 : .axi_rid(dma_axi_rid[pt.DMA_BUS_TAG-1:0]),
1332 : .axi_rdata(dma_axi_rdata[63:0]),
1333 : .axi_rresp(dma_axi_rresp[1:0]),
1334 :
1335 : // AHB signals
1336 : .ahb_haddr(dma_haddr[31:0]),
1337 : .ahb_hburst(dma_hburst),
1338 : .ahb_hmastlock(dma_hmastlock),
1339 : .ahb_hprot(dma_hprot[3:0]),
1340 : .ahb_hsize(dma_hsize[2:0]),
1341 : .ahb_htrans(dma_htrans[1:0]),
1342 : .ahb_hwrite(dma_hwrite),
1343 : .ahb_hwdata(dma_hwdata[63:0]),
1344 :
1345 : .ahb_hrdata(dma_hrdata[63:0]),
1346 : .ahb_hreadyout(dma_hreadyout),
1347 : .ahb_hresp(dma_hresp),
1348 : .ahb_hreadyin(dma_hreadyin),
1349 : .ahb_hsel(dma_hsel),
1350 : .*
1351 : );
1352 :
1353 : end
1354 :
1355 : // Drive the final AXI inputs
1356 : assign lsu_axi_awready_int = pt.BUILD_AHB_LITE ? lsu_axi_awready_ahb : lsu_axi_awready;
1357 : assign lsu_axi_wready_int = pt.BUILD_AHB_LITE ? lsu_axi_wready_ahb : lsu_axi_wready;
1358 : assign lsu_axi_bvalid_int = pt.BUILD_AHB_LITE ? lsu_axi_bvalid_ahb : lsu_axi_bvalid;
1359 : assign lsu_axi_bready_int = pt.BUILD_AHB_LITE ? lsu_axi_bready_ahb : lsu_axi_bready;
1360 : assign lsu_axi_bresp_int[1:0] = pt.BUILD_AHB_LITE ? lsu_axi_bresp_ahb[1:0] : lsu_axi_bresp[1:0];
1361 : assign lsu_axi_bid_int[pt.LSU_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? lsu_axi_bid_ahb[pt.LSU_BUS_TAG-1:0] : lsu_axi_bid[pt.LSU_BUS_TAG-1:0];
1362 : assign lsu_axi_arready_int = pt.BUILD_AHB_LITE ? lsu_axi_arready_ahb : lsu_axi_arready;
1363 : assign lsu_axi_rvalid_int = pt.BUILD_AHB_LITE ? lsu_axi_rvalid_ahb : lsu_axi_rvalid;
1364 : assign lsu_axi_rid_int[pt.LSU_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? lsu_axi_rid_ahb[pt.LSU_BUS_TAG-1:0] : lsu_axi_rid[pt.LSU_BUS_TAG-1:0];
1365 : assign lsu_axi_rdata_int[63:0] = pt.BUILD_AHB_LITE ? lsu_axi_rdata_ahb[63:0] : lsu_axi_rdata[63:0];
1366 : assign lsu_axi_rresp_int[1:0] = pt.BUILD_AHB_LITE ? lsu_axi_rresp_ahb[1:0] : lsu_axi_rresp[1:0];
1367 : assign lsu_axi_rlast_int = pt.BUILD_AHB_LITE ? lsu_axi_rlast_ahb : lsu_axi_rlast;
1368 :
1369 : assign ifu_axi_awready_int = pt.BUILD_AHB_LITE ? ifu_axi_awready_ahb : ifu_axi_awready;
1370 : assign ifu_axi_wready_int = pt.BUILD_AHB_LITE ? ifu_axi_wready_ahb : ifu_axi_wready;
1371 : assign ifu_axi_bvalid_int = pt.BUILD_AHB_LITE ? ifu_axi_bvalid_ahb : ifu_axi_bvalid;
1372 : assign ifu_axi_bready_int = pt.BUILD_AHB_LITE ? ifu_axi_bready_ahb : ifu_axi_bready;
1373 : assign ifu_axi_bresp_int[1:0] = pt.BUILD_AHB_LITE ? ifu_axi_bresp_ahb[1:0] : ifu_axi_bresp[1:0];
1374 : assign ifu_axi_bid_int[pt.IFU_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? ifu_axi_bid_ahb[pt.IFU_BUS_TAG-1:0] : ifu_axi_bid[pt.IFU_BUS_TAG-1:0];
1375 : assign ifu_axi_arready_int = pt.BUILD_AHB_LITE ? ifu_axi_arready_ahb : ifu_axi_arready;
1376 : assign ifu_axi_rvalid_int = pt.BUILD_AHB_LITE ? ifu_axi_rvalid_ahb : ifu_axi_rvalid;
1377 : assign ifu_axi_rid_int[pt.IFU_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? ifu_axi_rid_ahb[pt.IFU_BUS_TAG-1:0] : ifu_axi_rid[pt.IFU_BUS_TAG-1:0];
1378 : assign ifu_axi_rdata_int[63:0] = pt.BUILD_AHB_LITE ? ifu_axi_rdata_ahb[63:0] : ifu_axi_rdata[63:0];
1379 : assign ifu_axi_rresp_int[1:0] = pt.BUILD_AHB_LITE ? ifu_axi_rresp_ahb[1:0] : ifu_axi_rresp[1:0];
1380 : assign ifu_axi_rlast_int = pt.BUILD_AHB_LITE ? ifu_axi_rlast_ahb : ifu_axi_rlast;
1381 :
1382 : assign sb_axi_awready_int = pt.BUILD_AHB_LITE ? sb_axi_awready_ahb : sb_axi_awready;
1383 : assign sb_axi_wready_int = pt.BUILD_AHB_LITE ? sb_axi_wready_ahb : sb_axi_wready;
1384 : assign sb_axi_bvalid_int = pt.BUILD_AHB_LITE ? sb_axi_bvalid_ahb : sb_axi_bvalid;
1385 : assign sb_axi_bready_int = pt.BUILD_AHB_LITE ? sb_axi_bready_ahb : sb_axi_bready;
1386 : assign sb_axi_bresp_int[1:0] = pt.BUILD_AHB_LITE ? sb_axi_bresp_ahb[1:0] : sb_axi_bresp[1:0];
1387 : assign sb_axi_bid_int[pt.SB_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? sb_axi_bid_ahb[pt.SB_BUS_TAG-1:0] : sb_axi_bid[pt.SB_BUS_TAG-1:0];
1388 : assign sb_axi_arready_int = pt.BUILD_AHB_LITE ? sb_axi_arready_ahb : sb_axi_arready;
1389 : assign sb_axi_rvalid_int = pt.BUILD_AHB_LITE ? sb_axi_rvalid_ahb : sb_axi_rvalid;
1390 : assign sb_axi_rid_int[pt.SB_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? sb_axi_rid_ahb[pt.SB_BUS_TAG-1:0] : sb_axi_rid[pt.SB_BUS_TAG-1:0];
1391 : assign sb_axi_rdata_int[63:0] = pt.BUILD_AHB_LITE ? sb_axi_rdata_ahb[63:0] : sb_axi_rdata[63:0];
1392 : assign sb_axi_rresp_int[1:0] = pt.BUILD_AHB_LITE ? sb_axi_rresp_ahb[1:0] : sb_axi_rresp[1:0];
1393 : assign sb_axi_rlast_int = pt.BUILD_AHB_LITE ? sb_axi_rlast_ahb : sb_axi_rlast;
1394 :
1395 : assign dma_axi_awvalid_int = pt.BUILD_AHB_LITE ? dma_axi_awvalid_ahb : dma_axi_awvalid;
1396 : assign dma_axi_awid_int[pt.DMA_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? dma_axi_awid_ahb[pt.DMA_BUS_TAG-1:0] : dma_axi_awid[pt.DMA_BUS_TAG-1:0];
1397 : assign dma_axi_awaddr_int[31:0] = pt.BUILD_AHB_LITE ? dma_axi_awaddr_ahb[31:0] : dma_axi_awaddr[31:0];
1398 : assign dma_axi_awsize_int[2:0] = pt.BUILD_AHB_LITE ? dma_axi_awsize_ahb[2:0] : dma_axi_awsize[2:0];
1399 : assign dma_axi_awprot_int[2:0] = pt.BUILD_AHB_LITE ? dma_axi_awprot_ahb[2:0] : dma_axi_awprot[2:0];
1400 : assign dma_axi_awlen_int[7:0] = pt.BUILD_AHB_LITE ? dma_axi_awlen_ahb[7:0] : dma_axi_awlen[7:0];
1401 : assign dma_axi_awburst_int[1:0] = pt.BUILD_AHB_LITE ? dma_axi_awburst_ahb[1:0] : dma_axi_awburst[1:0];
1402 : assign dma_axi_wvalid_int = pt.BUILD_AHB_LITE ? dma_axi_wvalid_ahb : dma_axi_wvalid;
1403 : assign dma_axi_wdata_int[63:0] = pt.BUILD_AHB_LITE ? dma_axi_wdata_ahb[63:0] : dma_axi_wdata;
1404 : assign dma_axi_wstrb_int[7:0] = pt.BUILD_AHB_LITE ? dma_axi_wstrb_ahb[7:0] : dma_axi_wstrb[7:0];
1405 : assign dma_axi_wlast_int = pt.BUILD_AHB_LITE ? dma_axi_wlast_ahb : dma_axi_wlast;
1406 : assign dma_axi_bready_int = pt.BUILD_AHB_LITE ? dma_axi_bready_ahb : dma_axi_bready;
1407 : assign dma_axi_arvalid_int = pt.BUILD_AHB_LITE ? dma_axi_arvalid_ahb : dma_axi_arvalid;
1408 : assign dma_axi_arid_int[pt.DMA_BUS_TAG-1:0] = pt.BUILD_AHB_LITE ? dma_axi_arid_ahb[pt.DMA_BUS_TAG-1:0] : dma_axi_arid[pt.DMA_BUS_TAG-1:0];
1409 : assign dma_axi_araddr_int[31:0] = pt.BUILD_AHB_LITE ? dma_axi_araddr_ahb[31:0] : dma_axi_araddr[31:0];
1410 : assign dma_axi_arsize_int[2:0] = pt.BUILD_AHB_LITE ? dma_axi_arsize_ahb[2:0] : dma_axi_arsize[2:0];
1411 : assign dma_axi_arprot_int[2:0] = pt.BUILD_AHB_LITE ? dma_axi_arprot_ahb[2:0] : dma_axi_arprot[2:0];
1412 : assign dma_axi_arlen_int[7:0] = pt.BUILD_AHB_LITE ? dma_axi_arlen_ahb[7:0] : dma_axi_arlen[7:0];
1413 : assign dma_axi_arburst_int[1:0] = pt.BUILD_AHB_LITE ? dma_axi_arburst_ahb[1:0] : dma_axi_arburst[1:0];
1414 : assign dma_axi_rready_int = pt.BUILD_AHB_LITE ? dma_axi_rready_ahb : dma_axi_rready;
1415 :
1416 :
1417 : if (pt.BUILD_AHB_LITE == 1) begin
1418 : `ifdef RV_ASSERT_ON
1419 : property ahb_trxn_aligned;
1420 : @(posedge clk) disable iff(~rst_l) (lsu_htrans[1:0] != 2'b0) |-> ((lsu_hsize[2:0] == 3'h0) |
1421 : ((lsu_hsize[2:0] == 3'h1) & (lsu_haddr[0] == 1'b0)) |
1422 : ((lsu_hsize[2:0] == 3'h2) & (lsu_haddr[1:0] == 2'b0)) |
1423 : ((lsu_hsize[2:0] == 3'h3) & (lsu_haddr[2:0] == 3'b0)));
1424 : endproperty
1425 : assert_ahb_trxn_aligned: assert property (ahb_trxn_aligned) else
1426 : $display("Assertion ahb_trxn_aligned failed: lsu_htrans=2'h%h, lsu_hsize=3'h%h, lsu_haddr=32'h%h",lsu_htrans[1:0], lsu_hsize[2:0], lsu_haddr[31:0]);
1427 :
1428 : property dma_trxn_aligned;
1429 : @(posedge clk) disable iff(~rst_l) (dma_htrans[1:0] != 2'b0) |-> ((dma_hsize[2:0] == 3'h0) |
1430 : ((dma_hsize[2:0] == 3'h1) & (dma_haddr[0] == 1'b0)) |
1431 : ((dma_hsize[2:0] == 3'h2) & (dma_haddr[1:0] == 2'b0)) |
1432 : ((dma_hsize[2:0] == 3'h3) & (dma_haddr[2:0] == 3'b0)));
1433 : endproperty
1434 :
1435 :
1436 : `endif
1437 : end // if (pt.BUILD_AHB_LITE == 1)
1438 :
1439 :
1440 : // unpack packet
1441 : // also need retires_p==3
1442 :
1443 : assign trace_rv_i_insn_ip[31:0] = trace_rv_trace_pkt.trace_rv_i_insn_ip[31:0];
1444 :
1445 : assign trace_rv_i_address_ip[31:0] = trace_rv_trace_pkt.trace_rv_i_address_ip[31:0];
1446 :
1447 : assign trace_rv_i_valid_ip = trace_rv_trace_pkt.trace_rv_i_valid_ip;
1448 :
1449 : assign trace_rv_i_exception_ip = trace_rv_trace_pkt.trace_rv_i_exception_ip;
1450 :
1451 : assign trace_rv_i_ecause_ip[4:0] = trace_rv_trace_pkt.trace_rv_i_ecause_ip[4:0];
1452 :
1453 : assign trace_rv_i_interrupt_ip = trace_rv_trace_pkt.trace_rv_i_interrupt_ip;
1454 :
1455 : assign trace_rv_i_tval_ip[31:0] = trace_rv_trace_pkt.trace_rv_i_tval_ip[31:0];
1456 :
1457 :
1458 :
1459 : endmodule // el2_veer
1460 :
|