2018-04-28

Verilog in linux - ice40HX1K stick

This is a guide to install the project IceStorm in OpenSUSE. IceStorm is a open source tool-chain to program some of the lattice FPGAs in linux. You can alternatively install Lattice's own programming tool-chain called iCEcube2 as there is a linux installer.

The installation is pretty straight forward in OpenSUSE.
install the following packages with yast : libclang bison readline-devel flex gawl tcl-devel libffi-devel-gcc5\
git-core mercurial graphviz pkg-config python python3 libftdi1-devel
Then follow the install instructions
Installing the IceStorm Tools (icepack, icebox, iceprog, icetime, chip databases):
git clone https://github.com/cliffordwolf/icestorm.git icestorm
cd icestorm
make -j$(nproc)
sudo make install
(no issues with this one)
Installing Arachne-PNR (the place&route tool):
git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
cd arachne-pnr
make -j$(nproc)
sudo make install
(also no issues with this one)

Installing Yosys (Verilog synthesis):
git clone https://github.com/cliffordwolf/yosys.git yosys
cd yosys
make -j$(nproc)
sudo make install
(for this one you need to change the makefile to use gcc, see here regarding 
"tuple not found" error, then if it still fails due to %define variable `parse.error' see here, basically delete lines 142 and 143 from verilog_parser.y)

To test your installation go into the directory icestorm/examples/icestick and "make" and "iceprog example.bin". The LEDs on the board should change the pattern and you should get no errors.
There... now next step is to learn VHDL/Verilog...