the guide · 3.6How do you build the chain by hand?

yosys-slang

The SystemVerilog reader. Homebrew's Yosys 0.69 has no read_slang (yosys -p 'help read_slang' prints No such command or cell type: read_slang), so the plugin is compiled against it. About 4 minutes: the clone with its slang submodule, then 2 min 53 s of compiling with -j2.

cd ~/fpga
git clone --recursive https://github.com/povik/yosys-slang.git
cd yosys-slang
git checkout 96767863835f3c862cea9c63052b2ce9d0b55884
git submodule update --init --recursive
cmake -B build . -DCMAKE_BUILD_TYPE=Release -DBUILD_AS_PLUGIN=ON \
  -DYOSYS_CONFIG="$(brew --prefix)/bin/yosys-config"
make -C build -j2

Run cmake from inside the checkout, as written (. is the source): slang's own cmake asks git remote get-url origin in the current directory for the GitHub address of a header it downloads, and from any other directory the configure stops with Failed to clone repository: 'MikePopoloski/regex.git'. The last lines of the build:

[100%] Linking CXX shared library ../slang.so
[100%] Built target yosys-slang

Check that Yosys loads it:

yosys -m ~/fpga/yosys-slang/build/slang.so -p 'help read_slang' | grep 'read_slang \['
#     read_slang [options] [filename]

The plugin is tied to the Yosys it was built against: after brew upgrade yosys, build it again (rm -rf build, then the cmake and make lines). The installer does this by itself: it keeps the yosys -V line it built for in build/.dewfpga-yosys, compiles the new plugin into build.new/ and replaces build/ only once Yosys loads the new slang.so, so a build that fails (no disk, no network) leaves the plugin you have in place. A slang.so built by hand with the lines above has no stamp; the installer loads it with yosys -m, and if read_slang is there it writes the stamp instead of building again. dewfpga check loads the plugin the same way each time it runs: a plugin that is there but no longer loads prints does not load in Yosys 0.69+post (built for another yosys? dewfpga install rebuilds it), a missing one prints MISSING (the SystemVerilog reader: dewfpga install builds it, about 4 min), and either way the check ends with something is missing -> dewfpga install and exit 1. Without the plugin make bit still runs, on Yosys' own reader alone.


previous: 3 How do you build the chain by hand?
next: 4 What is in the project folder?
This section in the whole guide
The commands this section names: dewfpga install · dewfpga check

Stuck on an error? Every error from this setup, filed under the exact line it printed.