Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add broadcast mode to DMA #425

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3a64725
external dma slots + interfaced fifo example
Oct 19, 2023
f802d4a
typo + copyright update + DMA driver symbols
Oct 19, 2023
2d74f5a
Merge branch 'esl-epfl:main' into main
grinningmosfet Oct 19, 2023
4e0265f
better warning in iffifo_gen.sh
Oct 19, 2023
80230dc
Merge branch 'main' of https://github.com/grinningmosfet/x-heep into …
Oct 19, 2023
a28b550
replace window interface by registers
Oct 20, 2023
e2ada1a
revert i2s, swap 0/1 by TX/RX, iffifo fifo instance typo
Oct 23, 2023
ad9da35
typo
Oct 23, 2023
895153c
swap fifo, adapt example
Oct 24, 2023
9678953
improve interrupts handling
Oct 24, 2023
906362e
status register + interrupts
Oct 25, 2023
192f13e
Merge branch 'esl-epfl:main' into main
grinningmosfet Oct 25, 2023
f15c86a
fix interrupts
Oct 28, 2023
22d02a4
typo
Oct 28, 2023
c79cba0
typos
Oct 28, 2023
eaa058e
merge examples
Oct 28, 2023
a6bb239
implement broadcast dma mode + typos
Oct 31, 2023
b93aa45
implement broadcast dma mode
Oct 31, 2023
f3e91f1
add broadcast destination pointer, increment and slots registers
Oct 31, 2023
9164cb8
add dma broadcast example
Oct 31, 2023
cc3579f
broadcast mode implementation
Nov 1, 2023
96e6f6d
Merge branch 'esl-epfl:main' into main
grinningmosfet Nov 1, 2023
2a8ed5d
Merge branch 'esl-epfl:main' into dma-broadcast
grinningmosfet Nov 1, 2023
7e001cd
Merge branch 'esl-epfl:main' into main
grinningmosfet Nov 20, 2023
998bb84
Merge branch 'esl-epfl:main' into dma-broadcast
grinningmosfet Nov 20, 2023
70c6e84
minor changes
Nov 20, 2023
a2d367d
fix dma indent
Nov 20, 2023
c6eebeb
minor changes
Nov 20, 2023
852292e
verible
Nov 20, 2023
74c16f9
typo
Nov 21, 2023
4cc540b
minor changes
Nov 22, 2023
24a09e1
typo
Nov 22, 2023
ab39ff5
Merge branch 'esl-epfl:main' into main
grinningmosfet Nov 22, 2023
6ba74ec
Merge pull request #2 from grinningmosfet/main
grinningmosfet Nov 22, 2023
64a5dc1
add non-word DU and broadcast tests
Nov 22, 2023
c0e687d
clean example
Nov 22, 2023
c3e8751
Merge branch 'esl-epfl:main' into dma-broadcast
grinningmosfet Nov 29, 2023
3b20b8e
code review: dma refactor
Nov 29, 2023
1ff00cc
minoor fixes
Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hw/core-v-mini-mcu/ao_peripheral_subsystem.sv
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ module ao_peripheral_subsystem

// EXTERNAL PERIPH
output reg_req_t ext_peripheral_slave_req_o,
input reg_rsp_t ext_peripheral_slave_resp_i
input reg_rsp_t ext_peripheral_slave_resp_i,

input logic ext_dma_slot_tx_i,
input logic ext_dma_slot_rx_i
);

import core_v_mini_mcu_pkg::*;
Expand Down Expand Up @@ -364,13 +367,15 @@ module ao_peripheral_subsystem
.intr_timer_expired_1_0_o(rv_timer_1_intr_o)
);

parameter DMA_TRIGGER_SLOT_NUM = 5;
parameter DMA_TRIGGER_SLOT_NUM = 7;
logic [DMA_TRIGGER_SLOT_NUM-1:0] dma_trigger_slots;
assign dma_trigger_slots[0] = spi_rx_valid;
assign dma_trigger_slots[1] = spi_tx_ready;
assign dma_trigger_slots[2] = spi_flash_rx_valid;
assign dma_trigger_slots[3] = spi_flash_tx_ready;
assign dma_trigger_slots[4] = i2s_rx_valid_i;
assign dma_trigger_slots[5] = ext_dma_slot_tx_i;
assign dma_trigger_slots[6] = ext_dma_slot_rx_i;

dma #(
.reg_req_t (reg_pkg::reg_req_t),
Expand Down
9 changes: 7 additions & 2 deletions hw/core-v-mini-mcu/core_v_mini_mcu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ module core_v_mini_mcu
output logic [EXT_DOMAINS_RND-1:0] external_ram_banks_set_retentive_no,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_clkgate_en_no,

