Spicing up the first and only EU FPGA chip with a flashy new board, loaded with a suite of engaging demos and examples. https://www.chili-chips.xyz/open-cologne
When you download and extract cc-toolchain-linux (tested on Linux; untested on Windows but likely the same), you get examples and tools such as yosys, p_r, and openFPGALoader. Running make synth_vhdl for examples like Blinky completes without issues. However, using the paths to yosys (from the extracted folder) in a different directory results in the following error:
warning: ieee library directory '../../bin/yosys/share/ghdl/ieee/v93/' not found
error: cannot find "std" library
This error occurs because the library path is relative, restricting the use of the tools to the cc-toolchain-linux folder. It should be clarified that if users wish to use yosys separately, they need to build it from source and set its path in the Makefile accordingly.
Following the GateMate Toolchain Installation Guide for yosys, ghdl, and ghdl-yosys-plugin, it is advisable to use the following commands for make and sudo make install for the ghdl-yosys-plugin to ensure it points to the correct GHDL installation executable. A colleague encountered an issue where sudo make install didn't place the ghdl.so plugin in /usr/local/share/yosys/plugins/, and the commands below resolved it:
git clone https://github.com/ghdl/ghdl-yosys-plugin.git
cd ghdl-yosys-plugin
make GHDL=/usr/local/bin/ghdl
sudo make GHDL=/usr/local/bin/ghdl install
Issue 3: Adding -m ghdl to synth_vhdl
After installing yosys, ghdl, and ghdl-yosys-plugin from source and adding them to your Makefile, running the command make synth_vhdl results in the following error:
Error: No such command ghdl(type 'help' for a command overview)
This problem is fixed by adding -m ghdl to the synth_vhdl command as follows:
The -m ghdl flag ensures that the ghdl-yosys-plugin, which can be seen here, is correctly loaded. Running just yosys in your terminal and then running ghdl will give the same error, but running yosys -m ghdl will recognize the command. For example, running help ghdl in the yosys command terminal after yosys -m ghdl provides the following:
yosys> help ghdl
ghdl [options] unit [arch]
Elaborate the already analyzed unit design and import it
ghdl [options] files... -e [unit]
Analyse files, elaborate unit and import it
If unit is not specified, it is automatically found
Full list of options are described in ghdl documentation.
--std=(93|08)
set the vhdl standard.
-C
allow UTF-8 in comments.
--ieee=synopsys
allow use of ieee.std_logic_arith.
-fpsl
parse PSL in comments.
--top-name=hash
use hash to encode the top entity name
It should be clarified in the Makefile/Toolchain Installation guide that -m ghdl is required as explained above. Additionally, it is advisable to include a step to test if the ghdl-yosys-plugin is correctly installed by running the command yosys -m ghdl as described for added assurance.
A question, out of curiosity, how did you make it work without the -m ghdl flag in your workspace?
Summary
To use make synth_vhdl command in your own workspace you need to:
This installation assumes that everything is install in /usr/local/, if you want to change your yosys installation path for instance you need to use ./configure --prefix=<path/to/yosys/installation/you/want>
git clone https://github.com/ghdl/ghdl-yosys-plugin.git
cd ghdl-yosys-plugin
make GHDL=/usr/local/bin/ghdl -j$(nproc)
sudo make GHDL=/usr/local/bin/ghdl install
Check that in your yosys install directory, in this case usr/local/share/yosys/plugins there is ghdl.so
Check yosys, ghdl, ghdl-yosys-plugin installation from terminal using which yosys, which ghdl and yosys -m ghdl commands respectively, all independent from another.
Change the synth_vhdl command
You need to add -m ghdl to the synth_vhdl command like this:
Issue 1: Relative Paths in
cc-toolchain-linux
When you download and extract
cc-toolchain-linux
(tested on Linux; untested on Windows but likely the same), you get examples and tools such asyosys
,p_r
, andopenFPGALoader
. Runningmake synth_vhdl
for examples like Blinky completes without issues. However, using the paths toyosys
(from the extracted folder) in a different directory results in the following error:This error occurs because the library path is relative, restricting the use of the tools to the
cc-toolchain-linux
folder. It should be clarified that if users wish to useyosys
separately, they need to build it from source and set its path in the Makefile accordingly.Issue 2:
ghdl-yosys-plugin
Installation InstructionsFollowing the GateMate Toolchain Installation Guide for yosys, ghdl, and ghdl-yosys-plugin, it is advisable to use the following commands for make and sudo make install for the ghdl-yosys-plugin to ensure it points to the correct GHDL installation executable. A colleague encountered an issue where sudo make install didn't place the
ghdl.so
plugin in/usr/local/share/yosys/plugins/
, and the commands below resolved it:Issue 3: Adding
-m ghdl
tosynth_vhdl
After installing
yosys
,ghdl
, andghdl-yosys-plugin
from source and adding them to your Makefile, running the commandmake synth_vhdl
results in the following error:This problem is fixed by adding -m ghdl to the synth_vhdl command as follows:
The
-m ghdl
flag ensures that the ghdl-yosys-plugin, which can be seen here, is correctly loaded. Running justyosys
in your terminal and then runningghdl
will give the same error, but runningyosys -m ghdl
will recognize the command. For example, runninghelp ghdl
in theyosys
command terminal afteryosys -m ghdl
provides the following:It should be clarified in the Makefile/Toolchain Installation guide that
-m ghdl
is required as explained above. Additionally, it is advisable to include a step to test if theghdl-yosys-plugin
is correctly installed by running the commandyosys -m ghdl
as described for added assurance. A question, out of curiosity, how did you make it work without the-m ghdl
flag in your workspace?Summary
To use
make synth_vhdl
command in your own workspace you need to: This installation assumes that everything is install in/usr/local/
, if you want to change your yosys installation path for instance you need to use./configure --prefix=<path/to/yosys/installation/you/want>
Install yosys
Install ghdl
Install ghdl-yosys-plugin
Check that in your yosys install directory, in this case
usr/local/share/yosys/plugins
there isghdl.so
Checkyosys
,ghdl
,ghdl-yosys-plugin
installation from terminal usingwhich yosys
,which ghdl
andyosys -m ghdl
commands respectively, all independent from another.Change the
synth_vhdl
commandYou need to add
-m ghdl
to thesynth_vhdl
command like this: