PYNQ: PYTHON PRODUCTIVITY

Overlay Tutorial AddDriver doesn't work

I’m trying to create a driver by following the documentation Overlay Tutorial — Python productivity for Zynq (Pynq). I add a cell in my ipynb:

from pynq import DefaultIP

class AddDriver(DefaultIP):
    def __init__(self, description):
        super().__init__(description=description)

    bindto = ['xilinx.com:hls:add:1.0']

    def add(self, a, b):
        self.write(0x10, a)
        self.write(0x18, b)
        return self.read(0x20)

and reload the overlay I created before:

overlay = Overlay('/home/xilinx/pynq/overlays/hls_adder/pynq_adder.bit')
overlay?

However, IP Blocks scalar_add is still pynq.overlay.DefaultIP rather than __main__.AddDriver. And thus

overlay.scalar_add.add(15,20)

fails with AttributeError: ‘DefaultIP’ object has no attribute ‘add’. I tried to make a separate AddDriver.py file and import AddDriver, but overlay just still does not change. (Previous steps go properly)
Does anyone have any ideas? Thanks

Sorry I made a mistake. The VLNV parameter of my project is different.

1 Like

thanks,I make a same mistake!