output logic [31:0] exit_value_o
output logic [31:0] exit_value_o,

input logic ext_dma_slot_tx_i,
input logic ext_dma_slot_rx_i
);

import core_v_mini_mcu_pkg::*;
Expand Down Expand Up @@ -628,7 +631,9 @@ module core_v_mini_mcu
.uart_intr_rx_parity_err_o(uart_intr_rx_parity_err),
.i2s_rx_valid_i(i2s_rx_valid),
.ext_peripheral_slave_req_o,
.ext_peripheral_slave_resp_i
.ext_peripheral_slave_resp_i,
.ext_dma_slot_tx_i,
.ext_dma_slot_rx_i
);

peripheral_subsystem peripheral_subsystem_i (
Expand Down
9 changes: 7 additions & 2 deletions hw/core-v-mini-mcu/core_v_mini_mcu.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ ${pad.core_v_mini_mcu_interface}
output logic [EXT_DOMAINS_RND-1:0] external_ram_banks_set_retentive_no,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_clkgate_en_no,

output logic [31:0] exit_value_o
output logic [31:0] exit_value_o,

input logic ext_dma_slot_tx_i,
input logic ext_dma_slot_rx_i
);

import core_v_mini_mcu_pkg::*;
Expand Down Expand Up @@ -380,7 +383,9 @@ ${pad.core_v_mini_mcu_interface}
.uart_intr_rx_parity_err_o(uart_intr_rx_parity_err),
.i2s_rx_valid_i(i2s_rx_valid),
.ext_peripheral_slave_req_o,
.ext_peripheral_slave_resp_i
.ext_peripheral_slave_resp_i,
.ext_dma_slot_tx_i,
.ext_dma_slot_rx_i
);

peripheral_subsystem peripheral_subsystem_i (
Expand Down
4 changes: 3 additions & 1 deletion hw/fpga/xilinx_core_v_mini_mcu_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ module xilinx_core_v_mini_mcu_wrapper
.pdm2pcm_pdm_io,
.i2s_sck_io(i2s_sck_io),
.i2s_ws_io(i2s_ws_io),
.i2s_sd_io(i2s_sd_io)
.i2s_sd_io(i2s_sd_io),
.ext_dma_slot_tx_i,
.ext_dma_slot_rx_i,
);

assign exit_value_o = exit_value[0];
Expand Down
30 changes: 30 additions & 0 deletions hw/ip/dma/data/dma.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
{ bits: "31:0", name: "PTR_OUT", desc: "Output data pointer (word aligned)" }
]
},
{ name: "DST_BCST_PTR",
desc: "Broadcast output data pointer (word aligned)",
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "31:0", name: "PTR_OUT", desc: "Output data pointer (word aligned)" }
grinningmosfet marked this conversation as resolved.
Show resolved Hide resolved
]
},
{ name: "ADDR_PTR",
desc: "Addess data pointer (word aligned)",
swaccess: "rw",
Expand Down Expand Up @@ -68,6 +76,11 @@
name: "DST_PTR_INC",
desc: "Destination pointer increment",
resval:4
},
{ bits: "23:16",
name: "BCST_PTR_INC",
desc: "Broadcast pointer increment",
resval:4
}
]
},
Expand All @@ -87,6 +100,22 @@
}
]
},
{ name: "BSLOT",
desc: '''The DMA will wait for the signal
connected to the selected trigger_slots to be high
on the read and write side respectivly''',
swaccess: "rw",
hwaccess: "hro",
resval: 0,
fields: [
{ bits: "15:0", name: "BX_TRIGGER_SLOT",
desc: "Broadcast slot selection mask"
},
{ bits: "31:16", name: "DX_TRIGGER_SLOT",
desc: "Dummy slot selection mask"
}
]
},
{ name: "DATA_TYPE",
desc: '''Width/type of the data to transfer''',
swaccess: "rw",
Expand Down Expand Up @@ -115,6 +144,7 @@
{ value: "0", name: "LINEAR_MODE", desc: "Transfers data linearly"},
{ value: "1", name: "CIRCULAR_MODE", desc: "Transfers data in circular mode"},
{ value: "2", name: "ADDRESS_MODE" , desc: "Transfers data using as destination address the data from ADD_PTR"},
{ value: "3", name: "BROADCAST_MODE" , desc: "Equivalent to LINEAR_MODE but writing at two destinations simultaneously"},
]
}
]
Expand Down
Loading
Loading