How to Configure OpenFPGA Environment (Probable Errors & Their Solutions)

Openfpga environment configuration and problem-solving

Environment configuration process

git clone​

cd OpenFPGA/.github/workflows​
# Add ‘sudo’ before apt-get in script:​
source  # (install all depencies)​

# back to OpenFPGA
python3 –m pip install –r requirements.txt​
make all​

# During make, watch the error messages and see which package is missing, repeatly using  ‘sudo apt install XXX’ to install them like:​
Tcl.h:   sudo apt install tcl-dev​
readline:   sudo apt install readline-dev​

How to Solve the Errors:

Compilation error


  • Cause: Guess it is a C compilation tool chain version problem caused by different source change
  • Solution: Update the version of catch.hpp and replace


1. Download

wget -O ~/Downloads/catch.hpp

2. Replace the file

cd {OpenFPGA_File_location}/libs/EXTERNAL/libcatch/
mv catch.hpp catch.bak.hpp
mv ~/Downloads/catch.hpp ./

FATAL ERROR issues about TBB

  • Cause: system problem missing header file tbb_stddef.h
  • Solution:
wget -O ~/Downloads/tbb_stddef.h
sudo mv ~/Downloads/tbb_stddef.h /usr/include/tbb

Missing header file task_scheduler_init.h

wget -O ~/Downloads/task_scheduler_init.h
sudo mv ~/Downloads/task_scheduler_init.h /usr/include/tbb

Dependency not found

  • Uniform problem: Error or not running when running or when pip install
  • Solution: rerun both steps and install separately if there is still a problem
# Missing ffi.h
sudo apt install libffi-dev
# Missing tcl.h
sudo apt install tk tcl tk-dev tcl-dev
# Missing readline
sudo apt install readline-dev libreadline6-dev

run-task error

Check the log. The most observed problem is that envYAML package is not installed

pip3 install envyaml

ModuleNotFoundError ‘prettytable’

When running, it prompts: ModuleNotFoundError: No module named ‘prettytable’

# update pip
python -m pip install --upgrade pip
# install PrettyTable package
pip install PrettyTable

Script unsatisfiable

  • ctags, qt5-default are not available candidates (no installation candidate)
  • Solution: In most usage scenarios, these two packages are not important, edit the file and delete the lines ctags and qt5-default

Network environment problems


  1. Connection refused Connection refused
  2. 443 SSL could not be established
  3. Clone failed Clone failed


  1. Modify hosts
  2. Open accelerator/VPN
  3. Use personal hotspot for mobile traffic

Runtime problems

Permission Denied | Can not find directory…

Problem Analysis: The command is incorrectly run with the root user when git clone or install dependencies, resulting in the personal user not having any modification rights.
Solution: In the root directory of OpenFPGA

sudo chown -hR {user name}:{user group, usually same as user name} . /
# Change all file owners to individual users

In the yosys shell, when the show command views the circuit diagram, it prompts an error

Problem: lack of dot matrix graphic display tool
solution: try running sudo apt-get install xdot

Read More: