Installing YANC¶
YANC runs on Windows and Linux with the same commands. On Windows they are typed in the terminal of MSYS2, in its UCRT64 environment: install MSYS2 and open the “MSYS2 UCRT64” terminal, which also provides the simulators and GTKWave (see To simulate). On Linux, any terminal.
The release package¶
Download the latest release from
https://github.com/nipscernlab/yanc/releases/latest:
yanc-bin-<version>.zip for Windows, yanc-bin-linux-<version>.tar.gz for
Linux. Unpack it anywhere and, from the unpacked folder (in the UCRT64
terminal C:\Users\me\yanc is /c/Users/me/yanc), run once, with no
administrator rights:
./install.sh
It puts the tools on your PATH: on Windows a file /etc/profile.d/yanc.sh
puts the package’s bin/ on the PATH of every new MSYS2 terminal, on Linux
a launcher per tool goes in ~/.local/bin (PREFIX=... ./install.sh for
another place). Then it checks for Icarus Verilog, GTKWave and Verilator
and says how to get the missing ones; on Windows it installs them with
pacman if you answer y. Open a new terminal: yanc -h answers.
./install.sh --uninstall undoes it.
The MSYS2 terminal does not see the Windows PATH, nor cmd and
PowerShell MSYS2’s. The package’s install.bat puts bin\ on the Windows
user PATH, to call yanc from cmd or PowerShell (uninstall.bat takes
it off). The package holds:
folder |
contents |
|---|---|
|
|
|
the SAPHO processor in Verilog, which a simulator or a synthesizer reads with the generated |
|
the assembly routines of the C± library |
|
the C++ headers |
|
|
The tools find SAPHO/, Macros/ and Header/ next to their own bin/,
so keep the package’s folders together.
To simulate¶
YANC writes the processor’s Verilog and a testbench; running it takes a
Verilog simulator, and looking at the result a waveform viewer (see
Simulation). install.sh checks for these; the packages
are:
what |
MSYS2 UCRT64 ( |
Debian / Ubuntu ( |
for |
|---|---|---|---|
Icarus Verilog |
|
|
simulating the generated Verilog |
GTKWave |
|
|
looking at the waveform |
Verilator 5 |
|
|
faster simulation, for long runs: Verilator turns the Verilog into C++ and builds it with |
On Windows, MSYS2 ships Icarus and Verilator only for UCRT64: it no longer does for MINGW64. Everything, in the UCRT64 terminal:
pacman -S --needed mingw-w64-ucrt-x86_64-iverilog mingw-w64-ucrt-x86_64-gtkwave \
mingw-w64-ucrt-x86_64-verilator mingw-w64-ucrt-x86_64-lz4 \
make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-python
To build YANC and run its scripts as well, add bison flex diffutils:
diffutils (cmp, diff) and Python are what Scripts/regress.sh and
its checks run, and without them the regression fails in ways that look
like compiler defects. pacman -Syu keeps MSYS2 up to date.
GTKWave. YANC’s scripts give GTKWave the options it knows:
--dark, and--zoom-fitand--left-justifywhen it lists them (the nipscernlab build does; MSYS2’s and the distributions’ do not, and refuse an option they do not know). Any of them applies the layoutgen_gtkwwrites. Without GTKWave,single_proc.shandmulti_proc.shstill simulate and write the waveform and its layout; they only do not open it. The Verilator flow ofmulti_proc.shneedsfst2vcd, which comes with GTKWave.gcc 16 and Verilator. MSYS2’s gcc 16 (16.1 and 16.2) ships a
libstdc++without thestd::stringmove constructor at-Os, which Verilator’s build uses: linking fails withundefined reference to std::__cxx11::basic_string<...>::basic_string(...&&). YANC’s scripts pass-D_GLIBCXX_ASSERTIONSto Verilator under MSYS2 (YANC_VL_CFLAGSinScripts/env.shandScripts\env.bat), with which the compiler builds the constructor itself; no downgrade is needed. Verilator run by hand takes it as-CFLAGS -D_GLIBCXX_ASSERTIONS(see Simulation).Scripts/setup.shandScripts\setup.batcheck it. The Icarus flow is unaffected.
Building YANC from source¶
To build the tools from a clone of the repository, or to work on YANC, see Building and testing YANC.