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 when loading old bitfiles with new nifpga-python #25

Closed
mmatthe opened this issue Sep 26, 2018 · 1 comment
Closed

Error when loading old bitfiles with new nifpga-python #25

mmatthe opened this issue Sep 26, 2018 · 1 comment

Comments

@mmatthe
Copy link

mmatthe commented Sep 26, 2018

Guys, it's great you finally added cluster/fixpoint support! Unfortunately, the changes break compatibility to older biltfiles:

Consider this bitfile (created with npfpga-v17): https://raw.githubusercontent.com/ewine-project/Flexible-GFDM-PHY/master/Builds/USRP-Bitfile-0026.lvbitx

with recent nifpga-python (pip install nifpga) one gets this error:

$ python -c "import nifpga; nifpga.Bitfile('USRP-Bitfile-0026.lvbitx')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/e2/lib/python3.7/site-packages/nifpga/bitfile.py", line 36, in __init__
    reg = Register(reg_xml)
  File "/tmp/e2/lib/python3.7/site-packages/nifpga/bitfile.py", line 598, in __init__
    self._type = _parse_type(list(datatype)[0])
  File "/tmp/e2/lib/python3.7/site-packages/nifpga/bitfile.py", line 114, in _parse_type
    return _FXP(name, type_xml)
  File "/tmp/e2/lib/python3.7/site-packages/nifpga/bitfile.py", line 384, in __init__
    self._signed = True if type_xml.find("Signed").text.lower() == 'true' else False
AttributeError: 'NoneType' object has no attribute 'text'
@strainmike
Copy link
Collaborator

Thanks for the bug report!

I've added a pull request that makes the Python API ignore registers and FIFOs that don't contain all of the metadata in the XML. So your bitfile will be usable again, but your session won't have access to any FXP types. If you are able to recompile your bitfile in newer versions of LabVIEW Communications (>=2.1) they will output the correct XML such that they are usable from the Python API.

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