- NOTE: I started this in 0152 and picked it up again in 0156.
- I'm using Windows 11 Home
- I had already set up MSYS2/MinGW, and I think this is what I did when using my Legion 7 laptop.
- I set up Python 3.12 per 2310A.
Test basic stuff:
- Check PATH. In Command Prompt just run
path
. In PowerShell, runecho $env:path
. Make sure MSYS2/MingGW bin dirs are in there. For example, on my machine:PATH=
...;C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\ucrt64\bin;
... make --version
GNU Make 4.4.1 Built for x86_64-pc-msys Copyright (C) 1988-2023 Free Software Foundation, Inc. ...
py --version
=>Python 3.12.0
py -m pip --version
=>pip 23.2.1 from C:\
...(python 3.12)
gcc --version
gcc.exe (Rev1, Built by MSYS2 project) 13.2.0 Copyright (C) 2023 Free Software Foundation, Inc.
pacman --version
.--. Pacman v6.0.2 - libalpm v13.0.2 / _.-' .-. .-. .-. Copyright (C) 2006-2021 Pacman Development Team \ '-. '-' '-' '-' Copyright (C) 2002-2006 Judd Vinet '--'
- Create a .venv in your project, if you want, and optionally give it a specific prompt (like
venv:myproject
). For example:- Using VSCode:
- CTRL+SHIFT+P, find 'Python: Create Environment'
- Choose 'Venv'
- If you're using a workspace with multiple projects, choose the project in which you want to make the .venv
- Select your Python interpreter
- Right-click your project and open a new Integrated Terminal; Activate.ps1 should automatically run and
(.venv)
will be in the prompt.
- Using the
venv
command:- Go into your project directory.
- Run
py -m venv .venv --prompt venv:myproject
- Do:
echo '*' >> .venv\.gitignore
- Run
.\venv\Scripts\Activate.ps1
- Using VSCode:
- Before installing the
cocotb
package directly, check first whether there's arequirements.txt
file that includes it.- If so, just run
py -m pip install -r requirements.txt
- Otherwise, run:
py -m pip install cocotb
- If so, just run
This assumes you've got pacman
installed (my --version
is 6.0.2) which probably came as part of MSYS2 (see Prerequisites).
I'm following from here.
- List available versions of iverilog by running:
pacman -Ss iverilog
:> pacman -Ss iverilog mingw32/mingw-w64-i686-iverilog 1~11.0.r9168.gd480c4d7-1 (mingw-w64-i686-eda) Icarus Verilog, is a Verilog simulation and synthesis tool (mingw-w64) mingw64/mingw-w64-x86_64-iverilog 1~11.0.r9168.gd480c4d7-1 (mingw-w64-x86_64-eda) Icarus Verilog, is a Verilog simulation and synthesis tool (mingw-w64) ucrt64/mingw-w64-ucrt-x86_64-iverilog 1~11.0.r9168.gd480c4d7-1 (mingw-w64-ucrt-x86_64-eda) Icarus Verilog, is a Verilog simulation and synthesis tool (mingw-w64)
- Choose the version you want to install. Which one was right for me? When I originally set up MSYS2, it seems I settled on making 'MSYS2 UCRT64' my default shell, so I'll go with the ucrt64 version, though apparently you might be able to install all 3.
- Install the package for your chosen version, e.g.
pacman -S mingw-w64-ucrt-x86_64-iverilog
- After this,
iverilog.exe
was not in my PATH, but I was able to run it from my MSYS2 UCRT64 shell, and evidently its path is:- Windows path:
C:\msys64\ucrt64\bin\iverilog.exe
- Equivalent Unix path:
/ucrt64/bin/iverilog
So edit Windows env vars and make sure PATH includes your path to...\ucrt64\bin
. I already hadC:\msys64\usr\bin
andC:\msys64\mingw64\bin
but had to addC:\msys64\ucrt64\bin
.
- Windows path:
- Re-launch any shells/terminals. For VSCode, this probably means relaunching the whole app.
- Run
iverilog -V
and it will hopefully spit out version info:> iverilog -V Icarus Verilog version 12.0 (devel) (s20150603-1391-gd480c4d7d) ...
For pre-built Windows installers: http://bleyer.org/icarus/
For instructions on building from source: https://iverilog.fandom.com/wiki/Installation_Guide#Compiling_on_MS_Windows_(MinGW)
- Search:
pacman -Ss gtkwave
- Let's go with ucrt64 version again:
pacman -S mingw-w64-ucrt-x86_64-gtkwave
- Test:
gtkwave
- GTKWave might appear blurry or oversized if High DPI is used in Windows. While GTKWave is running, right-click it in the taskbar, go to Properties => Compatibility => Settings => Change high DPI settings => then tick
Override high DPI scaling behavior
and setScaling performed by:
toApplication
. Launch it again, and it should look much clearer and at a normal size. - Create a
.gtkwaverc
file. For Windows, per the GTKWave documentation PDF we actually need to create a file calledgtkwave.ini
in the current working directory (say, of your project, where your VCD file will be written):NOTE: You can override this by supplying the# ~/.gtkwaverc # Use, for example, the following for generic monospaced-fonts: # fontname_signals Monospace 15 fontname_waves Consolas 9 # By making signal names larger, we can make the waveforms taller too: fontname_signals Consolas 15 splash_disable 1 fill_waveform 1 disable_mouseover 0 # Grid lines are pale blue: color_grid 336699 # Z values are light purple: color_mid bb33ff
-r YourRCFile
option to gtkwave. For more gtkwaverc examples, including defining custom hotkeys, see this.
- See my efforts in 0156