Skip to content

Instantly share code, notes, and snippets.

@sgherbst
Created March 11, 2019 13:32
Show Gist options
  • Select an option

  • Save sgherbst/036456f807dc8aa84ffb2493d1536afd to your computer and use it in GitHub Desktop.

Select an option

Save sgherbst/036456f807dc8aa84ffb2493d1536afd to your computer and use it in GitHub Desktop.
Installing Verilator on Windows 10 using a fresh MSYS2 install
  1. Download and install MSYS2: https://sourceforge.net/projects/msys2/
  2. Open MSYS2 shell and run pacman -Syu
  3. After some time you will be prompted to close the MSYS2 shell by clicking the "X" button, which you should do :-)
  4. Relaunch MSYS2 shell and run pacman -Su
  5. Install the required packages for Verilator:
> pacman -S git make autoconf gcc flex bison man perl
  1. Clone the Verilator source and build the latest stable release:
> git clone http://git.veripool.org/git/verilator
> unset VERILATOR_ROOT
> cd verilator
> git checkout stable
> autoconf
> ./configure
> make
  1. Test Verilator:
> make test
  1. If the tests pass, install Verilator. Note that sudo is not used here since this is MSYS2, and that the PATH variable is updated so that the installer can find pod2man:
> PATH="/usr/bin/core_perl:${PATH}"
> make install
@harry-commin-enclustra
Copy link

harry-commin-enclustra commented Apr 17, 2024

Since I couldn't get Verilator to build from source, I followed the spinalhdl instructions to install via pacman.

Here's a full copy-paste of their instructions:

pacman -Syuu
# Close the MSYS2 shell once you're asked to
pacman -Syuu
pacman -S --needed base-devel mingw-w64-x86_64-toolchain \
                   git flex\
                   mingw-w64-x86_64-cmake

pacman -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-verilator-4.032-1-any.pkg.tar.xz

# Add C:\msys64\usr\bin;C:\msys64\mingw64\bin to your Windows PATH

I modified the package URL, as I assume the one above is outdated. In other words, I browsed to http://repo.msys2.org/mingw/x86_64/, searched for mingw-w64-x86_64-verilator and found these matches:

image

I guess 5.024 is the latest version, so I installed Verilator like this:

pacman -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-verilator-5.024-1-any.pkg.tar.zst

Edit: It seems like a better option is to just install the latest version like this:

pacman -S mingw-w64-x86_64-verilator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment