neorv32-setups icon indicating copy to clipboard operation
neorv32-setups copied to clipboard

GHDL module is missing from the Yosys command line

Open CyberFox001 opened this issue 4 months ago • 7 comments

Hello,

First, tank you for these great examples.

While I was trying to run the command to build a minimal with boot example for the ULX3S, with the open source workflow, I got this error message:

ERROR: No such command: ghdl (type 'help' for a command overview)

My command was:

make BOARD=ULX3S MinimalBoot      

And the Yosys command run by Make was:

yosys  \
  -p \
  "ghdl --std=08 --workdir=build -Pbuild --no-formal neorv32_ULX3S_BoardTop_MinimalBoot; \
   synth_ecp5 \
  -top neorv32_ULX3S_BoardTop_MinimalBoot  \
  -json neorv32_ULX3S_MinimalBoot.json" 2>&1 | tee yosys-report.txt

When I look into the makefile synthesis.mk for the Yosys command, I see that there is a YOSYSFLAGS that, in the file common.mk, can contain the -m flag if the variable GHDL_PLUGIN_MODULE is defined. But this variable is never defined and the README don't talk about it.

It's maybe a bug, or a missing documentation about how to use this variable.

Have a nice day.

CyberFox001 avatar Jul 28 '25 03:07 CyberFox001

I am having a similar issue trying to run make BOARD=iCE40CW312 MinimalBoot

yosys  \
          -p \
          "ghdl --std=08 --workdir=build -Pbuild --no-formal neorv32_iCE40CW312_BoardTop_MinimalBoot; \
           synth_ice40 \
          -top neorv32_iCE40CW312_BoardTop_MinimalBoot -dsp \
          -json neorv32_iCE40CW312_MinimalBoot.json" 2>&1 | tee yosys-report.txt
ERROR: No such command: ghdl (type 'help' for a command overview)
nextpnr-ice40 \
          --up5k --package uwg30 --ignore-loops --timing-allow-fail \
          --pcf ../constraints/board/iCE40CW312/constraints.pcf \
          --json neorv32_iCE40CW312_MinimalBoot.json \
          --asc neorv32_iCE40CW312_MinimalBoot.asc 2>&1 | tee nextpnr-report.txt
ERROR: Failed to open JSON file 'neorv32_iCE40CW312_MinimalBoot.json'.
0 warnings, 1 error
icepack neorv32_iCE40CW312_MinimalBoot.asc neorv32_iCE40CW312_MinimalBoot.bit
Error: Failed to open input file.
make[3]: *** [neorv32_iCE40CW312_MinimalBoot.bit] Error 1
make[2]: *** [run] Error 2
make[1]: *** [iCE40CW312] Error 2
make: *** [MinimalBoot] Error 2

patrick-gould avatar Jul 29 '25 17:07 patrick-gould

It's been a while since we set this up here... As far as I can remember, there are two possible ways to use Yosys with VHDL sources:

  • Yosys with the [GHDL plugin)(https://github.com/ghdl/ghdl-yosys-plugin) (i.e. `yosys -m ...)
  • Yosys with a script that calls an "external" GHDL: https://github.com/stnolting/neorv32-setups/blob/681bf96499035937e0d260c7d9eaaa323303dbd7/cologne_chip/GateMateA1-EVB/Makefile#L43

How did you setup Yosys? Are you using the version from the provided container, or did you install/compile it yourself?

Maybe @Unike267 (our Yosys expert) can help out?

stnolting avatar Jul 29 '25 18:07 stnolting

@stnolting For now, I have installed Yosys from the OSS CAD Suite.

But when I have time to, I would like to switch to the Guix package manager to install Yosys and the GHDL plugin.

Both options provide Yosys and its GHDL plugin. I usually load it with the option `-m ghdl' of Yosys.

CyberFox001 avatar Jul 30 '25 02:07 CyberFox001

I have never worked with the OSS CAD suite myself - it's still on my to-do list.

I usually load it with the option `-m ghdl' of Yosys.

That's exactly what we do, and it actually works without any problems:

https://github.com/stnolting/neorv32-setups/blob/d258c86fb4c7e00b2cbb3596a063eb6afcf38cc2/osflow/common.mk#L19-L21

I am having a similar issue trying to run make BOARD=iCE40CW312 MinimalBoot

I need to try that again locally on my computer...

stnolting avatar Aug 09 '25 09:08 stnolting

That's exactly what we do, and it actually works without any problems:

neorv32-setups/osflow/common.mk

Lines 19 to 21 in d258c86 ifdef GHDL_PLUGIN_MODULE YOSYSFLAGS += -m $(GHDL_PLUGIN_MODULE) endif

Yes, but you need to specify GHDL_PLUGIN_MODULE=ghdl in your make command. And the README from the osflow directory didn't say it.

CyberFox001 avatar Aug 10 '25 03:08 CyberFox001

I still don't understand (again) why the flow still works for me locally. 🤔

And the README from the osflow directory didn't say it.

Do you have any suggestions on how to improve this? 😉

stnolting avatar Aug 12 '25 20:08 stnolting

Do you have any suggestions on how to improve this? 😉

I see 2 possibility:

  • Explicitly tell in the README that user need to set GHDL_PLUGIN_MODULE in its make command
  • In the makefiles, set the value of GHDL_PLUGIN_MODULE to ghdl by default

In the second case, it could be nice to add some words about GHDL_PLUGIN_MODULE in the README. Because some users could need to tell Yosys the full bath to the ghdl module. As described in the GHDL plugin README: https://github.com/ghdl/ghdl-yosys-plugin

CyberFox001 avatar Aug 12 '25 20:08 CyberFox001