Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error registering CU with 64b arguments #1345

Closed
quetric opened this issue Mar 4, 2022 · 2 comments
Closed

Error registering CU with 64b arguments #1345

quetric opened this issue Mar 4, 2022 · 2 comments

Comments

@quetric
Copy link

quetric commented Mar 4, 2022

  • PYNQ version: 2.7
  • Board name: Alveo U280
  • XRT version: 2.13.399
  • Description: When getting a handle to a CU with 64b unsigned int arguments, pynq fails with KeyError: 'unsigned long long' in _create_call of overlay.py. The error can be worked around by adding 'unsigned long long': 'Q', to the _struct_dict.
@mariodruiz
Copy link
Collaborator

For completeness, let me add the full trace

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-5-a0166a429a82> in <module>
----> 1 ol.hostctrl_0

/scratch/anaconda3/envs/pynq/lib/python3.7/site-packages/pynq/overlay.py in __getattr__(self, key)
    364         """
    365         if self.is_loaded():
--> 366             return getattr(self._ip_map, key)
    367         else:
    368             raise RuntimeError("Overlay not currently loaded")

/scratch/anaconda3/envs/pynq/lib/python3.7/site-packages/pynq/overlay.py in __getattr__(self, key)
    876             ipdescription = self._description['ip'][key]
    877             try:
--> 878                 driver = ipdescription['driver'](ipdescription)
    879             except UnsupportedConfiguration as e:
    880                 warnings.warn(

/scratch/anaconda3/envs/pynq/lib/python3.7/site-packages/pynq/overlay.py in __init__(self, description)
    693                     self.device.has_capability('CALLABLE')):
    694                 self._signature, struct_string, self._ptr_list, self.args = \
--> 695                     _create_call(self._registers)
    696                 self._call_struct = struct.Struct(struct_string)
    697                 self._ctrl_reg = True

/scratch/anaconda3/envs/pynq/lib/python3.7/site-packages/pynq/overlay.py in _create_call(regmap)
    615             ptr_type = True
    616         else:
--> 617             struct_string += _struct_dict[v['type']]
    618             ptr_type = False
    619         if k != 'CTRL':

KeyError: 'unsigned long long'

@mariodruiz
Copy link
Collaborator

We may need to review the datatypes in the _struct_dict https://github.com/Xilinx/PYNQ/blob/master/pynq/overlay.py#L561-L581

As some of them seem not to be correct C datatypes https://en.wikipedia.org/wiki/C_data_types. For instance,
'long long unsigned int': 'Q' should be 'unsigned long long': 'Q' which is your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants