This project is a demonstration of some topics in FPGA programming, originally prepared for an FPGA workshop. The project is a very basic logic design for the Lattice ICE40UP5K part. It is tasked with driving an external LED in the pattern of a sinusoidal waveform (smoothly dimming and brightening the LED).
The project demonstrates a few things:
-
A fully open-source flow for the compilation of FPGA designs up to a result that can be programmed onto the chip (synthesis by Yosys/ABC; place and route by nextpnr)
-
A combination of traditional HDL languages (Verilog) and modern Python DSLs (Amaranth) in a single design. (Here the Python DSL part generates the sinusoidal pattern, the remainder does the pulse-density modulation.)
-
Simulation at either the Python DSL level, or an end-to-end simulation at the level of the completed mixed-language design
Please see the Makefile to read the steps in the implementation of the above.
These are roughly the commands to install all the software dependencies on a recent Ubuntu release:
apt install yosys nextpnr-ice40 iverilog fpga-icestorm gtkwave graphviz gnuplot
pip3 install amaranth amaranth-yosys xdot
Alternatively, see shell.nix for a declaration of a NixOS development environment containing all the dependencies.