-
Notifications
You must be signed in to change notification settings - Fork 18
/
spatz_cluster.sv
1477 lines (1352 loc) · 61.3 KB
/
spatz_cluster.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 ETH Zurich and University of Bologna.
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
// SPDX-License-Identifier: SHL-0.51
// Author: Matheus Cavalcante <[email protected]>
`include "axi/assign.svh"
`include "axi/typedef.svh"
`include "common_cells/assertions.svh"
`include "common_cells/registers.svh"
`include "mem_interface/assign.svh"
`include "mem_interface/typedef.svh"
`include "register_interface//assign.svh"
`include "register_interface/typedef.svh"
`include "reqrsp_interface/assign.svh"
`include "reqrsp_interface/typedef.svh"
`include "snitch_vm/typedef.svh"
`include "tcdm_interface/assign.svh"
`include "tcdm_interface/typedef.svh"
/// Spatz many-core cluster with improved TCDM interconnect.
/// Spatz Cluster Top-Level.
module spatz_cluster
import spatz_pkg::*;
import fpnew_pkg::fpu_implementation_t;
import snitch_pma_pkg::snitch_pma_t;
#(
/// Width of physical address.
parameter int unsigned AxiAddrWidth = 48,
/// Width of AXI port.
parameter int unsigned AxiDataWidth = 512,
/// AXI: id width in.
parameter int unsigned AxiIdWidthIn = 2,
/// AXI: id width out.
parameter int unsigned AxiIdWidthOut = 2,
/// AXI: user width.
parameter int unsigned AxiUserWidth = 1,
/// Address from which to fetch the first instructions.
parameter logic [31:0] BootAddr = 32'h0,
/// The total amount of cores.
parameter int unsigned NrCores = 8,
/// Data/TCDM memory depth per cut (in words).
parameter int unsigned TCDMDepth = 1024,
/// Cluster peripheral address region size (in kB).
parameter int unsigned ClusterPeriphSize = 64,
/// Number of TCDM Banks.
parameter int unsigned NrBanks = 2 * NrCores,
/// Size of DMA AXI buffer.
parameter int unsigned DMAAxiReqFifoDepth = 3,
/// Size of DMA request fifo.
parameter int unsigned DMAReqFifoDepth = 3,
/// Width of a single icache line.
parameter unsigned ICacheLineWidth = 0,
/// Number of icache lines per set.
parameter int unsigned ICacheLineCount = 0,
/// Number of icache sets.
parameter int unsigned ICacheSets = 0,
// PMA Configuration
parameter snitch_pma_t SnitchPMACfg = '{default: 0},
/// # Core-global parameters
/// FPU configuration.
parameter fpu_implementation_t FPUImplementation [NrCores] = '{default: fpu_implementation_t'(0)},
/// Spatz FPU/IPU Configuration
parameter int unsigned NumSpatzFPUs = 4,
parameter int unsigned NumSpatzIPUs = 1,
/// Per-core enabling of the custom `Xdma` ISA extensions.
parameter bit [NrCores-1:0] Xdma = '{default: '0},
/// # Per-core parameters
/// Per-core integer outstanding loads
parameter int unsigned NumIntOutstandingLoads [NrCores] = '{default: '0},
/// Per-core integer outstanding memory operations (load and stores)
parameter int unsigned NumIntOutstandingMem [NrCores] = '{default: '0},
/// Per-core Spatz outstanding loads
parameter int unsigned NumSpatzOutstandingLoads [NrCores] = '{default: '0},
/// ## Timing Tuning Parameters
/// Insert Pipeline registers into off-loading path (response)
parameter bit RegisterOffloadRsp = 1'b0,
/// Insert Pipeline registers into data memory path (request)
parameter bit RegisterCoreReq = 1'b0,
/// Insert Pipeline registers into data memory path (response)
parameter bit RegisterCoreRsp = 1'b0,
/// Insert Pipeline registers after each memory cut
parameter bit RegisterTCDMCuts = 1'b0,
/// Decouple external AXI plug
parameter bit RegisterExt = 1'b0,
parameter axi_pkg::xbar_latency_e XbarLatency = axi_pkg::CUT_ALL_PORTS,
/// Outstanding transactions on the AXI network
parameter int unsigned MaxMstTrans = 4,
parameter int unsigned MaxSlvTrans = 4,
/// # Interface
/// AXI Ports
parameter type axi_in_req_t = logic,
parameter type axi_in_resp_t = logic,
parameter type axi_out_req_t = logic,
parameter type axi_out_resp_t = logic,
/// SRAM configuration
parameter type impl_in_t = logic,
// Memory latency parameter. Most of the memories have a read latency of 1. In
// case you have memory macros which are pipelined you want to adjust this
// value here. This only applies to the TCDM. The instruction cache macros will break!
// In case you are using the `RegisterTCDMCuts` feature this adds an
// additional cycle latency, which is taken into account here.
parameter int unsigned MemoryMacroLatency = 1 + RegisterTCDMCuts,
/// # SRAM Configuration rules needed: L1D Tag + L1D Data + L1D FIFO + L1I Tag + L1I Data
parameter int unsigned NrSramCfg = 64 + 8 + 2 + ICacheSets + ICacheSets
) (
/// System clock.
input logic clk_i,
/// Asynchronous active high reset. This signal is assumed to be _async_.
input logic rst_ni,
/// Per-core debug request signal. Asserting this signals puts the
/// corresponding core into debug mode. This signal is assumed to be _async_.
input logic [NrCores-1:0] debug_req_i,
/// Machine external interrupt pending. Usually those interrupts come from a
/// platform-level interrupt controller. This signal is assumed to be _async_.
input logic [NrCores-1:0] meip_i,
/// Machine timer interrupt pending. Usually those interrupts come from a
/// core-local interrupt controller such as a timer/RTC. This signal is
/// assumed to be _async_.
input logic [NrCores-1:0] mtip_i,
/// Core software interrupt pending. Usually those interrupts come from
/// another core to facilitate inter-processor-interrupts. This signal is
/// assumed to be _async_.
input logic [NrCores-1:0] msip_i,
/// First hartid of the cluster. Cores of a cluster are monotonically
/// increasing without a gap, i.e., a cluster with 8 cores and a
/// `hart_base_id_i` of 5 get the hartids 5 - 12.
input logic [9:0] hart_base_id_i,
/// Base address of cluster. TCDM and cluster peripheral location are derived from
/// it. This signal is pseudo-static.
input logic [AxiAddrWidth-1:0] cluster_base_addr_i,
/// Per-cluster probe on the cluster status. Can be written by the cores to indicate
/// to the overall system that the cluster is executing something.
output logic cluster_probe_o,
/// AXI Core cluster in-port.
input axi_in_req_t axi_in_req_i,
output axi_in_resp_t axi_in_resp_o,
/// AXI Core cluster out-port to core.
output axi_out_req_t axi_out_req_o,
input axi_out_resp_t axi_out_resp_i,
/// AXI Core cluster out-port to L2 Mem.
output axi_out_req_t axi_out_l2_req_o,
input axi_out_resp_t axi_out_l2_resp_i,
/// SRAM Configuration: L1D Data + L1D Tag + L1D FIFO + L1I Data + L1I Tag
input impl_in_t [NrSramCfg-1:0] impl_i,
/// Indicate the program execution is error
output logic error_o
);
// ---------
// Imports
// ---------
import snitch_pkg::*;
import snitch_icache_pkg::icache_events_t;
// ---------
// Constants
// ---------
/// Minimum width to hold the core number.
localparam int unsigned CoreIDWidth = cf_math_pkg::idx_width(NrCores);
localparam int unsigned TCDMMemAddrWidth = $clog2(TCDMDepth);
localparam int unsigned TCDMSize = NrBanks * TCDMDepth * (DataWidth/8);
// The short address for SPM
localparam int unsigned SPMAddrWidth = $clog2(TCDMSize);
// Enlarge the address width for Spatz due to cache
localparam int unsigned TCDMAddrWidth = 32;
localparam int unsigned BanksPerSuperBank = AxiDataWidth / DataWidth;
localparam int unsigned NrSuperBanks = NrBanks / BanksPerSuperBank;
function automatic int unsigned get_tcdm_ports(int unsigned core);
return spatz_pkg::N_FU + 1;
endfunction
function automatic int unsigned get_tcdm_port_offs(int unsigned core_idx);
automatic int n = 0;
for (int i = 0; i < core_idx; i++) n += get_tcdm_ports(i);
return n;
endfunction
localparam int unsigned NrTCDMPortsCores = get_tcdm_port_offs(NrCores);
localparam int unsigned NumTCDMIn = NrTCDMPortsCores + 1;
localparam logic [AxiAddrWidth-1:0] TCDMMask = ~(TCDMSize-1);
// Core Request, SoC Request
localparam int unsigned NrNarrowMasters = 2;
// Narrow AXI network parameters
localparam int unsigned NarrowIdWidthIn = AxiIdWidthIn;
localparam int unsigned NarrowIdWidthOut = NarrowIdWidthIn + $clog2(NrNarrowMasters);
localparam int unsigned NarrowDataWidth = 64;
localparam int unsigned NarrowUserWidth = AxiUserWidth;
// TCDM, Peripherals, SoC Request
localparam int unsigned NrNarrowSlaves = 3;
localparam int unsigned NrNarrowRules = NrNarrowSlaves - 1;
// Core Request, DMA, Instruction cache
/// Additional one for L1 DCache
localparam int unsigned NrWideMasters = 3 + 1;
localparam int unsigned WideIdWidthOut = AxiIdWidthOut;
localparam int unsigned WideIdWidthIn = WideIdWidthOut - $clog2(NrWideMasters);
// DMA X-BAR configuration
localparam int unsigned NrWideSlaves = 3 + 1; // one prot for L2, one for L3/LLC (virtual)
// AXI Configuration
localparam axi_pkg::xbar_cfg_t ClusterXbarCfg = '{
NoSlvPorts : NrNarrowMasters,
NoMstPorts : NrNarrowSlaves,
MaxMstTrans : MaxMstTrans,
MaxSlvTrans : MaxSlvTrans,
FallThrough : 1'b0,
LatencyMode : XbarLatency,
AxiIdWidthSlvPorts: NarrowIdWidthIn,
AxiIdUsedSlvPorts : NarrowIdWidthIn,
UniqueIds : 1'b0,
AxiAddrWidth : AxiAddrWidth,
AxiDataWidth : NarrowDataWidth,
NoAddrRules : NrNarrowRules,
default : '0
};
// DMA configuration struct
localparam axi_pkg::xbar_cfg_t DmaXbarCfg = '{
NoSlvPorts : NrWideMasters,
NoMstPorts : NrWideSlaves,
MaxMstTrans : MaxMstTrans,
MaxSlvTrans : MaxSlvTrans,
FallThrough : 1'b0,
LatencyMode : XbarLatency,
AxiIdWidthSlvPorts: WideIdWidthIn,
AxiIdUsedSlvPorts : WideIdWidthIn,
UniqueIds : 1'b0,
AxiAddrWidth : AxiAddrWidth,
AxiDataWidth : AxiDataWidth,
NoAddrRules : NrWideSlaves - 1,
default : '0
};
// L1 Cache
localparam int unsigned L1AddrWidth = 32;
localparam int unsigned L1LineWidth = 512;
localparam int unsigned L1Associativity = 4;
localparam int unsigned L1BankFactor = 2;
localparam int unsigned L1CoalFactor = 2;
// 8 * 1024 * 64 / 512 = 1024)
localparam int unsigned L1NumEntry = NrBanks * TCDMDepth * DataWidth / L1LineWidth;
localparam int unsigned L1NumWrapper = L1LineWidth / DataWidth;
localparam int unsigned L1BankPerWP = L1BankFactor * L1Associativity;
localparam int unsigned L1BankPerWay = L1BankFactor * L1NumWrapper;
localparam int unsigned L1CacheWayEntry = L1NumEntry / L1Associativity;
localparam int unsigned L1NumSet = L1CacheWayEntry / L1BankFactor;
localparam int unsigned L1NumTagBank = L1BankFactor * L1Associativity;
localparam int unsigned L1NumDataBank = L1BankFactor * L1NumWrapper * L1Associativity;
// --------
// Typedefs
// --------
typedef logic [AxiAddrWidth-1:0] addr_t;
typedef logic [NarrowDataWidth-1:0] data_t;
typedef logic [NarrowDataWidth/8-1:0] strb_t;
typedef logic [AxiDataWidth-1:0] data_dma_t;
typedef logic [AxiDataWidth/8-1:0] strb_dma_t;
typedef logic [NarrowIdWidthIn-1:0] id_mst_t;
typedef logic [NarrowIdWidthOut-1:0] id_slv_t;
typedef logic [WideIdWidthIn-1:0] id_dma_mst_t;
typedef logic [WideIdWidthOut-1:0] id_dma_slv_t;
typedef logic [NarrowUserWidth-1:0] user_t;
typedef logic [AxiUserWidth-1:0] user_dma_t;
typedef logic [TCDMMemAddrWidth-1:0] tcdm_mem_addr_t;
typedef logic [TCDMAddrWidth-1:0] tcdm_addr_t;
typedef logic [SPMAddrWidth-1:0] spm_addr_t;
typedef logic [$clog2(NumSpatzOutstandingLoads[0])-1:0] reqid_t;
typedef logic [$clog2(NumSpatzOutstandingLoads[0]):0] tcdm_meta_t;
typedef logic [$clog2(L1NumSet)-1:0] tcdm_bank_addr_t;
typedef struct packed {
logic [CoreIDWidth-1:0] core_id;
logic is_core;
reqid_t req_id;
} tcdm_user_t;
// Regbus peripherals.
`AXI_TYPEDEF_ALL(axi_mst, addr_t, id_mst_t, data_t, strb_t, user_t)
`AXI_TYPEDEF_ALL(axi_slv, addr_t, id_slv_t, data_t, strb_t, user_t)
`AXI_TYPEDEF_ALL(axi_mst_dma, addr_t, id_dma_mst_t, data_dma_t, strb_dma_t, user_dma_t)
`AXI_TYPEDEF_ALL(axi_slv_dma, addr_t, id_dma_slv_t, data_dma_t, strb_dma_t, user_dma_t)
`REQRSP_TYPEDEF_ALL(reqrsp, addr_t, data_t, strb_t)
`MEM_TYPEDEF_ALL(mem, tcdm_mem_addr_t, data_t, strb_t, tcdm_user_t)
`MEM_TYPEDEF_ALL(mem_dma, tcdm_mem_addr_t, data_dma_t, strb_dma_t, logic)
`TCDM_TYPEDEF_ALL(tcdm, tcdm_addr_t, data_t, strb_t, tcdm_user_t)
`TCDM_TYPEDEF_ALL(tcdm_dma, tcdm_addr_t, data_dma_t, strb_dma_t, logic)
`TCDM_TYPEDEF_ALL(spm, spm_addr_t, data_t, strb_t, tcdm_user_t)
`REG_BUS_TYPEDEF_ALL(reg, addr_t, data_t, strb_t)
`REG_BUS_TYPEDEF_ALL(reg_dma, addr_t, data_dma_t, strb_dma_t)
// Event counter increments for the TCDM.
typedef struct packed {
/// Number requests going in
logic [$clog2(NrTCDMPortsCores):0] inc_accessed;
/// Number of requests stalled due to congestion
logic [$clog2(NrTCDMPortsCores):0] inc_congested;
} tcdm_events_t;
// Event counter increments for DMA.
typedef struct packed {
logic aw_stall, ar_stall, r_stall, w_stall,
buf_w_stall, buf_r_stall;
logic aw_valid, aw_ready, aw_done, aw_bw;
logic ar_valid, ar_ready, ar_done, ar_bw;
logic r_valid, r_ready, r_done, r_bw;
logic w_valid, w_ready, w_done, w_bw;
logic b_valid, b_ready, b_done;
logic dma_busy;
axi_pkg::len_t aw_len, ar_len;
axi_pkg::size_t aw_size, ar_size;
logic [$clog2(AxiDataWidth/8):0] num_bytes_written;
} dma_events_t;
typedef struct packed {
int unsigned idx;
addr_t start_addr;
addr_t end_addr;
} xbar_rule_t;
typedef struct packed {
acc_addr_e addr;
logic [5:0] id;
logic [31:0] data_op;
data_t data_arga;
data_t data_argb;
addr_t data_argc;
} acc_issue_req_t;
typedef struct packed {
logic accept;
logic writeback;
logic loadstore;
logic exception;
logic isfloat;
} acc_issue_rsp_t;
typedef struct packed {
logic [5:0] id;
logic error;
data_t data;
} acc_rsp_t;
`SNITCH_VM_TYPEDEF(AxiAddrWidth)
typedef struct packed {
// Slow domain.
logic flush_i_valid;
addr_t inst_addr;
logic inst_cacheable;
logic inst_valid;
// Fast domain.
acc_issue_req_t acc_req;
logic acc_qvalid;
logic acc_pready;
// Slow domain.
logic [1:0] ptw_valid;
va_t [1:0] ptw_va;
pa_t [1:0] ptw_ppn;
} hive_req_t;
typedef struct packed {
// Slow domain.
logic flush_i_ready;
logic [31:0] inst_data;
logic inst_ready;
logic inst_error;
// Fast domain.
logic acc_qready;
acc_rsp_t acc_resp;
logic acc_pvalid;
// Slow domain.
logic [1:0] ptw_ready;
l0_pte_t [1:0] ptw_pte;
logic [1:0] ptw_is_4mega;
} hive_rsp_t;
// -----------
// Assignments
// -----------
// Calculate start and end address of TCDM based on the `cluster_base_addr_i`.
addr_t tcdm_start_address, tcdm_end_address;
assign tcdm_start_address = (cluster_base_addr_i & TCDMMask);
assign tcdm_end_address = (tcdm_start_address + TCDMSize) & TCDMMask;
addr_t cluster_periph_start_address, cluster_periph_end_address;
assign cluster_periph_start_address = tcdm_end_address;
assign cluster_periph_end_address = tcdm_end_address + ClusterPeriphSize * 1024;
localparam int unsigned ClusterReserve = 4096; // 4 MiB
localparam int unsigned ClusterL2Size = 8192; // 8 MiB
addr_t cluster_l2_start_address, cluster_l2_end_address;
// assign cluster_l2_start_address = cluster_periph_end_address + ClusterReserve * 1024;
// assign cluster_l2_end_address = cluster_l2_start_address + ClusterL2Size * 1024;
// TODO: change to calc base on cluster_base_addr_i
assign cluster_l2_start_address = 48'h5180_0000;
assign cluster_l2_end_address = 48'h5200_0000;
// ----------------
// Wire Definitions
// ----------------
// 1. AXI
axi_slv_req_t [NrNarrowSlaves-1:0] narrow_axi_slv_req;
axi_slv_resp_t [NrNarrowSlaves-1:0] narrow_axi_slv_rsp;
axi_mst_req_t [NrNarrowMasters-1:0] narrow_axi_mst_req;
axi_mst_resp_t [NrNarrowMasters-1:0] narrow_axi_mst_rsp;
// DMA AXI buses
axi_mst_dma_req_t [NrWideMasters-1:0] wide_axi_mst_req;
axi_mst_dma_resp_t [NrWideMasters-1:0] wide_axi_mst_rsp;
axi_slv_dma_req_t [NrWideSlaves-1 :0] wide_axi_slv_req;
axi_slv_dma_resp_t [NrWideSlaves-1 :0] wide_axi_slv_rsp;
// 2. Memory Subsystem (Banks)
mem_req_t [NrSuperBanks-1:0][BanksPerSuperBank-1:0] ic_req;
mem_rsp_t [NrSuperBanks-1:0][BanksPerSuperBank-1:0] ic_rsp;
mem_dma_req_t [NrSuperBanks-1:0] sb_dma_req;
mem_dma_rsp_t [NrSuperBanks-1:0] sb_dma_rsp;
// 3. Memory Subsystem (Interconnect)
tcdm_dma_req_t ext_dma_req;
tcdm_dma_rsp_t ext_dma_rsp;
// AXI Ports into TCDM (from SoC).
spm_req_t axi_soc_req;
spm_rsp_t axi_soc_rsp;
tcdm_req_t [NrTCDMPortsCores-1:0] tcdm_req;
tcdm_rsp_t [NrTCDMPortsCores-1:0] tcdm_rsp;
core_events_t [NrCores-1:0] core_events;
tcdm_events_t tcdm_events;
dma_events_t dma_events;
snitch_icache_pkg::icache_events_t [NrCores-1:0] icache_events;
// 4. Memory Subsystem (Core side).
reqrsp_req_t [NrCores-1:0] core_req, filtered_core_req;
reqrsp_rsp_t [NrCores-1:0] core_rsp, filtered_core_rsp;
// 5. Peripheral Subsystem
reg_req_t reg_req;
reg_rsp_t reg_rsp;
// 6. BootROM
reg_dma_req_t bootrom_reg_req;
reg_dma_rsp_t bootrom_reg_rsp;
// 7. Misc. Wires.
logic icache_prefetch_enable;
logic [NrCores-1:0] cl_interrupt;
// 8. L1 D$
spm_req_t [NrTCDMPortsCores-1:0] spm_req;
spm_rsp_t [NrTCDMPortsCores-1:0] spm_rsp;
tcdm_req_t [NrTCDMPortsCores-1:0] cache_req;
tcdm_rsp_t [NrTCDMPortsCores-1:0] cache_rsp;
logic [NrTCDMPortsCores-1:0] cache_req_valid;
logic [NrTCDMPortsCores-1:0] cache_req_ready;
tcdm_addr_t [NrTCDMPortsCores-1:0] cache_req_addr;
tcdm_user_t [NrTCDMPortsCores-1:0] cache_req_meta;
logic [NrTCDMPortsCores-1:0] cache_req_write;
data_t [NrTCDMPortsCores-1:0] cache_req_data;
logic [NrTCDMPortsCores-1:0] cache_rsp_valid;
logic [NrTCDMPortsCores-1:0] cache_rsp_ready;
logic [NrTCDMPortsCores-1:0] cache_rsp_write;
data_t [NrTCDMPortsCores-1:0] cache_rsp_data;
tcdm_user_t [NrTCDMPortsCores-1:0] cache_rsp_meta;
logic [L1NumTagBank-1:0] l1_tag_bank_req;
logic [L1NumTagBank-1:0] l1_tag_bank_we;
tcdm_bank_addr_t [L1NumTagBank-1:0] l1_tag_bank_addr;
data_t [L1NumTagBank-1:0] l1_tag_bank_wdata;
logic [L1NumTagBank-1:0] l1_tag_bank_be;
data_t [L1NumTagBank-1:0] l1_tag_bank_rdata;
logic [L1NumDataBank-1:0] l1_data_bank_req;
logic [L1NumDataBank-1:0] l1_data_bank_we;
tcdm_bank_addr_t [L1NumDataBank-1:0] l1_data_bank_addr;
data_t [L1NumDataBank-1:0] l1_data_bank_wdata;
logic [L1NumDataBank-1:0] l1_data_bank_be;
data_t [L1NumDataBank-1:0] l1_data_bank_rdata;
logic [L1NumDataBank-1:0] l1_data_bank_gnt;
logic [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_req;
logic [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_we;
tcdm_bank_addr_t [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_addr;
data_t [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_wdata;
strb_t [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_be;
data_t [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_rdata;
logic [L1NumWrapper-1:0][L1BankPerWP-1:0] l1_cache_wp_gnt;
logic l1d_insn_valid, l1d_insn_ready;
logic [1:0] l1d_insn;
tcdm_bank_addr_t cfg_spm_size;
tcdm_addr_t spm_size;
logic l1d_busy;
// High if a port access an illegal SPM region (mapped to cache)
logic [NrTCDMPortsCores-1:0] spm_error;
// 9. SRAM Configuration
impl_in_t [L1NumWrapper-1:0][L1BankPerWP-1:0] impl_l1d_data;
impl_in_t [L1NumTagBank-1:0] impl_l1d_tag;
impl_in_t [1:0] impl_l1d_fifo;
impl_in_t [ICacheSets-1:0] impl_l1i_data;
impl_in_t [ICacheSets-1:0] impl_l1i_tag;
assign {impl_l1d_data, impl_l1d_tag, impl_l1d_fifo, impl_l1i_data, impl_l1i_tag} = impl_i;
assign error_o = |spm_error;
// -------------
// DMA Subsystem
// -------------
// Optionally decouple the external wide AXI master port.
axi_cut #(
.Bypass (!RegisterExt ),
.aw_chan_t (axi_slv_dma_aw_chan_t),
.w_chan_t (axi_slv_dma_w_chan_t ),
.b_chan_t (axi_slv_dma_b_chan_t ),
.ar_chan_t (axi_slv_dma_ar_chan_t),
.r_chan_t (axi_slv_dma_r_chan_t ),
.axi_req_t (axi_slv_dma_req_t ),
.axi_resp_t (axi_slv_dma_resp_t )
) i_cut_ext_wide_out (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.slv_req_i (wide_axi_slv_req[SoCDMAOut]),
.slv_resp_o (wide_axi_slv_rsp[SoCDMAOut]),
.mst_req_o (axi_out_req_o ),
.mst_resp_i (axi_out_resp_i )
);
axi_cut #(
.Bypass (!RegisterExt ),
.aw_chan_t (axi_slv_dma_aw_chan_t),
.w_chan_t (axi_slv_dma_w_chan_t ),
.b_chan_t (axi_slv_dma_b_chan_t ),
.ar_chan_t (axi_slv_dma_ar_chan_t),
.r_chan_t (axi_slv_dma_r_chan_t ),
.axi_req_t (axi_slv_dma_req_t ),
.axi_resp_t (axi_slv_dma_resp_t )
) i_cut_ext_l2_wide_out (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.slv_req_i (wide_axi_slv_req[L2Mem]),
.slv_resp_o (wide_axi_slv_rsp[L2Mem]),
.mst_req_o (axi_out_l2_req_o ),
.mst_resp_i (axi_out_l2_resp_i )
);
axi_cut #(
.Bypass (!RegisterExt ),
.aw_chan_t (axi_mst_aw_chan_t),
.w_chan_t (axi_mst_w_chan_t ),
.b_chan_t (axi_mst_b_chan_t ),
.ar_chan_t (axi_mst_ar_chan_t),
.r_chan_t (axi_mst_r_chan_t ),
.axi_req_t (axi_mst_req_t ),
.axi_resp_t (axi_mst_resp_t )
) i_cut_ext_narrow_in (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.slv_req_i (axi_in_req_i ),
.slv_resp_o (axi_in_resp_o ),
.mst_req_o (narrow_axi_mst_req[SoCDMAIn]),
.mst_resp_i (narrow_axi_mst_rsp[SoCDMAIn])
);
logic [DmaXbarCfg.NoSlvPorts-1:0][$clog2(DmaXbarCfg.NoMstPorts)-1:0] dma_xbar_default_port;
xbar_rule_t [DmaXbarCfg.NoAddrRules-1:0] dma_xbar_rule;
assign dma_xbar_default_port = '{default: SoCDMAOut};
assign dma_xbar_rule = '{
'{
idx : TCDMDMA,
start_addr: tcdm_start_address,
end_addr : tcdm_end_address
},
'{
idx : BootROM,
start_addr: BootAddr,
end_addr : BootAddr + 'h1000
},
'{
idx : L2Mem,
start_addr: cluster_l2_start_address,
end_addr : cluster_l2_end_address
}
};
localparam bit [DmaXbarCfg.NoSlvPorts-1:0] DMAEnableDefaultMstPort = '1;
axi_xbar #(
.Cfg (DmaXbarCfg ),
.ATOPs (0 ),
.slv_aw_chan_t (axi_mst_dma_aw_chan_t),
.mst_aw_chan_t (axi_slv_dma_aw_chan_t),
.w_chan_t (axi_mst_dma_w_chan_t ),
.slv_b_chan_t (axi_mst_dma_b_chan_t ),
.mst_b_chan_t (axi_slv_dma_b_chan_t ),
.slv_ar_chan_t (axi_mst_dma_ar_chan_t),
.mst_ar_chan_t (axi_slv_dma_ar_chan_t),
.slv_r_chan_t (axi_mst_dma_r_chan_t ),
.mst_r_chan_t (axi_slv_dma_r_chan_t ),
.slv_req_t (axi_mst_dma_req_t ),
.slv_resp_t (axi_mst_dma_resp_t ),
.mst_req_t (axi_slv_dma_req_t ),
.mst_resp_t (axi_slv_dma_resp_t ),
.rule_t (xbar_rule_t )
) i_axi_dma_xbar (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.test_i (1'b0 ),
.slv_ports_req_i (wide_axi_mst_req ),
.slv_ports_resp_o (wide_axi_mst_rsp ),
.mst_ports_req_o (wide_axi_slv_req ),
.mst_ports_resp_i (wide_axi_slv_rsp ),
.addr_map_i (dma_xbar_rule ),
.en_default_mst_port_i (DMAEnableDefaultMstPort),
.default_mst_port_i (dma_xbar_default_port )
);
addr_t ext_dma_req_q_addr_nontrunc;
axi_to_mem_interleaved #(
.axi_req_t (axi_slv_dma_req_t ),
.axi_resp_t (axi_slv_dma_resp_t ),
.AddrWidth (AxiAddrWidth ),
.DataWidth (AxiDataWidth ),
.IdWidth (WideIdWidthOut ),
.NumBanks (1 ),
.BufDepth (MemoryMacroLatency + 1)
) i_axi_to_mem_dma (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.busy_o (/* Unused */ ),
.test_i (1'b0 ),
.axi_req_i (wide_axi_slv_req[TCDMDMA] ),
.axi_resp_o (wide_axi_slv_rsp[TCDMDMA] ),
.mem_req_o (ext_dma_req.q_valid ),
.mem_gnt_i (ext_dma_rsp.q_ready ),
.mem_addr_o (ext_dma_req_q_addr_nontrunc ),
.mem_wdata_o (ext_dma_req.q.data ),
.mem_strb_o (ext_dma_req.q.strb ),
.mem_atop_o (/* The DMA does not support atomics */),
.mem_we_o (ext_dma_req.q.write ),
.mem_rvalid_i (ext_dma_rsp.p_valid ),
.mem_rdata_i (ext_dma_rsp.p.data )
);
assign ext_dma_req.q.addr = tcdm_addr_t'(ext_dma_req_q_addr_nontrunc);
assign ext_dma_req.q.amo = reqrsp_pkg::AMONone;
assign ext_dma_req.q.user = '0;
spatz_tcdm_interconnect #(
.NumInp (1 ),
.NumOut (NrSuperBanks ),
.tcdm_req_t (tcdm_dma_req_t ),
.tcdm_rsp_t (tcdm_dma_rsp_t ),
.mem_req_t (mem_dma_req_t ),
.mem_rsp_t (mem_dma_rsp_t ),
.user_t (logic ),
.MemAddrWidth (TCDMMemAddrWidth ),
.DataWidth (AxiDataWidth ),
.MemoryResponseLatency (MemoryMacroLatency)
) i_dma_interconnect (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.req_i (ext_dma_req),
.rsp_o (ext_dma_rsp),
.mem_req_o (sb_dma_req ),
.mem_rsp_i (sb_dma_rsp )
);
// ----------------
// Memory Subsystem
// ----------------
for (genvar i = 0; i < NrSuperBanks; i++) begin : gen_tcdm_super_bank
mem_req_t [BanksPerSuperBank-1:0] amo_req;
mem_rsp_t [BanksPerSuperBank-1:0] amo_rsp;
mem_wide_narrow_mux #(
.NarrowDataWidth (NarrowDataWidth),
.WideDataWidth (AxiDataWidth ),
.mem_narrow_req_t (mem_req_t ),
.mem_narrow_rsp_t (mem_rsp_t ),
.mem_wide_req_t (mem_dma_req_t ),
.mem_wide_rsp_t (mem_dma_rsp_t )
) i_tcdm_mux (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.in_narrow_req_i (ic_req [i] ),
.in_narrow_rsp_o (ic_rsp [i] ),
.in_wide_req_i (sb_dma_req [i] ),
.in_wide_rsp_o (sb_dma_rsp [i] ),
.out_req_o (amo_req ),
.out_rsp_i (amo_rsp ),
.sel_wide_i (sb_dma_req[i].q_valid)
);
// generate banks of the superbank
for (genvar j = 0; j < BanksPerSuperBank; j++) begin : gen_tcdm_bank
logic mem_cs, mem_wen;
tcdm_mem_addr_t mem_add;
tcdm_mem_addr_t mem_add_max;
strb_t mem_be;
data_t mem_rdata, mem_wdata;
tcdm_meta_t mem_req_meta;
assign mem_add_max = 0 - 1'b1;
spatz_sram_wrapper #(
.NumBanks (L1BankPerWP ),
.NumWords (TCDMDepth ),
.ByteWidth (8 ),
.DataWidth (DataWidth ),
.MemoryResponseLatency (1 ),
.impl_in_t (impl_in_t )
) i_data_mem (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.spm_size_i (cfg_spm_size ),
/// Cache Side TODO: Connect cache
.cache_req_i (l1_cache_wp_req [j] ),
.cache_we_i (l1_cache_wp_we [j] ),
.cache_addr_i (l1_cache_wp_addr [j] ),
.cache_wdata_i(l1_cache_wp_wdata[j] ),
.cache_be_i (l1_cache_wp_be [j] ),
.cache_rdata_o(l1_cache_wp_rdata[j] ),
.cache_ready_o(l1_cache_wp_gnt [j] ),
/// SPM Side
.spm_req_i (mem_cs ),
.spm_we_i (mem_wen ),
.spm_addr_i (mem_add_max - mem_add),
.spm_wdata_i (mem_wdata ),
.spm_be_i (mem_be ),
.spm_rdata_o (mem_rdata ),
/// SRAM Configuration
.impl_i (impl_l1d_data[j] )
);
data_t amo_rdata_local;
// TODO(zarubaf): Share atomic units between mutltiple cuts
snitch_amo_shim #(
.AddrMemWidth ( TCDMMemAddrWidth ),
.DataWidth ( DataWidth ),
.CoreIDWidth ( CoreIDWidth )
) i_amo_shim (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.valid_i (amo_req[j].q_valid ),
.ready_o (amo_rsp[j].q_ready ),
.addr_i (amo_req[j].q.addr ),
.write_i (amo_req[j].q.write ),
.wdata_i (amo_req[j].q.data ),
.wstrb_i (amo_req[j].q.strb ),
.core_id_i (amo_req[j].q.user.core_id ),
.is_core_i (amo_req[j].q.user.is_core ),
.rdata_o (amo_rdata_local ),
.amo_i (amo_req[j].q.amo ),
.mem_req_o (mem_cs ),
.mem_add_o (mem_add ),
.mem_wen_o (mem_wen ),
.mem_wdata_o (mem_wdata ),
.mem_be_o (mem_be ),
.mem_rdata_i (mem_rdata ),
.dma_access_i (sb_dma_req[i].q_valid ),
// TODO(zarubaf): Signal AMO conflict somewhere. Socregs?
.amo_conflict_o (/* Unused */ )
);
// Insert a pipeline register at the output of each SRAM.
shift_reg #(
.dtype(data_t ),
.Depth(int'(RegisterTCDMCuts))
) i_sram_pipe (
.clk_i (clk_i ),
.rst_ni(rst_ni ),
.d_i (amo_rdata_local ),
.d_o (amo_rsp[j].p.data)
);
// delay the req_id two cycles: 1 for bank access, 1 for reg
shift_reg #(
.dtype(tcdm_meta_t ),
.Depth(int'(RegisterTCDMCuts))
) i_reqid_pipe1 (
.clk_i (clk_i ),
.rst_ni(rst_ni ),
.d_i ({amo_req[j].q.user.req_id, amo_req[j].q.write}),
.d_o (mem_req_meta )
);
shift_reg #(
.dtype(tcdm_meta_t ),
.Depth(int'(RegisterTCDMCuts))
) i_reqid_pipe2 (
.clk_i (clk_i ),
.rst_ni(rst_ni ),
.d_i (mem_req_meta ),
.d_o ({amo_rsp[j].p.user.req_id, amo_rsp[j].p.write})
);
// tie unused field to 0
// TODO: remove these fields
assign amo_rsp[j].p.user.core_id = '0;
assign amo_rsp[j].p.user.is_core = '0;
end
end
logic [NrTCDMPortsCores-1:0] cache_pready;
assign spm_size = cfg_spm_size * L1Associativity * L1LineWidth / 2;
// split the requests for spm or cache from core side
spatz_addr_mapper #(
.NumIO (NrTCDMPortsCores ),
.AddrWidth (L1AddrWidth ),
.SPMAddrWidth (SPMAddrWidth ),
.DataWidth (DataWidth ),
.mem_req_t (tcdm_req_t ),
.mem_rsp_t (tcdm_rsp_t ),
.mem_rsp_chan_t (tcdm_rsp_chan_t ),
.spm_req_t (spm_req_t ),
.spm_rsp_t (spm_rsp_t )
) i_tcdm_mapper (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
// Input
.mem_req_i (tcdm_req ),
.mem_rsp_o (tcdm_rsp ),
.error_o (spm_error ),
// Address
.tcdm_start_address_i (tcdm_start_address[L1AddrWidth-1:0] ),
.tcdm_end_address_i (tcdm_end_address[L1AddrWidth-1:0] ),
.spm_size_i (spm_size ),
.flush_i (l1d_busy ),
// Output
.spm_req_o (spm_req ),
.spm_rsp_i (spm_rsp ),
.cache_req_o (cache_req ),
.cache_pready_o (cache_pready ),
.cache_rsp_i (cache_rsp )
);
for (genvar j = 0; j < NrTCDMPortsCores; j++) begin
assign cache_req_valid[j] = cache_req[j].q_valid;
assign cache_rsp_ready[j] = cache_pready[j];
assign cache_req_addr[j] = cache_req[j].q.addr;
assign cache_req_meta[j] = cache_req[j].q.user;
assign cache_req_write[j] = cache_req[j].q.write;
assign cache_req_data[j] = cache_req[j].q.data;
assign cache_rsp[j].p_valid = cache_rsp_valid[j];
assign cache_rsp[j].q_ready = cache_req_ready[j];
assign cache_rsp[j].p.data = cache_rsp_data[j];
assign cache_rsp[j].p.user = cache_rsp_meta[j];
assign cache_rsp[j].p.write = cache_rsp_write[j];
end
flamingo_spatz_cache_ctrl #(
// Core
.NumPorts (NrTCDMPortsCores ),
.CoalExtFactor (L1CoalFactor ),
.AddrWidth (L1AddrWidth ),
.WordWidth (DataWidth ),
// Cache
.NumCacheEntry (L1NumEntry ),
.CacheLineWidth (L1LineWidth ),
.SetAssociativity (L1Associativity ),
.BankFactor (L1BankFactor ),
// Type
.core_meta_t (tcdm_user_t ),
.impl_in_t (impl_in_t ),
.axi_req_t (axi_mst_dma_req_t ),
.axi_resp_t (axi_mst_dma_resp_t)
) i_l1_controller (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.impl_i (impl_l1d_fifo ),
// Sync Control
.cache_sync_valid_i (l1d_insn_valid ),
.cache_sync_ready_o (l1d_insn_ready ),
.cache_sync_insn_i (l1d_insn ),
// SPM Size
// The calculation of spm region in cache is different
// than other modules (needs to times 2)
.bank_depth_for_SPM_i ((cfg_spm_size<<1) ),
// Request
.core_req_valid_i (cache_req_valid ),
.core_req_ready_o (cache_req_ready ),
.core_req_addr_i (cache_req_addr ),
.core_req_meta_i (cache_req_meta ),
.core_req_write_i (cache_req_write ),
.core_req_wdata_i (cache_req_data ),
// Response
.core_resp_valid_o (cache_rsp_valid ),
.core_resp_ready_i (cache_rsp_ready ),
.core_resp_write_o (cache_rsp_write ),
.core_resp_data_o (cache_rsp_data ),
.core_resp_meta_o (cache_rsp_meta ),
// AXI refill
.axi_req_o (wide_axi_mst_req[DCache] ),
.axi_resp_i (wide_axi_mst_rsp[DCache] ),
// Tag Banks
.tcdm_tag_bank_req_o (l1_tag_bank_req ),
.tcdm_tag_bank_we_o (l1_tag_bank_we ),
.tcdm_tag_bank_addr_o (l1_tag_bank_addr ),
.tcdm_tag_bank_wdata_o (l1_tag_bank_wdata ),
.tcdm_tag_bank_be_o (l1_tag_bank_be ),
.tcdm_tag_bank_rdata_i (l1_tag_bank_rdata ),
// Data Banks
.tcdm_data_bank_req_o (l1_data_bank_req ),
.tcdm_data_bank_we_o (l1_data_bank_we ),
.tcdm_data_bank_addr_o (l1_data_bank_addr ),
.tcdm_data_bank_wdata_o(l1_data_bank_wdata ),
.tcdm_data_bank_be_o (l1_data_bank_be ),
.tcdm_data_bank_rdata_i(l1_data_bank_rdata ),
.tcdm_data_bank_gnt_i (l1_data_bank_gnt )
);
for (genvar j = 0; j < L1NumTagBank; j++) begin: gen_l1_tag_banks
tc_sram_impl #(
.NumWords (L1CacheWayEntry/L1BankFactor),
.DataWidth ($bits(data_t) ),
.ByteWidth ($bits(data_t) ),
.NumPorts (1 ),
.Latency (1 ),
.SimInit ("zeros" ),
.impl_in_t (impl_in_t )
) i_meta_bank (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.impl_i (impl_l1d_tag [j]),
.impl_o (/* unsed */ ),
.req_i (l1_tag_bank_req [j]),
.we_i (l1_tag_bank_we [j]),
.addr_i (l1_tag_bank_addr [j]),
.wdata_i(l1_tag_bank_wdata[j]),
.be_i (l1_tag_bank_be [j]),
.rdata_o(l1_tag_bank_rdata[j])
);
end
for (genvar i = 0; i < L1NumWrapper; i++) begin
for (genvar j = 0; j < L1Associativity*L1BankFactor; j++) begin
assign l1_cache_wp_req [i][j] = l1_data_bank_req [i + j*L1NumWrapper];
assign l1_cache_wp_we [i][j] = l1_data_bank_we [i + j*L1NumWrapper];
assign l1_cache_wp_addr [i][j] = l1_data_bank_addr [i + j*L1NumWrapper];
assign l1_cache_wp_wdata[i][j] = l1_data_bank_wdata[i + j*L1NumWrapper];
assign l1_cache_wp_be [i][j] = (l1_data_bank_be [i + j*L1NumWrapper]) ? {(NarrowDataWidth/8){1'b1}} : '0;
assign l1_data_bank_rdata[i + j*L1NumWrapper] = l1_cache_wp_rdata[i][j];
assign l1_data_bank_gnt [i + j*L1NumWrapper] = l1_cache_wp_gnt [i][j];
end
end
// We have multiple banks form a pesudo bank (BankWP)
spatz_tcdm_interconnect #(
.NumInp (NumTCDMIn ),
.NumOut (L1NumWrapper ),
.tcdm_req_t (spm_req_t ),
.tcdm_rsp_t (spm_rsp_t ),
.mem_req_t (mem_req_t ),
.mem_rsp_t (mem_rsp_t ),
.MemAddrWidth (TCDMMemAddrWidth ),
.DataWidth (DataWidth ),
.user_t (tcdm_user_t ),
.MemoryResponseLatency (1 + RegisterTCDMCuts)
) i_tcdm_interconnect (
.clk_i (clk_i ),
.rst_ni (rst_ni ),
.req_i ({axi_soc_req, spm_req} ),
.rsp_o ({axi_soc_rsp, spm_rsp} ),
.mem_req_o (ic_req ),
.mem_rsp_i (ic_rsp )
);
hive_req_t [NrCores-1:0] hive_req;
hive_rsp_t [NrCores-1:0] hive_rsp;
for (genvar i = 0; i < NrCores; i++) begin : gen_core
localparam int unsigned TcdmPorts = get_tcdm_ports(i);