Hi there,
I am trying to run a toy example for AXI DMA on PYNQ-Z1.
I use a simple AXI4-Stream DATA FIFO with the DMA, so that I receive in the PS what I send.
I tried 4 different topologies, and none of them worked for me:
-
In the first trial (1.pdf (62.5 KB) ), I used the simple DMA mode (Direct Register Mode) without any interrupt. In this case, dma.sendchannel.wait() hangs forever.
-
In the second trial (2.pdf (70.4 KB) ), I used the same topology. However, The DMA is in the Scatter-Gather Mode without any interrupt. Same thing; dma.sendchannel.wait() hangs forever.
-
In the third trial (3.pdf (98.5 KB) ), I enabled the interrupt on PS, and connected both mm2s_introut and s2mm_introut from AXI DMA to the IRQ_F2P of the PS using a concat block. In this case, I got the following error even before I reach dma.sendchannel.wait()
Traceback (most recent call last):
File âFIFO_BUFFER.pyâ, line 11, in
dma = FIFO.axi_dma_0
File â/usr/local/lib/python3.6/dist-packages/pynq/overlay.pyâ, line 327, in getattr
return getattr(self._ip_map, key)
File â/usr/local/lib/python3.6/dist-packages/pynq/overlay.pyâ, line 585, in getattr
driver = ipdescriptionâdriverâ
File â/usr/local/lib/python3.6/dist-packages/pynq/lib/dma.pyâ, line 190, in init
super().init(description=description)
File â/usr/local/lib/python3.6/dist-packages/pynq/overlay.pyâ, line 517, in init
setattr(self, interrupt, Interrupt(details[âfullpathâ]))
File â/usr/local/lib/python3.6/dist-packages/pynq/interrupt.pyâ, line 98, in init
_InterruptController.get_controller(parentname))
File â/usr/local/lib/python3.6/dist-packages/pynq/interrupt.pyâ, line 159, in get_controller
ret = _InterruptController(name)
File â/usr/local/lib/python3.6/dist-packages/pynq/interrupt.pyâ, line 177, in init
self.mmio = MMIO(PL.ip_dict[name][âphys_addrâ], 32)
KeyError: ââ
- I solved this error by moving to the fourth trial (4.pdf (78.5 KB) ) in which I use an AXI Interrupt Controller to connect the concat block with IRQ_F2P in PS. In this case, the same old symptom showed up again: dma.sendchannel.wait() hangs forever !
I use Vivado 2019.2 for system integration.
The following Python code runs on PS:
import numpy
from pynq import Xlnk
from pynq import Overlay
from pynq import MMIO
FIFO = Overlay('fifo_buffer.bit')
#FIFO.download()
dma = FIFO.axi_dma_0
SIZE = 2
xlnk = Xlnk()
input_buffer = xlnk.cma_array(shape=(SIZE,), dtype=numpy.uint32)
output_buffer = xlnk.cma_array(shape=(SIZE,), dtype=numpy.uint32)
input_range = numpy.arange(SIZE, dtype=numpy.uint32)
for i in range(SIZE):
input_buffer[i] = i
import time
start_time = time.time()
print('finished copying')
dma.sendchannel.transfer(input_buffer)
print('finished sendchannel.transfer')
dma.recvchannel.transfer(output_buffer)
print('finished recvchannel.transfer')
dma.sendchannel.wait()
print('finished sendchannel.wait()')
dma.recvchannel.wait()
print('finished recvchannel.wait()')
stop_time = time.time()
hw_exec_time = stop_time-start_time
print('Hardware Execution Time: ', hw_exec_time)
data_out = numpy.copy(output_buffer)
print(data_out)
input_buffer.close()
output_buffer.close()
Even I tried to set the device to xc7z020clg400-1 and to set the board to PYNQ-Z1 but no chance.
Any Idea on how to make this implementation work?
Thanks !