Skip to content

Commit 272f1c8

Browse files
thommythomasoLucia Luzi
andcommitted
idma: Streamline TCDM connection, enable multi-channel operation
--------- Co-authored-by: Lucia Luzi <[email protected]>
1 parent 5b2fccd commit 272f1c8

File tree

11 files changed

+276
-60
lines changed

11 files changed

+276
-60
lines changed

Bender.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ packages:
7171
dependencies:
7272
- common_cells
7373
idma:
74-
revision: 7829f71691a62c1e2e5e3230f370f222c7a83087
74+
revision: 9e352db1b70bc87e88670e1ef359aa3fd8bad5f6
7575
version: null
7676
source:
7777
Git: https://github.com/pulp-platform/iDMA.git

Bender.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
tech_cells_generic: { git: https://github.com/pulp-platform/tech_cells_generic, version: 0.2.13 }
2828
riscv-dbg: { git: https://github.com/pulp-platform/riscv-dbg, version: 0.8.0 }
2929
cluster_icache: { git: https://github.com/pulp-platform/cluster_icache.git, rev: 64e21ae455bbdde850c4df13bef86ea55ac42537 }
30-
idma: { git: https://github.com/pulp-platform/iDMA.git, rev: __deploy__bebefa3__master }
30+
idma: { git: https://github.com/pulp-platform/iDMA, rev: 9e352db1b70bc87e88670e1ef359aa3fd8bad5f6 }
3131

3232
export_include_dirs:
3333
- hw/reqrsp_interface/include
@@ -79,6 +79,7 @@ sources:
7979
- hw/tcdm_interface/src/tcdm_interface.sv
8080
# Level 1
8181
- hw/tcdm_interface/src/axi_to_tcdm.sv
82+
- hw/tcdm_interface/src/obi_to_tcdm.sv
8283
- hw/tcdm_interface/src/reqrsp_to_tcdm.sv
8384
- hw/tcdm_interface/src/tcdm_mux.sv
8485
- target: simulation

hw/snitch/src/riscv_instr.sv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ package riscv_instr;
328328
localparam logic [31:0] DMSTR = 32'b0000110??????????000000000101011;
329329
localparam logic [31:0] DMREP = 32'b000011100000?????000000000101011;
330330
localparam logic [31:0] DMMCAST = 32'b000100000000?????000000000101011;
331+
localparam logic [31:0] DMINIT = 32'b0001001??????????000?????0101011;
331332
localparam logic [31:0] FREP_O = 32'b????????????????????????10001011;
332333
localparam logic [31:0] IREP = 32'b?????????????????????????0111111;
333334
localparam logic [31:0] SCFGRI = 32'b????????????00000001?????0101011;

hw/snitch/src/snitch.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,8 @@ module snitch import snitch_pkg::*; import riscv_instr::*; #(
21632163
illegal_inst = 1'b1;
21642164
end
21652165
end
2166-
DMCPYI: begin
2166+
DMCPYI,
2167+
DMINIT: begin
21672168
if (Xdma) begin
21682169
acc_qreq_o.addr = DMA_SS;
21692170
opa_select = Reg;

hw/snitch/src/snitch_pkg.sv

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,18 @@ package snitch_pkg;
141141

142142
// Slaves on Cluster DMA AXI Bus
143143
typedef enum int unsigned {
144-
TCDMDMA = 0,
145-
SoCDMAOut = 1,
146-
ZeroMemory = 2,
147-
BootRom = 3
144+
SoCDMAOut = 0,
145+
BootRom = 1
148146
} cluster_slave_dma_e;
149147

148+
typedef enum logic {
149+
TCDMDMA = 0,
150+
ToSoC = 1
151+
} dma_e;
152+
150153
typedef enum int unsigned {
151-
SoCDMAIn = 32'd0,
152-
SDMAMst = 32'd1,
153-
ICache = 32'd2
154+
SDMAMst = 32'd0,
155+
ICache = 32'd1
154156
} cluster_master_dma_e;
155157

156158
/// Possible interconnect implementations.

hw/snitch_cluster/src/snitch_cc.sv

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ module snitch_cc #(
4040
parameter type axi_aw_chan_t = logic,
4141
parameter type axi_req_t = logic,
4242
parameter type axi_rsp_t = logic,
43+
parameter type init_req_chan_t = logic,
44+
parameter type init_rsp_chan_t = logic,
45+
parameter type init_req_t = logic,
46+
parameter type init_rsp_t = logic,
47+
parameter type obi_a_chan_t = logic,
48+
parameter type obi_r_chan_t = logic,
49+
parameter type obi_req_t = logic,
50+
parameter type obi_rsp_t = logic,
4351
parameter type hive_req_t = logic,
4452
parameter type hive_rsp_t = logic,
4553
parameter type acc_req_t = logic,
@@ -116,7 +124,8 @@ module snitch_cc #(
116124
/// Derived parameter *Do not override*
117125
parameter int unsigned TCDMPorts = (NumSsrs > 1 ? NumSsrs : 1),
118126
parameter type addr_t = logic [AddrWidth-1:0],
119-
parameter type data_t = logic [DataWidth-1:0]
127+
parameter type data_t = logic [DataWidth-1:0],
128+
parameter type addr_rule_t = axi_pkg::xbar_rule_64_t
120129
) (
121130
input logic clk_i,
122131
input logic clk_d2_i,
@@ -137,14 +146,18 @@ module snitch_cc #(
137146
// DMA ports
138147
output axi_req_t [DMANumChannels-1:0] axi_dma_req_o,
139148
input axi_rsp_t [DMANumChannels-1:0] axi_dma_res_i,
149+
output obi_req_t [DMANumChannels-1:0] obi_dma_req_o,
150+
input obi_rsp_t [DMANumChannels-1:0] obi_dma_res_i,
140151
output logic [DMANumChannels-1:0] axi_dma_busy_o,
141152
output dma_events_t [DMANumChannels-1:0] axi_dma_events_o,
142153
// Core event strobes
143154
output snitch_pkg::core_events_t core_events_o,
144155
input addr_t tcdm_addr_base_i,
145156
// Cluster HW barrier
146157
output logic barrier_o,
147-
input logic barrier_i
158+
input logic barrier_i,
159+
// address decode map
160+
input addr_rule_t [TCDMAliasEnable:0] dma_addr_rule_i
148161
);
149162

150163
// FMA architecture is "merged" -> mulexp and macexp instructions are supported
@@ -391,20 +404,32 @@ module snitch_cc #(
391404
.NumAxInFlight (DMANumAxInFlight),
392405
.DMAReqFifoDepth (DMAReqFifoDepth),
393406
.NumChannels (DMANumChannels),
407+
.TCDMAliasEnable (TCDMAliasEnable),
394408
.DMATracing (1),
395409
.axi_ar_chan_t (axi_ar_chan_t),
396410
.axi_aw_chan_t (axi_aw_chan_t),
397411
.axi_req_t (axi_req_t),
398412
.axi_res_t (axi_rsp_t),
413+
.init_req_chan_t (init_req_chan_t),
414+
.init_rsp_chan_t (init_rsp_chan_t),
415+
.init_req_t (init_req_t),
416+
.init_rsp_t (init_rsp_t),
417+
.obi_a_chan_t (obi_a_chan_t),
418+
.obi_r_chan_t (obi_r_chan_t),
419+
.obi_req_t (obi_req_t),
420+
.obi_res_t (obi_rsp_t),
399421
.acc_req_t (acc_req_t),
400422
.acc_res_t (acc_resp_t),
401-
.dma_events_t (dma_events_t)
423+
.dma_events_t (dma_events_t),
424+
.addr_rule_t (addr_rule_t)
402425
) i_idma_inst64_top (
403426
.clk_i,
404427
.rst_ni,
405428
.testmode_i ( 1'b0 ),
406429
.axi_req_o ( axi_dma_req_o ),
407430
.axi_res_i ( axi_dma_res_i ),
431+
.obi_req_o ( obi_dma_req_o ),
432+
.obi_res_i ( obi_dma_res_i ),
408433
.busy_o ( axi_dma_busy_o ),
409434
.acc_req_i ( acc_snitch_req ),
410435
.acc_req_valid_i ( dma_qvalid ),
@@ -413,7 +438,8 @@ module snitch_cc #(
413438
.acc_res_valid_o ( dma_pvalid ),
414439
.acc_res_ready_i ( dma_pready ),
415440
.hart_id_i ( hart_id_i ),
416-
.events_o ( axi_dma_events_o )
441+
.events_o ( axi_dma_events_o ),
442+
.addr_map_i ( dma_addr_rule_i )
417443
);
418444

419445
// no DMA instanciated

0 commit comments

Comments
 (0)