@@ -218,9 +218,9 @@ module snitch_cluster
218218 // / Derived parameters
219219 localparam int unsigned TCDMSize = NrBanks * TCDMDepth * (NarrowDataWidth/ 8 ),
220220 localparam int unsigned TCDMAddrWidth = $clog2 (TCDMSize),
221- localparam type dca_req_t = `DCA_REQ_STRUCT (DataWidth ),
222- localparam type dca_rsp_t = `DCA_RSP_STRUCT (DataWidth)
223- localparam type tcdm_dma_req_t = `TCDM_REQ_STRUCT (WideDataWidth, TCDMAddrWidth, logic ),
221+ localparam type dca_req_t = `DCA_REQ_STRUCT (DcaDataWidth ),
222+ localparam type dca_rsp_t = `DCA_RSP_STRUCT (DcaDataWidth),
223+ localparam type tcdm_dma_req_t = `TCDM_REQ_STRUCT (WideDataWidth, TCDMAddrWidth, 1 ),
224224 localparam type tcdm_dma_rsp_t = `TCDM_RSP_STRUCT (WideDataWidth)
225225) (
226226 // / System clock. If `IsoCrossing` is enabled this port is the _fast_ clock.
@@ -319,6 +319,11 @@ module snitch_cluster
319319 localparam int unsigned NrSuperBanks = NrBanks / BanksPerSuperBank;
320320 localparam int unsigned DcaLaneDataWidth = NarrowDataWidth;
321321
322+ // tcdm_user_t contains the following fields:
323+ // [CoreIDWidth:1] core_id
324+ // [0:0] is_core
325+ localparam int unsigned TcdmUserWidth = CoreIDWidth + 1 ;
326+
322327 function automatic int unsigned get_tcdm_ports (int unsigned core);
323328 return (NumSsrs[core] > 1 ? NumSsrs[core] : 1 );
324329 endfunction
@@ -464,12 +469,7 @@ module snitch_cluster
464469 typedef logic [CollectiveWidth- 1 : 0 ] collective_op_t ;
465470 typedef logic [AtomicIdWidth- 1 : 0 ] atomic_id_t ;
466471
467- // Struct replaced by logic array to workaround Questa optimization bug.
468- // typedef struct packed {
469- // logic [CoreIDWidth-1:0] core_id;
470- // bit is_core;
471- // } tcdm_user_t;
472- typedef logic [CoreIDWidth: 0 ] tcdm_user_t ;
472+ typedef logic [TcdmUserWidth- 1 : 0 ] tcdm_user_t ;
473473
474474 // Regbus peripherals.
475475 `AXI_TYPEDEF_ALL (axi_mst, addr_t, id_mst_t, data_t, strb_t, snitch_cluster_pkg :: user_narrow_t)
@@ -490,7 +490,7 @@ module snitch_cluster
490490 `MEM_TYPEDEF_ALL (mem, tcdm_mem_addr_t, data_t, strb_t, tcdm_user_t)
491491 `MEM_TYPEDEF_ALL (mem_dma, tcdm_mem_addr_t, data_dma_t, strb_dma_t, logic )
492492
493- `TCDM_TYPEDEF_ALL (tcdm, NarrowDataWidth, TCDMAddrWidth, tcdm_user_t )
493+ `TCDM_TYPEDEF_ALL (tcdm, NarrowDataWidth, TCDMAddrWidth, TcdmUserWidth )
494494
495495 // Define dca_lane_req_t and dca_lane_rsp_t
496496 `DCA_TYPEDEF_ALL (dca_lane, DcaLaneDataWidth)
@@ -824,7 +824,6 @@ module snitch_cluster
824824 .NumHyperBanks (NrHyperBanks),
825825 .mem_req_t (mem_dma_req_t),
826826 .mem_rsp_t (mem_dma_rsp_t),
827- .user_t (logic),
828827 .TcdmAddrWidth (TCDMAddrWidth),
829828 .MemAddrWidth (TCDMMemAddrWidth),
830829 .DataWidth (WideDataWidth),
@@ -844,7 +843,6 @@ module snitch_cluster
844843 .NumHyperBanks (NrHyperBanks),
845844 .mem_req_t (mem_dma_req_t),
846845 .mem_rsp_t (mem_dma_rsp_t),
847- .user_t (logic),
848846 .TcdmAddrWidth (TCDMAddrWidth),
849847 .MemAddrWidth (TCDMMemAddrWidth),
850848 .DataWidth (WideDataWidth),
@@ -962,7 +960,7 @@ module snitch_cluster
962960 .TcdmAddrWidth (TCDMAddrWidth),
963961 .MemAddrWidth (TCDMMemAddrWidth),
964962 .DataWidth (NarrowDataWidth),
965- .user_t (tcdm_user_t ),
963+ .UserWidth (TcdmUserWidth ),
966964 .MemoryResponseLatency (1 + RegisterTCDMCuts),
967965 .Radix (Radix),
968966 .Topology (Topology),
@@ -1047,6 +1045,7 @@ module snitch_cluster
10471045 snitch_cc # (
10481046 .AddrWidth (PhysicalAddrWidth),
10491047 .DataWidth (NarrowDataWidth),
1048+ .TcdmUserWidth (TcdmUserWidth),
10501049 .DMADataWidth (WideDataWidth),
10511050 .DMAIdWidth (WideIdWidthIn),
10521051 .DMAUserWidth (WideUserWidth),
@@ -1058,7 +1057,6 @@ module snitch_cluster
10581057 .drsp_t (reqrsp_rsp_t),
10591058 .tcdm_req_t (tcdm_req_t),
10601059 .tcdm_rsp_t (tcdm_rsp_t),
1061- .tcdm_user_t (tcdm_user_t),
10621060 .axi_ar_chan_t (axi_mst_dma_ar_chan_t),
10631061 .axi_aw_chan_t (axi_mst_dma_aw_chan_t),
10641062 .axi_req_t (axi_mst_dma_req_t),
@@ -1473,8 +1471,7 @@ module snitch_cluster
14731471 .AddrWidth (PhysicalAddrWidth),
14741472 .DataWidth (NarrowDataWidth),
14751473 .IdWidth (NarrowIdWidthOut),
1476- // TODO(colluca): this is fragile as it depends on the tcdm_user_t definition
1477- .UserWidth (CoreIDWidth + 1 ),
1474+ .UserWidth (TcdmUserWidth),
14781475 .BufDepth (MemoryMacroLatency + 1 )
14791476 ) i_axi_to_tcdm (
14801477 .clk_i,
0 commit comments