PYNQ: PYTHON PRODUCTIVITY

How to access the DMA in the module

Hello,

DMA is encapsulated in a module in BD in Vivado, as shown in the figure below:

How do I access this DMA in PYNQ2.5? I tried the following, but the following error was reported without success

Firstly, I tried zmod_adc0 = zmod_adc1410.ZmodADC_0/axi_dma_0

zmod_adc0 = zmod_adc1410.ZmodADC_0/axi_dma_0

NameError                                 Traceback (most recent call last)
<ipython-input-33-6a53782c002e> in <module>()
----> 1 zmod_adc0 = zmod_adc1410.ZmodADC_0/axi_dma_0

NameError: name 'axi_dma_0' is not defined

Secondly, I tried zmod_adc0 = zmod_adc1410.ZmodADC_0.axi_dma_0

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-34-f990120a1269> in <module>()
----> 1 zmod_adc0 = zmod_adc1410.ZmodADC_0.axi_dma_0

/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __getattr__(self, key)
    735         elif key in self._description['ip']:
    736             ipdescription = self._description['ip'][key]
--> 737             driver = ipdescription['driver'](ipdescription)
    738             setattr(self, key, driver)
    739             return driver

/usr/local/lib/python3.6/dist-packages/pynq/lib/dma.py in __init__(self, description, *args, **kwargs)
    188                                'has been deprecated and moved to '
    189                                'pynq.lib.deprecated')
--> 190         super().__init__(description=description)
    191 
    192         if 'parameters' in description and \

/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __init__(self, description)
    600             self._gpio = {}
    601         for interrupt, details in self._interrupts.items():
--> 602             setattr(self, interrupt, Interrupt(details['fullpath']))
    603         for gpio, entry in self._gpio.items():
    604             gpio_number = GPIO.get_gpio_pin(entry['index'])

/usr/local/lib/python3.6/dist-packages/pynq/interrupt.py in __init__(self, pinname)
     96         self.number = PL.interrupt_pins[pinname]['index']
     97         self.parent = weakref.ref(
---> 98             _InterruptController.get_controller(parentname))
     99         self.event = asyncio.Event()
    100         self.waiting = False

/usr/local/lib/python3.6/dist-packages/pynq/interrupt.py in get_controller(name)
    157             if con.name == name:
    158                 return con
--> 159         ret = _InterruptController(name)
    160         _InterruptController._controllers.append(ret)
    161         return ret

/usr/local/lib/python3.6/dist-packages/pynq/interrupt.py in __init__(self, name)
    175         """
    176         self.name = name
--> 177         self.mmio = MMIO(PL.ip_dict[name]['phys_addr'], 32)
    178         self.wait_handles = [[] for _ in range(32)]
    179         self.event_number = 0

KeyError: ''

Thank you very much. :face_with_monocle:

Hello,
The problem has been solved, not because of this module, because I used the DMA IP interrupt but did not add the corresponding terminal controller, which caused an error.
image

Hey, sazc!
How did you manage to add ZMOD support to device-tree overlay?
Is it working for you? I’m thinking about creating ZMOD binding with Pybind for PYNQ, or just manual way like you do :slight_smile:

No device tree is added, just through the standard AXI interface.