These instructions are for Ubuntu
Download and install yosys/nextpnr/icestorm FPGA flow.
Recommend using the binary release by yosysHQ.
MAKE SURE IT IS REALLY UP TO DATE AND YOU DON'T HAVE SOME ANCIENT INSTALL IN YOUR PATH!
Download tarball from: https://github.com/YosysHQ/oss-cad-suite-build/releases
tar xfvz ~/Downloads/oss-cad-suite-linux-*.tgz -C ~/
export PATH=~/oss-cad-suite/bin:$PATH
NOTE: You can add the export PATH
to your .bashrc
, .zshrc
or similar to make it persist between terminal restarts.
Test yosys installation. (the version indicated is the newest cad-oss-suite release as of writing of this gist)
yosys -V
Yosys 0.27+22 (git sha1 53c0a6b78, clang 10.0.0-4ubuntu1 -fPIC -Os)
Install python venv module:
sudo apt install python3-venv
NOTE: Python V3.11 is currently not supported. Make sure to use Python V3.10 or older.
Clone and install glasgow:
mkdir -p ~/projects/glasgow
cd ~/projects/glasgow
git clone https://github.com/GlasgowEmbedded/glasgow.git glasgow-git
cd glasgow-git
Install udev rules:
sudo cp config/99-glasgow.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
Create python venv and install needed pip packages:
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip wheel
Install glasgow software:
cd software
pip install -e .
Running the tool:
glasgow list
should result with a list of connected devices. For example C3-20230214T130449Z
Running a selftest: Make sure to connect V and S pins together so the Glasgow can measure it's own voltage output.
glasgow run selftest voltage
the output should be something like:
I: g.device.hardware: device already has bitstream ID 663ad97b6078e02bb21a37a2b3699c48
I: g.cli: running handler for applet 'selftest'
I: g.applet.internal.selftest: running self-test mode voltage
I: g.applet.internal.selftest: self-test: PASS
Even if this test fails because the pins are not connected, if the output is something like this, it means a lot of stuff is working correctly, including bitstream generation programming and interfacing with the glasgow:
I: g.device.hardware: device already has bitstream ID 663ad97b6078e02bb21a37a2b3699c48
I: g.cli: running handler for applet 'selftest'
I: g.applet.internal.selftest: running self-test mode voltage
E: g.applet.internal.selftest: self-test: FAIL
E: g.applet.internal.selftest: voltage: port A out of ±5% tolerance: Vio=1.80 Vsense=0.00
E: g.applet.internal.selftest: voltage: port A out of ±5% tolerance: Vio=2.70 Vsense=0.00
E: g.applet.internal.selftest: voltage: port A out of ±5% tolerance: Vio=3.30 Vsense=0.00
E: g.applet.internal.selftest: voltage: port A out of ±5% tolerance: Vio=5.00 Vsense=0.00
E: g.applet.internal.selftest: voltage: port B out of ±5% tolerance: Vio=1.80 Vsense=0.00
E: g.applet.internal.selftest: voltage: port B out of ±5% tolerance: Vio=2.70 Vsense=0.00
E: g.applet.internal.selftest: voltage: port B out of ±5% tolerance: Vio=3.30 Vsense=0.00
E: g.applet.internal.selftest: voltage: port B out of ±5% tolerance: Vio=5.00 Vsense=0.00
Every time you want to use glasgow in a new terminal you have to "enter" the venv by sourcing the activation script:
source ~/projects/glasgow/glasgow-git/.venv/bin/activate
To exit the venv run:
deactivate