KeyError loading XRT overlay with AXI streams

HI,

I’m compiling a complex set of kernels for U280/XRT. Some kernels are connected to others with AXI streams.

When i load my XCLBIN I get thefollowing error. Am I doing something wrong?

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-5-6e67ed172bb5> in <module>
----> 1 ol=pynq.Overlay(xclbin)

/data/craco/ban115/pynq-example/venv/lib/python3.6/site-packages/pynq/overlay.py in __init__(self, bitfile_name, dtbo, download, ignore_version, device)
    328         super().__init__(bitfile_name, dtbo, partial=False, device=device)
    329 
--> 330         self.parser = self.device.get_bitfile_metadata(self.bitfile_name)
    331 
    332         self.ip_dict = self.gpio_dict = self.interrupt_controllers = \

/data/craco/ban115/pynq-example/venv/lib/python3.6/site-packages/pynq/pl_server/xrt_device.py in get_bitfile_metadata(self, bitfile_name)
    531     def get_bitfile_metadata(self, bitfile_name):
    532         from .xclbin_parser import XclBin
--> 533         return XclBin(bitfile_name)
    534 
    535     def get_exec_bo(self, size=1024):

/data/craco/ban115/pynq-example/venv/lib/python3.6/site-packages/pynq/pl_server/xclbin_parser.py in __init__(self, filename)
    286     """
    287     def __init__(self, filename):
--> 288         self.ip_dict, self.mem_dict = _xclbin_to_dicts(filename)
    289         self.gpio_dict = {}
    290         self.interrupt_controllers = {}

/data/craco/ban115/pynq-example/venv/lib/python3.6/site-packages/pynq/pl_server/xclbin_parser.py in _xclbin_to_dicts(filename)
    237     ip_dict = _xclxml_to_ip_dict(
    238         sections[xclbin.AXLF_SECTION_KIND.EMBEDDED_METADATA].decode(),
--> 239         xclbin_uuid)
    240     ip_layout = xclbin.ip_layout.from_buffer(
    241         sections[xclbin.AXLF_SECTION_KIND.IP_LAYOUT])

/data/craco/ban115/pynq-example/venv/lib/python3.6/site-packages/pynq/pl_server/xclbin_parser.py in _xclxml_to_ip_dict(raw_xml, xclbin_uuid)
    142                 streams[attrib['name']] = {
    143                     'id': int(attrib['id']),
--> 144                     'type': attrib['type'],
    145                     'direction': direction
    146                 }

KeyError: 'type'



1 Like

This looks like a gap in the way we handle xclbin files. Would you be able to share a representative example so we can look into fixing it in the next release?

Thanks Peter. XCLBIN that causes the failure is here:

Hi @Keith_Bannister,

How are you creating these kernels? The type attribute is expected as part of the streams metadata

https://www.xilinx.com/html_docs/xilinx2021_1/vitis_doc/package_xo.html#ariaid-title2

In this PR, the type attribute is optional, you can apply it to your pynq package to workaround the error.

Mario

1 Like