FPGA Workshop
Basic FPGA development for absolute beginners
Sections
- 01 Hello
- 02 Module
- 03 Blink
- 04 Parameters
- 05 Variables and Registers
- 06 Dimming
- 07 Tasks
- 08 Functions
- 09 Case statement
- 10 I/O pins in verilog
- 11 Simulation
- 12 Detect
- 13 DS18B20 Sensor
Pre-requisites
When joining the workshop as a participant make sure to have these things done.
Compiling the tool chain takes 35 to 55 minutes, during which you cannot take part in the exorcizes in the workshop.
- Installed Icestorm toolchain, that supports the Lattice ICE40UP5K FPGA.
- Install manually
- Install by script
- Install by packagemanager:
apt-get install arachne-pnr arachne-pnr-chipdb iverilog gtkwave
(on Ubuntu 19.04 or a recent Debian) - For those that forget there will be a Virtual machine, that will suffice during the workshop.
- A micro USB cable
- A working laptop that can run the Icestorm toolchain (Linux or OSX should be fine, for Windows I don't know#)
- 3 to 4 hours of your time, an Saturday the 13th (There will be some breaks)
- Some basic knowledge about programming and digital circuits
- A laptop that is capable of running the Icestorm toolchain.
Checking the tool chain
A simple check to see if the toolchain supports the 'ICE40UP5K', do:
$ arachne-pnr -h
<...>
-d <device>, --device <device>
Target device <device>. Supported devices:
384 - Lattice Semiconductor iCE40LP384
1k - Lattice Semiconductor iCE40LP/HX1K
5k - Lattice Semiconductor iCE40UP5K
lm4k - Lattice Semiconductor iCE40LM4K
8k - Lattice Semiconductor iCE40LP/HX8K
Default: 1k
<...>
When it shows the line '5k - Lattice Semiconductor iCE40UP5K' the tool chain supports the UPDuino V2.
Requisites
###Materials
The hardware for one workshop kit
- 1x UPDuino V2.0
- 2x 12kΩ resistors
- 1x 4.7kΩ resistor
- 1x 400 pin breadboard
- 6x breadboard wire (one lot has enough wires for 6 kits)
- 1x DS18B20 temperature sensor
###Software dimdm IceTools Github
Requisites for people wanting to do it hardcore
IceStorm
git clone https://github.com/cliffordwolf/icestorm.git icestorm
cd icestorm
make -j$(nproc)
sudo make install
Archane-PNR
git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
cd arachne-pnr
make -j$(nproc)
sudo make install
NextPNR
git clone https://github.com/YosysHQ/nextpnr nextpnr
cd nextpnr
cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
make -j$(nproc)
sudo make install
Yosys
git clone https://github.com/cliffordwolf/yosys.git yosys
cd yosys
make -j$(nproc)
sudo make install
Simulation
For example 09 you'll need to install Icarus Verilog and GTKWave
Icarus Verilog
git clone git://github.com/steveicarus/iverilog.git iverilog
cd iverilog
aclocal
autoconf
automake
./configure
make -j$(nproc)
sudo make install
GTKWave
svn checkout svn://svn.code.sf.net/p/gtkwave/code/ gtkwave-code
cd gtkwave-code/gtkwave3-gtk3
./configure
make -j$(nproc)
sudo make install