2021-02-06 18:46:56 -06:00
|
|
|
.. _tutorial_compile:
|
2020-03-09 18:40:33 -05:00
|
|
|
|
2020-03-09 14:58:24 -05:00
|
|
|
How to Compile
|
2020-03-09 18:40:33 -05:00
|
|
|
--------------
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-07 11:35:20 -06:00
|
|
|
.. note:: We recommend you to watch a tutorial `video <https://youtu.be/F9sMRmDewM0>`_ about how-to-compile before getting started
|
2021-02-06 20:45:41 -06:00
|
|
|
|
2021-02-07 11:35:20 -06:00
|
|
|
.. only:: html
|
|
|
|
|
|
|
|
.. youtube:: F9sMRmDewM0
|
2021-02-06 18:16:15 -06:00
|
|
|
|
2020-03-09 18:40:33 -05:00
|
|
|
General Guidelines
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
2021-04-24 03:31:52 -05:00
|
|
|
OpenFPGA uses CMake to generate the Makefile scripts.
|
2020-03-09 14:58:24 -05:00
|
|
|
In general, please follow the steps to compile
|
|
|
|
|
2020-05-25 01:31:01 -05:00
|
|
|
.. code-block:: shell
|
2020-03-09 14:58:24 -05:00
|
|
|
|
|
|
|
git clone https://github.com/LNIS-Projects/OpenFPGA.git
|
|
|
|
cd OpenFPGA
|
2020-12-13 23:04:10 -06:00
|
|
|
make all
|
2020-03-09 14:58:24 -05:00
|
|
|
|
|
|
|
.. note:: OpenFPGA requires gcc/g++ version >5
|
|
|
|
|
|
|
|
.. note:: cmake3.12+ is recommended to compile OpenFPGA with GUI
|
|
|
|
|
2021-06-16 15:00:31 -05:00
|
|
|
.. note:: Recommend using ``make -j<int>`` to accelerate the compilation, where ``<int>`` denotes the number of cores to be used in compilation.
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2020-10-05 15:27:08 -05:00
|
|
|
.. note:: VPR's GUI requires gtk-3, and can be enabled with ``cmake .. -DVPR_USE_EZGL=on``
|
|
|
|
|
2020-05-24 19:22:45 -05:00
|
|
|
**Quick Compilation Verification**
|
|
|
|
|
2021-06-14 15:51:19 -05:00
|
|
|
To quickly verify the tool is well compiled, users can run the following command from OpenFPGA root repository
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2020-05-25 01:31:01 -05:00
|
|
|
.. code-block:: shell
|
2020-03-09 14:58:24 -05:00
|
|
|
|
|
|
|
python3 openfpga_flow/scripts/run_fpga_task.py compilation_verification --debug --show_thread_logs
|
|
|
|
|
|
|
|
Dependencies
|
2020-03-09 18:40:33 -05:00
|
|
|
~~~~~~~~~~~~
|
2021-06-14 15:51:19 -05:00
|
|
|
Full list of dependencies can be found at install_dependencies_build_.
|
2020-03-09 14:58:24 -05:00
|
|
|
In particular, OpenFPGA requires specific versions for the following dependencies:
|
|
|
|
|
|
|
|
:cmake:
|
|
|
|
version >3.12 for graphical interface
|
|
|
|
|
|
|
|
:iverilog:
|
|
|
|
version 10.1+ is required to run Verilog-to-Verification flow
|
|
|
|
|
2021-02-04 12:58:59 -06:00
|
|
|
.. _install_dependencies_build: https://github.com/lnis-uofu/OpenFPGA/blob/master/.github/workflows/install_dependencies_build.sh
|
2020-03-09 14:58:24 -05:00
|
|
|
|
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
Running with the docker image
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-06-14 15:51:19 -05:00
|
|
|
Users can skip the traditional installation process by using the Dockerized version
|
|
|
|
of the OpenFPGA tool. The OpenFPGA project maintains the docker image/Github package of
|
2021-02-08 00:33:25 -06:00
|
|
|
the latest stable version of OpenFPGA in the following repository
|
|
|
|
`openfpga-master <https://github.com/orgs/lnis-uofu/packages/container/package/openfpga-master>`_.
|
|
|
|
This image contains precompiled OpenFPGA binaries with all prerequisites installed.
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
.. code-block:: bash
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
# To get the docker image from the repository, docker pull ghcr.io/lnis-uofu/openfpga-master:latest
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
# To invoke openfpga_shell
|
|
|
|
docker run -it ghcr.io/lnis-uofu/openfpga-master:latest openfpga/openfpga -i
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
# To run the task that already exists in the repository.
|
|
|
|
docker run -it ghcr.io/lnis-uofu/openfpga-master:latest bash -c "source openfpga.sh && run-task compilation_verification"
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
# To run a task from a local machine
|
|
|
|
mkdir <<task_name>>/config
|
|
|
|
vi <<task_name>>/config/task.config # Create your task configuration
|
|
|
|
TASK_NAME=<<task_name>> docker run -it -v ${PWD}/${TASK_NAME}:/opt/openfpga/openfpga_flow/tasks/${TASK_NAME} ghcr.io/lnis-uofu/openfpga-master:latest bash -c "source openfpga.sh && run-task ${TASK_NAME}"
|
2020-03-09 14:58:24 -05:00
|
|
|
|
2021-02-08 00:33:25 -06:00
|
|
|
.. note::
|
|
|
|
While running local task using docker, make sure all the additional files
|
2021-06-14 15:51:19 -05:00
|
|
|
are maintained in the task_directory and reference using variable ${TASK_DIR}
|