chipsalliance / yosys-f4pga-plugins

Plugins for Yosys developed as part of the F4PGA project.
https://f4pga.org
Apache License 2.0
83 stars 46 forks source link

latest yosys: ast process_format_str() changed, plugin won't compile. #542

Open hzeller opened 10 months ago

hzeller commented 10 months ago

Looks like the new function is now called processFormat(). So the systemverilog plug--in will not compile with latest yosys from head as our local copy of simplify.cc uses that in two places. So probably some #ifdef of sorts needed to work with older and newer yosys-es.

wsipak commented 10 months ago

Thank you. We'll look into the details. Indeed it looks like #ifdefs are the way to go here.

hzeller commented 9 months ago

I'll create a duplicate in the new location.

tcal-x commented 6 months ago

Perhaps related to this, the latest plugins package doesn't work with the latest Yosys package (conda / litex-hub). We get a runtime error with the xdc and params plugins:

% plugin -i params
ERROR: Can't load module `./params': /home/tim/CFU-Playground/env/conda/envs/cfu-symbiflow/bin/../share/yosys/plugins/params.so: undefined symbol: _ZN5Yosys7stringfB5cxx11EPKcz
Yosys command produced an error
% plugin -i xdc
ERROR: Can't load module `./xdc': /home/tim/CFU-Playground/env/conda/envs/cfu-symbiflow/bin/../share/yosys/plugins/xdc.so: undefined symbol: _ZN5Yosys7stringfB5cxx11EPKcz
Yosys command produced an error

If I pin Yosys back at 0.33, it works (the latest is 0.36). I haven't determined precisely where this issue comes up.

Edit: I've found exactly where this issue comes up -- the jump to 0.34: Using litex-hub::yosys=0.33_11_g31ee566ec=20230724_080446_py37 works as before Using litex-hub::yosys=0.34_54_gd21c464ae=20230724_080446_py37 results in the undefined symbol error

hzeller commented 6 months ago

Yep, this should work in the new synlig plugin. Don't know who is maintaining the litex hub currently.

On NixOS/nix package manager, I have a relatively recent synlig and surelog if that helps

nix-shell -p surelog yosys yosys-synlig

surelog --version
VERSION: 1.80

yosys --version
Yosys 0.36 (git sha1 8f07a0d8404, gcc 12.3.0 -fPIC -Os)

yosys -p "plugin -i systemverilog; read_systemverilog foo.sv"