Skip to content

Commit 6cdc55e

Browse files
committed
hw: Clean typedef definition
Move definition of `init_req_chan_t`, `init_rsp_chan_t`, `init_req_t`, and `init_rsp_t` from `snitch_cluster` to `snitch_cc`. This simplifies the CC parameter list and makes the RTL less redundant.
1 parent e19dd15 commit 6cdc55e

2 files changed

Lines changed: 25 additions & 32 deletions

File tree

hw/snitch_cc/src/snitch_cc.sv

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ module snitch_cc
3737
parameter type axi_aw_chan_t = logic,
3838
parameter type axi_req_t = logic,
3939
parameter type axi_rsp_t = logic,
40-
parameter type init_req_chan_t = logic,
41-
parameter type init_rsp_chan_t = logic,
42-
parameter type init_req_t = logic,
43-
parameter type init_rsp_t = logic,
4440
parameter type obi_a_chan_t = logic,
4541
parameter type obi_r_chan_t = logic,
4642
parameter type obi_req_t = logic,
@@ -206,6 +202,31 @@ module snitch_cc
206202
// Define acc_req_t, acc_rsp_t, acc_req_chan_t and acc_rsp_chan_t
207203
`SNITCH_ACC_TYPEDEF_ALL(DataWidth, AddrWidth)
208204

205+
// Define init_req_chan_t and init_rsp_chan_t
206+
typedef struct packed {
207+
logic [AddrWidth-1:0] cfg;
208+
logic [DMADataWidth-1:0] term;
209+
logic [DMADataWidth/8-1:0] strb;
210+
logic [DMAIdWidth-1:0] id;
211+
} init_req_chan_t;
212+
213+
typedef struct packed {
214+
logic [DMADataWidth-1:0] init;
215+
} init_rsp_chan_t;
216+
217+
// Define init_req_t and init_rsp_t
218+
typedef struct packed {
219+
init_req_chan_t req_chan;
220+
logic req_valid;
221+
logic rsp_ready;
222+
} init_req_t;
223+
224+
typedef struct packed {
225+
init_rsp_chan_t rsp_chan;
226+
logic rsp_valid;
227+
logic req_ready;
228+
} init_rsp_t;
229+
209230
// Accelerator offload interface
210231
acc_req_t snitch_acc_req;
211232
acc_rsp_t snitch_acc_rsp;

hw/snitch_cluster/src/snitch_cluster.sv

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -567,30 +567,6 @@ module snitch_cluster
567567
// Define dca_lane_req_t and dca_lane_rsp_t
568568
`DCA_TYPEDEF_ALL(dca_lane, DcaLaneWidth)
569569

570-
// Memory Init typedefs
571-
typedef struct packed {
572-
logic [PhysicalAddrWidth-1:0] cfg;
573-
logic [WideDataWidth-1:0] term;
574-
logic [WideDataWidth/8-1:0] strb;
575-
logic [WideIdWidthIn-1:0] id;
576-
} init_req_chan_t;
577-
578-
typedef struct packed {
579-
init_req_chan_t req_chan;
580-
logic req_valid;
581-
logic rsp_ready;
582-
} init_req_t;
583-
584-
typedef struct packed {
585-
logic [WideDataWidth-1:0] init;
586-
} init_rsp_chan_t;
587-
588-
typedef struct packed {
589-
init_rsp_chan_t rsp_chan;
590-
logic rsp_valid;
591-
logic req_ready;
592-
} init_rsp_t;
593-
594570
// OBI typedefs
595571
`OBI_TYPEDEF_MINIMAL_A_OPTIONAL(a_opt_t)
596572
`OBI_TYPEDEF_MINIMAL_R_OPTIONAL(r_opt_t)
@@ -1247,10 +1223,6 @@ module snitch_cluster
12471223
.axi_aw_chan_t (axi_mst_dma_aw_chan_t),
12481224
.axi_req_t (axi_mst_dma_req_t),
12491225
.axi_rsp_t (axi_mst_dma_resp_t),
1250-
.init_req_chan_t (init_req_chan_t),
1251-
.init_rsp_chan_t (init_rsp_chan_t),
1252-
.init_req_t (init_req_t),
1253-
.init_rsp_t (init_rsp_t),
12541226
.obi_a_chan_t (obi_a_chan_t),
12551227
.obi_r_chan_t (obi_r_chan_t),
12561228
.obi_req_t (obi_dma_req_t),

0 commit comments

Comments
 (0)