Commit 4aa94f09 authored by Federico Vaga's avatar Federico Vaga

tst: add a DMA write and read-back test

Signed-off-by: Federico Vaga's avatarFederico Vaga <>
parent fe1b5c53
......@@ -66,3 +66,20 @@ class TestDma(object):
spec.dma_write(0, b"\x00" * dma_size)
@pytest.mark.parametrize("dma_offset", [0x0])
[2**i for i in range(3, 22)])
def test_dma(self, spec, dma_offset, dma_size):
Write and read back buffers using DMA.
data = bytes([random.randrange(0, 0xFF, 1) for i in range(dma_size)])
spec.dma_write(dma_offset, data)
data_rb = spec.dma_read(dma_offset, dma_size)
assert data == data_rb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment