This repository is a result of my wanting to learn HDL languages and digital hardware design. This repo hosts hardware implementations deployed on the Lattice FPGAs -
- hx1k based iCEStick
- hx8k based Alchitry-Cu
The choice of FPGAs is primarily based on the availability of the open-source toolchain. Examples include -
Example | Path | FPGA |
---|---|---|
Blinky | iCEStick-hx1k/blinky | hx1k |
Logic Gates | iCEStick-hx1k/gates | hx1k |
Multiplexer | iCEStick-hx1k/mux | hx1k |
Uart | iCEStick-hx1k/uart | hx1k |
Blinky | alchitry-Cu-hx8k/blinky | hx8k |
7 Segment Display | alchitry-Cu-hx8k/7seg | hx8k |
I've tested the following command on Ubuntu and Mac. The toolchain used consists of -
- Yosys: To convert the Verilog/System Verilog to Netlist.
- Arachne-pnr: Convert the Netlist to the FPGA-specific place and route.
- Icestorm tools: Converting between file formats and upload the binary to the FPGA.
Use the following commands to install the toolchain -
sudo apt install build-essential clang bison flex libreadline-dev \
gawk tcl-dev libffi-dev git mercurial graphviz \
xdot pkg-config python3 libftdi-dev
brew install bison flex gawk graphviz xdot pkg-config python3
git clone https://github.com/cliffordwolf/icestorm.git icestorm
cd icestorm
make -j$(nproc)
sudo make install
git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
cd arachne-pnr
make -j$(nproc)
sudo make install
git clone https://github.com/cliffordwolf/yosys.git yosys
cd yosys
make -j$(nproc)
sudo make install
For each of the examples, from the location of the example, you can execute the following commands to compile the Verilog and upload it to the board.
cd
into the directory of the hardware that you want to build and simple execute make
. This should then generate the *.bin
file along with other helper files.
make
To flash the *.bin
file to the board there is a prog
target in the Makefile
for each hardware/project.
sudo make prog
To clean the repo and clear all generated files, from within the hardware/project directory execute.
make clean
I have been using the following resources to create these projects.
- Project IceStorm
- Author: Claire Wolf and Mathias Lasser
- Title: Project IceStorm
- hopublished: http://bygone.clairexen.net/icestorm/
- NandLand
- spinal-alchitry-cu
- Alchitry-IO pin names