# Error loading bitstream to PYNQ. AttributeError: 'NoneType' object has no attribute 'get'

**URL:** <https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716>\
**Category:** Support\
**Created:** [June 1, 2021, 9:43pm UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716 "2021-06-01T21:43:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rass](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rass/32/1882_2.png) [@rass](https://discuss.pynq.io/u/rass)\
**Post date:** [June 1, 2021, 9:43pm UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/1 "2021-06-01T21:43:35Z")

</div>

Hello !  
I have been trying to implement a 1dfilter HLS core found in [these tutorials](https://github.com/drichmond/PYNQ-HLS/tree/master/tutorial/notebooks/stream), the [HLS code is provided](https://github.com/drichmond/PYNQ-HLS/blob/master/tutorial/notebooks/stream/2-Creating-A-Vivado-HLS-Core.ipynb) and synthesizes just fine.  
Followed [the details of the Block Design](https://github.com/drichmond/PYNQ-HLS/blob/master/tutorial/notebooks/stream/3-Building-A-Bitstream.ipynb), and the bitstream tcl and hwh files are generated fine.  
here is what my BlockDesign looks like :  
[DeployFiliter.pdf](https://discuss.pynq.io/uploads/short-url/s7LmL5wzohKPPSN9TIMO3qCdLMm.pdf) (93.5 KB)  
here are my HWH and TCL files :  
[DeployFiliter.hwh](https://discuss.pynq.io/uploads/short-url/yI03QzFTQIC0p8YDOInYfhw2zyv.hwh) (442.8 KB)  
[DeployFiliter.tcl](https://discuss.pynq.io/uploads/short-url/3UuWss4Z8KMf9Oxb1zJm8N8dj9D.tcl) (29.5 KB)

But i am getting an error while trying to load my bitstream to PYNQ ([following this tutorial](https://github.com/drichmond/PYNQ-HLS/blob/master/tutorial/notebooks/stream/4-Using-an-HLS-core-in-PYNQ.ipynb)).  
using Vivado 2020.1 on a PYNQ v2.6

What i tried :  
The same error was already posted [here](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491) and i tried checking the suggested solution (looking at the size of interrupts and concatenating them), but mine seemed already fine. So it didn’t work for me.

Tried removing the interrupt parts all together from the block Design, and i am still getting the same exact error while loading the bistream in the PYNQ.

Tried not using the streamOverlay() helper function they used in the [tutorial](https://github.com/drichmond/PYNQ-HLS/blob/master/tutorial/notebooks/stream/4-Using-an-HLS-core-in-PYNQ.ipynb) and using the usual Overlay() one, they both gave the same output below.

```auto
from pynq import Overlay
overlay=Overlay('/home/xilinx/pynq/overlays/stream/stream.bit')

```

```auto
AttributeError Traceback (most recent call last)
<ipython-input-4-caa847768b6d> in <module>()
      1 from pynq import Overlay
----> 2 overlay=Overlay('/home/xilinx/pynq/overlays/stream/stream.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 am running out of ideas (because am still new at all of this, thanks to the very nice people who already help me all the time in this forum.

---

<div class="post-metadata">

**Author:** ![mizan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/mizan/32/2119_2.png) [@mizan](https://discuss.pynq.io/u/mizan)\
**Post date:** [June 2, 2021, 5:11am UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/2 "2021-06-02T05:11:41Z")

</div>

I was facing the same problem. Have you used the Interrupt controller in between ps and concat? Mine was solved using interrupt controller as following:  
all interrupts lines → Concat → Axi interrupt controller → Concat → PS.  
(assuming you have not mistakenly forgotten about placing the HWH file along with the bitstream)

Edit: I haven’t changed any configuration in AXI interrupt controller. Seems like you might have changed.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 2, 2021, 6:04am UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/3 "2021-06-02T06:04:57Z")

</div>

I think this may be an issue with the HWH parsing and the PS GPIO because you only have a single output pin. The HWH parser expects a “DIN\_FROM” expression, but the GPIO description in the HWH may be in a different format. Could you post your HWH?

One workaround may be to use a slice block between the PS GPIO and the port you want to connect the wire to.  
However, I notice you have two reset blocks in this design. You may be testing your design, but you shouldn’t need to have that separate reset block with the PS GPIO to control it. If you remove one block and remove the PS GPIO that is being used as a reset then I think the issue will go away.

Cathal

---

<div class="post-metadata">

**Author:** ![rass](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rass/32/1882_2.png) [@rass](https://discuss.pynq.io/u/rass)\
**Post date:** [June 2, 2021, 10:34am UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/4 "2021-06-02T10:34:56Z")

</div>

Hi ! and thank you for your answer,  
Here is my TCL and HWH, (i will also add it to the OP).

[DeployFiliter.tcl](https://discuss.pynq.io/uploads/short-url/3UuWss4Z8KMf9Oxb1zJm8N8dj9D.tcl) (29.5 KB)  
[DeployFiliter.hwh](https://discuss.pynq.io/uploads/short-url/yI03QzFTQIC0p8YDOInYfhw2zyv.hwh) (442.8 KB)

I will try using a slice and remove the PS GPIO parts and come back with the feedback tonight.

---

<div class="post-metadata">

**Author:** ![rass](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rass/32/1882_2.png) [@rass](https://discuss.pynq.io/u/rass)\
**Post date:** [June 2, 2021, 10:38am UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/5 "2021-06-02T10:38:45Z")

</div>

Hi, Yes i did change some things in the interrupt controller (switched it from being controlled by LEVEL to Edge), both gave the same results.  
from what i got, your issue was that the interrupt going in the PS was size [0:2], making it [0:0] after a concat solved it.  
Thanks again for taking the time to answer me !

---

<div class="post-metadata">

**Author:** ![rass](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rass/32/1882_2.png) [@rass](https://discuss.pynq.io/u/rass)\
**Post date:** [June 3, 2021, 7:08pm UTC](https://discuss.pynq.io/t/error-loading-bitstream-to-pynq-attributeerror-nonetype-object-has-no-attribute-get/2716/6 "2021-06-03T19:08:52Z")

</div>

> [@cathalmccabe](#):
>
> slice block

Hi !  
Using a Slice between the GPIO and the reset ports (where i was taking it to) solved my problems.

I would really love to know the thought process behind adding a slice there because i just moronically applied what you suggested i would never have guessed it by myself.

thanks again for everything @cathalmccabe .
