GSI Timing Gateware and Tools
- Build Instructions
- FAQ and Common Problems
Just clone our project.
git clone https://github.com/GSI-CS-CO/bel_projects.gitMake will take care of all submodules and additional toolchains.
makeImportant: Please don't mess around using the "git submodule --fancy option" command!
This will build VME and PCI(e) drivers.
make driver
make driver-install # optional
make driver/driver-install WISHBONE_SERIAL=y # optional - build wishbone-serial.koBuilds basic Etherbone tools and library.
make etherbone
make etherbone-install # optionalAdditional tools like eb-console and eb-flash.
make tools
make tools-install # optionalBuilds basic Saftlib tools and library.
make saftlib
make saftlib-install # optionalFor detailed information check ip_cores/saftlib/CompileAndConfigureSaftlib.md.
Currently we support a few different form factors.
make scu2 # Arria II
make scu3 # Arria II
make vetar2a # Arria II
make vetar2a-ee-butis # Arria II
make ftm # Arria V
make pexarria5 # Arria V
make exploder5 # Arria V
make pmc # Arria V
make microtca # Arria V
make pexp # Arria V
make scu4slim # Arria 10
make pexarria10 # Arria 10
make ftm10 # Arria 10
make scu5 # Arria 10
make ftm5 # Arria 10
make ftm5dp # Arria 10make $device-check
make exploder5-check # example
make $device-sort
make exploder5-sort # example
make lm32-cluster-testbench-run
Click here for additional information.
export QSYS_ROOTDIR=$CFG_QUARTUS_VERSION/quartus/sopc_builder/bin
export QUARTUS_ROOTDIR=$CFG_QUARTUS_VERSION/quartus
export QUARTUS=$QUARTUS_ROOTDIR
export QUARTUS_64BIT=1
export PATH=$PATH:$QUARTUS
export PATH=$PATH:$QSYS_ROOTDIRPlease adjust your $CFG_QUARTUS_VERSION variable.
Question: Which Version of Quartus Do I Need?
Answer:
- Arria II/Arria V: Quartus 18.1.0 (Build 625 09/12/2018 SJ) Standard Edition
- Arria 10: Quartus 23.1.1 (Build 993 05/14/2024 SC) Standard Edition
Error: Quartus error while loading shared libraries: libpng12-0.0: ... [Ubuntu/Mint/...]
Solution: Install the missing package
Get the package from here: https://packages.ubuntu.com/xenial/amd64/libpng12-0/download
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0If this PPA can't be added, you need to compile the library:
cd res/ubuntu-22-and-later
tar xf libpng_1.2.54.orig.tar
cd libpng-1.2.54
./autogen
./configure
make
sudo make installYou can use a copy from here:
- Ubuntu: res/ubuntu
- Rocky-9: res/rocky-9
Error: Executing qmegawiz: child process exited abnormally + Time value XXX,YYYMbps and time unit are illegal
Solution: Change your LC_NUMERIC setting:
export LC_NUMERIC="en_US.UTF-8"Error: (23035) Tcl error: couldn't execute "qsys-generate": no such file or directory
Solution: Adjust your PATH variable like this:
export QUARTUS=/opt/quartus/
export QSYS_ROOTDIR=$QUARTUS/sopc_builder/bin
export PATH=$PATH:$QUARTUS_ROOTDIR:$QSYS_ROOTDIRError: (293007): Current module quartus_sh ended unexpectedly. Verify that you have sufficient memory available to compile your design.
Solution: Use the right Quartus version for your project.
Error: /bin/sh: 1: cannot create /ramsize_pkg.vhd: Permission denied
Solution: Check all your (changed) Manifest.py files.
Question: Which packages are required?
Answer: You need to have installed the following packages before you can configure and build Etherbone and Saftlib:
- docbook-utils
- libglib2.0-dev
- autotools-dev
- autoconf
- libtool (glibtoolize)
- build-essential
- automake
- libreadline-dev
- libsigc++ (saftlib) ‡
- libboost-dev (saftlib)
- pkgconfig (saftlib) †
- xsltproc (saftlib)
- libz-dev (saftlib)
† Ubuntu 22.04 and later: pkg-config
‡ Ubuntu 22.04 and later: libsigc++-2.0-dev
For apt that means
apt install docbook-utils libglib2.0-dev autotools-dev autoconf libtool build-essential automake libreadline-dev libsigc++-2.0-dev libboost-dev pkg-config xsltproc libz-dev python-is-python3For pacman that would be
pacman -S docbook-utils autoconf automake libtool readline libsigc++ pkgconf libxslt glibmm boostError: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory [Ubuntu/Mint/...]
Error: lm32-* permission denied /dev/stdout
Solution: Create a new symlink:
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4Error: hdlmake AttributeError: module object has no attribute vendor or hdlmake not found
Solution: In case a simple "make" does not fix this:
make hdlmake_installError: /bin/sh: 1: hdlmake: not found
Solution: You should run "make" to install hdlmake locally and adjust your PATH variable:
export PATH=$PATH:$HOME/.local/binError: cd ip_cores/hdlmake/ && python setup.py install --user /bin/sh: 1: python: not found
Solution: In case you are running Ubuntu:
sudo apt-get install python-is-python3Optional (python-is-python3 not found):
sudo ln -s /usr/bin/python3 /etc/python
sudo apt-get install python-setuptools
sudo apt-get install python3-setuptoolsIn case you have no sudo rights:
ln -s /usr/bin/python3 python
export PATH=$PATH:$(pwd)We recommend to use at least Python3.7.
Error: ImportError: No module named pkg_resources
Solution:
sudo apt-get install python-pkg-resources
sudo apt-get install --reinstall python-pkg-resources # if already installedError: ModuleNotFoundError: No module named 'setuptools'
Solution: Just install the right setuptools:
sudo apt-get install python3-setuptools # Python 3.X
sudo apt-get install python-setuptools # Python 2.XError: ModuleNotFoundError: No module named 'six'
Solution:
sudo apt-get install python-six
sudo apt-get install python3-sixError: Compilation: "Error message: ./configure: line 16708: syntax error near unexpected token 0.23' ./configure: line 16708: PKG_PROG_PKG_CONFIG(0.23)'"
Solution:
sudo apt-get install pkg-config
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfigError: Compillation: "saftbus/process.cpp:14:10: fatal error: linux/ioprio.h: No such file or directory"
Solution:
- In Makefile.am
- line 405: delete 'saft-roundtrip-latency saft-standalone-roundtrip-latency'
- delete lines 486-490
saft_roundtrip_latency_LDADD = $(EB_LIBS) $(SIGCPP_LIBS) libsaftbus.la libsaft-proxy.la -ldl #-lltdl
saft_roundtrip_latency_SOURCES = src/saft-roundtrip-latency.cpp
saft_standalone_roundtrip_latency_LDADD = $(EB_LIBS) $(SIGCPP_LIBS) libsaftbus.la libsaft-service.la -ldl #-lltdl
saft_standalone_roundtrip_latency_SOURCES = src/saft-standalone-roundtrip-latency.cpp- In saftbus/process.cpp, replace the entire code by
#include "process.hpp"
#include <iostream>
#include <sstream>
#include <cstring>
bool set_realtime_scheduling(std::string argvi, char *prio) {
return true;
}
bool set_cpu_affinity(std::string argvi, char *affinity) {
return true;
}
bool set_ioprio(char *ioprio) {
return true;
}Error: make[1]: cc: No such file or directory
Solution:
which cc # cc: Command not found.
update-alternatives --list cc
which cc # /usr/bin/ccClick here for additional information.
unset LD_LIBRARY_PATH
source /common/usr/embedded/yocto/sdk/environment-setup-core2-64-ffos-linux
make etherbone YOCTO_BUILD=yes
make saftlib YOCTO_BUILD=yesCheck the Rocky-9 subsection, if you get lsb_release related errors.
Error: configure: error: Package requirements (etherbone >= x.y.z) were not met:
Solution:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Error: Cloning into 'dir'... - fatal: unable to access 'https://ohwr.org/project/generic_project.git/': server certificate verification failed. CAfile: none CRLfile: none
Solution: Systems with outdated trust databases (root CA certificate Let's Encrypt) will be unable to validate the certificate of the site. Update ca-certificates to fix this:
sudo apt update
sudo apt upgrade ca-certificates| Timing Receiver | JTAG Adapter(s) | JTAG Adapter Configuration |
|---|---|---|
| SCU2 & SCU3 | Promo 11 (Micro-USB) | - |
| Vetar2a | Promo 11 (Micro-USB) Promo 5 |
Promo 5: SEL1 0x1 - SEL2 0x4 |
| Pexarria5 | Promo 5 Promo 12 |
FPGA Promo 5: SEL1 0x2 - SEL2 0x8 CPLD Promo 5: SEL1 0x1 - SEL2 0x4 FPGA Promo 12: SEL1 0x2 - SEL2 0x8 (?) CPLD Promo 12: SEL1 0x1 - SEL2 0x4 (?) |
| Exploder5 | Promo 11 (Micro-USB) Promo 5 Promo 12 |
FPGA Promo 5: SEL1 0x1 - SEL2 0x4 CPLD Promo 5: SEL1 0x2 - SEL2 0x8 FPGA Promo 12: SEL1 0x1 - SEL2 0x4 (?) CPLD Promo 12: SEL1 0x2 - SEL2 0x8 (?) |
| MicroTCA/AMC | Promo 11 (Micro-USB) | FPGA/CPLD JTAG chain |
| PMC | Promo 11 (Micro-USB) | FPGA/CPLD JTAG chain |
| PEXP | Promo 11 (Micro-USB) | FPGA/CPLD JTAG chain |
| SCU4 & FTM4 | Promo 11 (Micro-USB) | - |
| SCU4.1 (SCU4SLIM) | Promo 11 (Micro-USB) | USB-Blaster II only |
| Pexarria10 & FTM10 | Promo 11 (Micro-USB) | Optional USB to JTAG adapter † |
| SCU5 | Promo 11 (Micro-USB) | Optional USB to JTAG adapter † |
† If attached: FPGA USB-Programmer2 JTAG (Arrow)
Error: quartus: USB-Blaster can't find FPGA [Ubuntu/Mint/...]
Solution: Create a new symlink:
sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0See doc/platform_cable/readme.md
See doc/arrow_usb_programmer/readme.md
Default user: admin
Default password: password
Default server port (programmer GUI): 1309Configure the SPI flash chip:
eb-config-nv $device 10 4Format the 1-wire EEPROM:
cd bel_projects/ip_cores/wrpc-sw/tools
eb-w1-write $device 0 320 < sdb-wrpc.binProgram FPGA from command line:
quartus_pgm -c 1 -m jtag -o 'p;device.sof'Problem: Flashing might fail sometimes on certain devices and host combinations.
Solution: If you have such a device please use eb-flash (with additional arguments) to flash the timing receiver:
Optional (BEFORE using eb-flash):
eb-reset $device wddisable # disable watchdog timer
eb-reset $device cpuhalt 0xff # stop all embedded CPUsOptional (AFTER using eb-flash):
eb-reset $device fpgareset # reset FPGA(problematic devices) eb-flash -s 0x40000 -w 3 $device $gateware.rpd # <VETAR2A/VETAR2A-EE-BUTIS/SCU2/SCU3>
(unproblematic devices) eb-flash $device $gateware.rpd # <VETAR2A/VETAR2A-EE-BUTIS/SCU2/SCU3>(problematic devices) eb-flash -s 0x10000 -w 3 $device $gateware.rpd # <PEXP/PEXARRIA5/PMC/MICROTCA/EXPLODER5>
(unproblematic devices) eb-flash $device $gateware.rpd # <PEXP/PEXARRIA5/PMC/MICROTCA/EXPLODER5>eb-asmi $device -w $gateware.rpd (write)
eb-asmi $device -v $gateware.rpd (verify)