Skip to content

Commit c5e62fa

Browse files
thommythomasoLucia Luzi
and
Lucia Luzi
committed
idma: Streamline TCDM connection, enable multi-channel operation
--------- Co-authored-by: Lucia Luzi <luzil@ethz.ch>
1 parent 48aebb1 commit c5e62fa

File tree

13 files changed

+349
-77
lines changed

13 files changed

+349
-77
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "sw/deps/riscv-opcodes"]
22
path = sw/deps/riscv-opcodes
3-
url = git@github.com:pulp-platform/riscv-opcodes.git
3+
url = https://github.com/LuziLucia/riscv-opcodes.git
44
[submodule "sw/deps/printf"]
55
path = sw/deps/printf
66
url = https://github.com/mpaland/printf.git

Bender.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ packages:
7171
dependencies:
7272
- common_cells
7373
idma:
74-
revision: ff5d56fffb3767814db88d6bf8f381974ea33aa5
75-
version: 0.6.4
74+
revision: d7ad14b31e82e50c2973a70400ccc460f3f617f4
75+
version: null
7676
source:
7777
Git: https://github.com/pulp-platform/iDMA
7878
dependencies:

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, version: 0.6.4 }
30+
idma: { git: https://github.com/pulp-platform/iDMA, rev: d7ad14b31e82e50c2973a70400ccc460f3f617f4 }
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
@@ -327,6 +327,7 @@ package riscv_instr;
327327
localparam logic [31:0] DMSTAT = 32'b0000101?????00000000?????0101011;
328328
localparam logic [31:0] DMSTR = 32'b0000110??????????000000000101011;
329329
localparam logic [31:0] DMREP = 32'b000011100000?????000000000101011;
330+
localparam logic [31:0] DMINIT = 32'b0001000??????????000?????0101011;
330331
localparam logic [31:0] FREP_O = 32'b????????????????????????10001011;
331332
localparam logic [31:0] FREP_I = 32'b????????????????????????00001011;
332333
localparam logic [31:0] IREP = 32'b?????????????????????????0111111;

hw/snitch/src/snitch.sv

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

hw/snitch/src/snitch_pkg.sv

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

138138
// Slaves on Cluster DMA AXI Bus
139139
typedef enum int unsigned {
140-
TCDMDMA = 0,
141-
SoCDMAOut = 1,
142-
ZeroMemory = 2,
143-
BootRom = 3
140+
SoCDMAOut = 0,
141+
BootRom = 1
144142
} cluster_slave_dma_e;
145143

144+
typedef enum logic {
145+
TCDMDMA = 0,
146+
ToSoC = 1
147+
} dma_e;
148+
146149
typedef enum int unsigned {
147-
SoCDMAIn = 32'd0,
148-
SDMAMst = 32'd1,
149-
ICache = 32'd2
150+
SDMAMst = 32'd0,
151+
ICache = 32'd1
150152
} cluster_master_dma_e;
151153

152154
/// 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,
@@ -115,7 +123,8 @@ module snitch_cc #(
115123
/// Derived parameter *Do not override*
116124
parameter int unsigned TCDMPorts = (NumSsrs > 1 ? NumSsrs : 1),
117125
parameter type addr_t = logic [AddrWidth-1:0],
118-
parameter type data_t = logic [DataWidth-1:0]
126+
parameter type data_t = logic [DataWidth-1:0],
127+
parameter type addr_rule_t = axi_pkg::xbar_rule_64_t
119128
) (
120129
input logic clk_i,
121130
input logic clk_d2_i,
@@ -136,14 +145,18 @@ module snitch_cc #(
136145
// DMA ports
137146
output axi_req_t [DMANumChannels-1:0] axi_dma_req_o,
138147
input axi_rsp_t [DMANumChannels-1:0] axi_dma_res_i,
148+
output obi_req_t [DMANumChannels-1:0] obi_dma_req_o,
149+
input obi_rsp_t [DMANumChannels-1:0] obi_dma_res_i,
139150
output logic [DMANumChannels-1:0] axi_dma_busy_o,
140151
output dma_events_t [DMANumChannels-1:0] axi_dma_events_o,
141152
// Core event strobes
142153
output snitch_pkg::core_events_t core_events_o,
143154
input addr_t tcdm_addr_base_i,
144155
// Cluster HW barrier
145156
output logic barrier_o,
146-
input logic barrier_i
157+
input logic barrier_i,
158+
// address decode map
159+
input addr_rule_t [TCDMAliasEnable:0] dma_addr_rule_i
147160
);
148161

149162
// FMA architecture is "merged" -> mulexp and macexp instructions are supported
@@ -390,20 +403,32 @@ module snitch_cc #(
390403
.NumAxInFlight (DMANumAxInFlight),
391404
.DMAReqFifoDepth (DMAReqFifoDepth),
392405
.NumChannels (DMANumChannels),
406+
.TCDMAliasEnable (TCDMAliasEnable),
393407
.DMATracing (1),
394408
.axi_ar_chan_t (axi_ar_chan_t),
395409
.axi_aw_chan_t (axi_aw_chan_t),
396410
.axi_req_t (axi_req_t),
397411
.axi_res_t (axi_rsp_t),
412+
.init_req_chan_t (init_req_chan_t),
413+
.init_rsp_chan_t (init_rsp_chan_t),
414+
.init_req_t (init_req_t),
415+
.init_rsp_t (init_rsp_t),
416+
.obi_a_chan_t (obi_a_chan_t),
417+
.obi_r_chan_t (obi_r_chan_t),
418+
.obi_req_t (obi_req_t),
419+
.obi_res_t (obi_rsp_t),
398420
.acc_req_t (acc_req_t),
399421
.acc_res_t (acc_resp_t),
400-
.dma_events_t (dma_events_t)
422+
.dma_events_t (dma_events_t),
423+
.addr_rule_t (addr_rule_t)
401424
) i_idma_inst64_top (
402425
.clk_i,
403426
.rst_ni,
404427
.testmode_i ( 1'b0 ),
405428
.axi_req_o ( axi_dma_req_o ),
406429
.axi_res_i ( axi_dma_res_i ),
430+
.obi_req_o ( obi_dma_req_o ),
431+
.obi_res_i ( obi_dma_res_i ),
407432
.busy_o ( axi_dma_busy_o ),
408433
.acc_req_i ( acc_snitch_req ),
409434
.acc_req_valid_i ( dma_qvalid ),
@@ -412,7 +437,8 @@ module snitch_cc #(
412437
.acc_res_valid_o ( dma_pvalid ),
413438
.acc_res_ready_i ( dma_pready ),
414439
.hart_id_i ( hart_id_i ),
415-
.events_o ( axi_dma_events_o )
440+
.events_o ( axi_dma_events_o ),
441+
.addr_map_i ( dma_addr_rule_i )
416442
);
417443

418444
// no DMA instanciated

0 commit comments

Comments
 (0)