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

Explicit Yosys Plugin Handling #514

Closed
hpretl opened this issue Jul 17, 2024 · 7 comments
Closed

Explicit Yosys Plugin Handling #514

hpretl opened this issue Jul 17, 2024 · 7 comments
Labels
✨ enhancement New feature or request 📦 third-party packaging An issue with a third-party packaging mechanism
Milestone

Comments

@hpretl
Copy link
Collaborator

hpretl commented Jul 17, 2024

Description

A user tried to use the VHDL flow in OpenLane in our IIC-OSIC-TOOLS image, see iic-jku/IIC-OSIC-TOOLS#43.

The error is that the command ghdl is not working inside Yosys. If I start Yosys just by

> yosys

then running ghdl inside, it throws the error ERROR: No such command: ghdl (type 'help' for a command overview).

If I start Yosys with

> yosys -m ghdl

then running ghdl inside Yosys works fine!

Question: What is wrong with the OpenLane setup in our image?

Expected Behavior

VHDLClassic flow should work.

Environment report

Failed to get Docker info: [Errno 2] No such file or directory: 'docker'
Failed to get Nix info: [Errno 2] No such file or directory: 'nix'
kernel: Linux
kernel_version: 6.6.32-linuxkit
supported: True
distro: ubuntu
distro_version: 22.04
python_version: 3.10.12
python_path:
  - /usr/local/lib/python3.10/dist-packages/openlane
  - /headless/.local/lib/python3.10/site-packages
  - /usr/lib/python310.zip
  - /usr/lib/python3.10
  - /usr/lib/python3.10/lib-dynload
  - /usr/local/lib/python3.10/dist-packages
  - /usr/lib/python3/dist-packages
  - /usr/lib/python3.10/dist-packages
  - /foss/tools/ngspyce/154a272/local/lib/python3.10/dist-packages
  - /foss/tools/pyopus/0.11/local/lib/python3.10/dist-packages
  - /foss/tools/yosys/share/yosys/python3
  - /foss/tools/klayout/v0.29.4/pymod
tkinter: True
container_info: None
nix_info: None

Reproduction material

None needed.

Relevant log output

See above.
@hpretl
Copy link
Collaborator Author

hpretl commented Jul 17, 2024

@donn Maybe the above issue just boils down to the question: How is OpenLane calling yosys, and how do you load modules like ghdl?

@hpretl
Copy link
Collaborator Author

hpretl commented Jul 17, 2024

I don't understand nix, but it looks like there is some kind of wrapper involved? https://github.com/efabless/openlane2/blob/7691a45f4bbafc77ab70f30c22d9698d462e41c7/nix/yosys.nix

@donn
Copy link
Member

donn commented Jul 17, 2024

@hpretl That's correct. We wrap the Yosys binary to load the modules, including GHDL and Lighter (upstream Nixpkgs does this as well too.)

Something like this in place of the yosys binary should work:

#!/bin/sh
exec -a "$0" <path/to/yosys-bin> -m ghdl "$@"

@donn donn added ❓ question Further information is requested 💬 waiting on op This issue requires more information from its original creator 📦 third-party packaging An issue with a third-party packaging mechanism labels Jul 17, 2024
@hpretl
Copy link
Collaborator Author

hpretl commented Jul 22, 2024

We implemented now a wrapper similar to the above one in our IIC-OSIC-TOOLS. An alternative way, I think cleaner, is that OpenLane adapts the calling of yosys. Like using yosys for Verilog, or using yosys -m gdhl for VHDL, or yosys -m systemverilog.

Or just use yosys -m ghdl -m systemverilog in any case, if this modules are available.

@donn What do you think?

@donn
Copy link
Member

donn commented Jul 22, 2024

Doable- will think about it, I'm messing with Yosys stuff atm

@donn donn added ✨ enhancement New feature or request and removed ❓ question Further information is requested 💬 waiting on op This issue requires more information from its original creator labels Jul 22, 2024
@donn donn changed the title VHDL flow not working as ghdl not found inside yosys Explicit Yosys Plugin Handling Jul 22, 2024
@hpretl
Copy link
Collaborator Author

hpretl commented Jul 22, 2024

Please notify me when you change things because then I will remove the Yosys wrapper again :-)

@donn donn added this to the 2.2.0 milestone Sep 23, 2024
@donn
Copy link
Member

donn commented Sep 29, 2024

2.2.0 loads plugins explicitly, however, it introduces another issue because you need to pull in YosysHQ/yosys#4553 until it gets merged

Anyways, should be in the next release. Thank you for your patience

@donn donn closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 📦 third-party packaging An issue with a third-party packaging mechanism
Projects
None yet
Development

No branches or pull requests

2 participants