Install verilog tools

First let’s get this out of the way: I use Linux

Technically these tools should be platform-agnostic and work on other OSes like Windows or MacOS.

I use Linux Mint and whenever I start fresh with a new environment I like to install the following packages:

sudo apt update
sudo apt install git tig zsh tmux neovim mc htop build-essential python3 python3-pip yasm p7zip p7zip-full gparted -y

IceStorm tools

Most of these steps were copied from the project’s page and improved/updated.

First of all install all dependencies:

sudo apt install iverilog gtkwave build-essential clang bison flex libreadline-dev    \
    gawk tcl-dev libffi-dev git mercurial graphviz xdot pkg-config python python3     \
    libftdi-dev qt5-default libqt5opengl5 libqt5opengl5-dev libeigen3-dev python3-dev \
    libboost-all-dev cmake

Install the IceStorm Tools:

git clone https://github.com/cliffordwolf/icestorm.git icestorm
cd icestorm
make -j$(nproc)
sudo make install

Install Arachne-PNR (old place & route tool):

git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
cd arachne-pnr
make -j$(nproc)
sudo make install

Install NextPNR (new place & route tool). If cmake fails with a python version error just delete CMakeCache.txt and try again!

git clone https://github.com/YosysHQ/nextpnr nextpnr
cd nextpnr
cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
make -j$(nproc)
sudo make install

Install Yosys (synthesis tool):

git clone https://github.com/cliffordwolf/yosys.git yosys
cd yosys
make -j$(nproc)
sudo make install

UDEV Rules

If you want to be able to program your FPGA board as a regular user you need to create a rules file like this: /etc/udev/rules.d/27-lattice-ftdi.rules with the following content:

ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="plugdev", TAG+="uaccess"

If your system doesn’t have a group named plugdev please create it with groupadd plugdev

Make sure your username is part of plugdev group by issuing the following command as root: usermod -g plugdev $USER

Please note you can skip this step and just use sudo to program your board as root.


Troubleshooting

If you get an error running yosys-abc about not being able to find libreadline6:

ERROR: ABC: execution of command "/usr/local/bin/yosys-abc -s -f /tmp/yosys-abc-dHxecs/abc.script 2>&1" failed: return code 127.

yosys-abc: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

You probably have a newer version of libreadline. You can create a symlink in /lib/x86_64-linux-gnu/ to the newer one like this:

sudo ln -s libreadline.so.7.0 libreadline.so.6 

In my case it’s libreadline7. After this invoking yosys-abc works:

UC Berkeley, ABC 1.01 (compiled Mar  9 2020 13:12:07)
abc 01> 

Video walkthrough

Here is a full length video with the whole procedure on a freshly installed linux mint in a VM (no audio).


Playing around with electronics in my spare time.
Opinions are my own and not the views of my employer.
Use this website AT YOUR OWN DISCRETION AND RISK, you will be solely responsible for any harm, loss or damage that you suffer as a result.