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

CacheMetadataError when loading overlay #1

Open
rderi opened this issue Dec 8, 2023 · 1 comment
Open

CacheMetadataError when loading overlay #1

rderi opened this issue Dec 8, 2023 · 1 comment

Comments

@rderi
Copy link

rderi commented Dec 8, 2023

I have been trying to run the emulator on my PYNQ-Z2 board, but before the overlay loads, I keep encountering the same CacheMetadataError. I am using this repository for a class project, and I would really appreciate some help troubleshooting. The program's output is:

[2022-10-22 03:55:53,880][INFO] Loading Pynq libraries...
[2022-10-22 03:56:03,622][INFO] Finished loading Pynq libraries
[2022-10-22 03:56:04,176][INFO] Loading overlay...
[2022-10-22 03:56:04,190][DEBUG] Using selector: EpollSelector
Traceback (most recent call last):
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 252, in get_parser
    parser = self._get_cache() 
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 228, in _get_cache
    raise CacheMetadataError(f"No cached metadata present")
pynq.pl_server.embedded_device.CacheMetadataError: No cached metadata present

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/xilinx/final/gameboy_ps/__main__.py", line 17, in <module>
    system = system.System(rom_directory)
  File "/home/xilinx/final/gameboy_ps/system.py", line 15, in __init__
    self.gameboy = Gameboy()
  File "/home/xilinx/final/gameboy_ps/gameboy.py", line 72, in __init__
    self.overlay = Overlay(str(overlay_path))
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 319, in __init__
    self.device.set_bitfile_name(self.bitfile_name)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py", line 118, in set_bitfile_name
    self.parser = self.get_bitfile_metadata(self.bitfile_name)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 690, in get_bitfile_metadata
    parser = _get_bitstream_handler(bitfile_name).get_parser(partial=partial)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 254, in get_parser
    parser = RuntimeMetadataParser(Metadata(input=self._filepath.with_suffix(".hwh")))
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/metadata.py", line 40, in Metadata
    return HwhFrontend(_hwhfile=input)
  File "<string>", line 25, in __init__
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/hwh_frontend.py", line 219, in __post_init__
    self.parse()
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/hwh_frontend.py", line 240, in parse
    self.resolve_addressing()
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/hwh_frontend.py", line 596, in resolve_addressing
    self._resolve_subordinate_addressing()
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/hwh_frontend.py", line 452, in _resolve_subordinate_addressing
    core = self.blocks[i.get("INSTANCE")]
KeyError: 'M_AXI_0'

Additional info:

  • Using v3.0.1 of the PYNQ-Z2 SD card image
  • Using the precompiled bitstream
  • Tested with multiple ROM files
  • Followed set-up instructions: moved gameboy.bit and gameboy.hwh to gameboy_ps/resources; loaded xpad and joydev drivers from the repo's extra directory; installed required Python packages
@elipsitz
Copy link
Owner

elipsitz commented Dec 8, 2023

Oh, this sounds familiar. I think the Pynq libraries distributed with v3.0.1 are slightly outdated.

I’m pretty sure you need this commit: Xilinx/PYNQ-Metadata@d67f1bf

You can try temporarily modifying /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynqmetadata/frontends/hwh_frontend.py with the changes and see if that fixes it. And then if it does, do a proper pip install from that repo. Let me know if that works, and I can update the instructions. Hopefully I didn’t have to make any other changes to the Pynq libraries, but I’ll try to see.

Out of curiosity, what’s the class project?

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