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

Yosys: configure_main should check for "file_type" in fileset, or provide a default #424

Open
Isweet opened this issue Apr 9, 2024 · 0 comments

Comments

@Isweet
Copy link

Isweet commented Apr 9, 2024

I'm trying to take an existing set of core files and perform setup with Yosys (fusesoc --cores-root=. run --setup --tool yosys ...), and I'm getting the following KeyError:

Traceback (most recent call last):
  File "/home/isweet/.local/bin/fusesoc", line 8, in <module>
    sys.exit(main())
  File "/home/isweet/.local/lib/python3.10/site-packages/fusesoc/main.py", line 835, in main
    fusesoc(args)
  File "/home/isweet/.local/lib/python3.10/site-packages/fusesoc/main.py", line 825, in fusesoc
    args.func(cm, args)
  File "/home/isweet/.local/lib/python3.10/site-packages/fusesoc/main.py", line 401, in run
    run_backend(
  File "/home/isweet/.local/lib/python3.10/site-packages/fusesoc/main.py", line 506, in run_backend
    backend.configure([])
  File "/home/isweet/.local/lib/python3.10/site-packages/edalize/edatool.py", line 198, in configure
    self.configure_main()
  File "/home/isweet/.local/lib/python3.10/site-packages/edalize/yosys.py", line 70, in configure_main
    if f["file_type"].startswith("verilogSource"):
KeyError: 'file_type'

I believe that edalize/yosys.py should have configure_main either check for this as an error condition explicitly, or provide a default like "". I patched this locally by instead calling self._get_fileset_files() but I'm not sure if that's correct. It correctly specifies a default, and allows file_type to be accessed as a field of File rather than by key in a map.

I recommend providing a default, since existing core files that are compatible with e.g. the Verilator backend do not always provide a file_type.

Let me know if you need any additional information, thanks!

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

1 participant