PYNQ: PYTHON PRODUCTIVITY

Can't load bitstream: 'NoneType' object has no attribute 'get'

Hi!

I’m having a hard time loading my design in PYNQ. I’m using PYNQ-Z2 with the v2.6 image, and Vivado 2020.1 on Ubuntu 18.04.

This is my block design. It works fine with my baremetal application.
bd.pdf (47.7 KB)

I have copied the BIT file, and the HWH from the hw_handoff folder. I tried using the TCL from the hw_handoff folder and from the Export Block Design utility, but both give the same results. (Which one should I use?)

My load code:

from pynq import Overlay
overlay = Overlay("hw/hdmi.bit")

Gives this output:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-eec68108e766> in <module>()
      1 from pynq import Overlay
----> 2 overlay = Overlay("hw/hdmi.bit")

/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __init__(self, bitfile_name, dtbo, download, ignore_version, device)
    339         self._register_drivers()
    340 
--> 341         self.parser = self.device.get_bitfile_metadata(self.bitfile_name)
    342 
    343         self.ip_dict = self.gpio_dict = self.interrupt_controllers = \

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in get_bitfile_metadata(self, bitfile_name)
    777         hwh_path = get_hwh_name(bitfile_name)
    778         if os.path.exists(hwh_path):
--> 779             return HWH(hwh_path)
    780         else:
    781             raise ValueError("Cannot find HWH file for {}.".format(

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/hwh_parser.py in __init__(self, hwh_name)
    197         self.match_ports()
    198         self.match_pins()
--> 199         self.add_gpio()
    200         self.init_interrupts()
    201         self.init_mem_dict()

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/hwh_parser.py in add_gpio(self)
    444                     self.ps_name, self.family_gpio))
    445             if mod is not None:
--> 446                 din = int(mod.find(".//*[@NAME='DIN_FROM']").get('VALUE'))
    447                 for p in mod.iter("PORT"):
    448                     if p.get('DIR') == 'O':

AttributeError: 'NoneType' object has no attribute 'get'

I have also tried to make a basic design like this: simple_bd.png
This one loads fine, but for some reason I can’t flash the leds using MMIO. The board_btns_leds example works though, so the board shouldn’t be faulty.

For the first problem, could you post the HWH?

@rock this seems to be a problem parsing the HWH. Do you know if this is related to the GPIO or maybe the interrupt and can you see anything wrong in the block diagram?

For the second problem (simple_bd.png), did you check LEDs are connected properly in Vivado?
Could you post the Python code you are using to change the GPIO?

Cathal

Hi @ksstms,

For the first problem, it seems that the interrupt is the issue.

PYNQ does not support more that one interrupt connected to IRQ_F2P, you need to use an AXI Interrupt Controller

You can concatenate the interrupts to the intr pin in the AXI Interrupt Controller

Mario

1 Like

@marioruiz Thank you very much. Now it works.

@cathalmccabe The second problem. Never mind, I checked it with an ILA, and realized that I have messed up the tristate config. :man_facepalming:

Thanks for the fast replies guys! You are great!