2020-09-09 03:38:20 -04:00
|
|
|
SymbiFlow examples
|
|
|
|
==================
|
|
|
|
|
|
|
|
This repository provides example FPGA designs that can be built using the SymbiFlow open source toolchain.
|
|
|
|
The examples target the Xilinx Artix-7 and the QuickLogic EOS S3 devices.
|
|
|
|
|
|
|
|
The repository includes:
|
|
|
|
|
|
|
|
* `eos-s3 </eos-s3>`_ - Example FPGA designs for the QuickLogic EOS S3 series of parts:
|
|
|
|
|
|
|
|
* Verilog code
|
|
|
|
* Pin constraints files
|
|
|
|
* Timing constraints files
|
|
|
|
* Makefiles for running the SymbiFlow toolchain
|
|
|
|
|
|
|
|
* `xc7 </xc7>`_ - Example FPGA designs for the Xilinx 7 series of parts:
|
|
|
|
|
|
|
|
* Verilog code
|
|
|
|
* Pin constraints files
|
|
|
|
* Timing constraints files
|
|
|
|
* Makefiles for running the SymbiFlow toolchain
|
|
|
|
|
|
|
|
* `.travis.yml <.travis.yml>`_ - Travis CI configuration file
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
Clone this repository
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
If you have not already done so, clone this repository and ``cd`` into it:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
sudo apt install git
|
|
|
|
git clone https://github.com/SymbiFlow/symbiflow-examples.git && cd symbiflow-examples
|
|
|
|
|
|
|
|
|
2020-09-22 08:45:16 -04:00
|
|
|
Prerequisites
|
|
|
|
-------------
|
|
|
|
The only required prerequisite is ``wget``. You can install it using:
|
|
|
|
|
|
|
|
* For Ubuntu:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-28 03:02:13 -04:00
|
|
|
:name: install-wget-ubuntu
|
2020-09-22 08:45:16 -04:00
|
|
|
|
|
|
|
apt update && apt install -y wget
|
|
|
|
|
|
|
|
* For CentOS:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-28 03:02:13 -04:00
|
|
|
:name: install-wget-centos
|
2020-09-22 08:45:16 -04:00
|
|
|
|
|
|
|
yum install -y wget
|
|
|
|
|
2020-09-09 03:38:20 -04:00
|
|
|
Toolchain installation
|
|
|
|
----------------------
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
This section describes how to install the toolchain. This procedure is divided in three steps:
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
- Installing the Conda package manager
|
2020-09-18 01:54:05 -04:00
|
|
|
- Choosing an installation directory
|
2020-09-09 03:38:20 -04:00
|
|
|
- Downloading the architecture definitions and installing the toolchain
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
1. Conda
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
:name: wget-conda
|
|
|
|
|
|
|
|
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
|
|
|
|
|
|
|
|
2. Choose the install directory
|
|
|
|
|
|
|
|
The install directory can either be in your home directory
|
2020-09-23 17:31:51 -04:00
|
|
|
such as ``~/opt/symbiflow`` or in a system directory such as ``/opt/symbiflow``.
|
2020-09-18 01:54:05 -04:00
|
|
|
If you choose a system directory, you will need root permission to perform the installation,
|
2020-09-23 17:31:51 -04:00
|
|
|
and so you will need to add some ``sudo`` commands to the instructions below.
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
INSTALL_DIR=~/opt/symbiflow
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
3. Toolchain
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
* For the Artix-7 devices:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-setup-toolchain
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
bash conda_installer.sh -b -p $INSTALL_DIR/xc7/conda
|
|
|
|
source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh"
|
|
|
|
conda env create -f xc7/environment.yml
|
|
|
|
conda activate xc7
|
2020-11-22 16:34:19 -05:00
|
|
|
mkdir -p $INSTALL_DIR/xc7/install
|
2020-11-24 06:53:07 -05:00
|
|
|
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/1049/20201123-030526/symbiflow-arch-defs-install-05bd35c7.tar.xz | tar -xJC $INSTALL_DIR/xc7/install
|
|
|
|
mkdir -p $INSTALL_DIR/xc7/install/share/symbiflow/arch
|
|
|
|
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/1049/20201123-030526/symbiflow-xc7a50t_test.tar.xz | tar -xJC $INSTALL_DIR/xc7/install/share/symbiflow/arch
|
|
|
|
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/1049/20201123-030526/symbiflow-xc7a100t_test.tar.xz | tar -xJC $INSTALL_DIR/xc7/install/share/symbiflow/arch
|
2020-09-24 14:11:34 -04:00
|
|
|
conda deactivate
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
* For the EOS S3 devices:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-28 09:59:30 -04:00
|
|
|
:name: eos-s3-setup-toolchain
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
bash conda_installer.sh -b -p $INSTALL_DIR/eos-s3/conda
|
|
|
|
source "$INSTALL_DIR/eos-s3/conda/etc/profile.d/conda.sh"
|
|
|
|
conda env create -f eos-s3/environment.yml
|
|
|
|
conda activate eos-s3
|
2020-09-28 03:02:13 -04:00
|
|
|
wget -qO- https://quicklogic-my.sharepoint.com/:u:/p/kkumar/EWuqtXJmalROpI2L5XeewMIBRYVCY8H4yc10nlli-Xq79g?download=1 | tar -xJ -C $INSTALL_DIR/eos-s3/
|
2020-09-24 14:11:34 -04:00
|
|
|
conda deactivate
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
Build Example Designs
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
With the toolchain installed, you can build the example designs.
|
|
|
|
The example designs are provided in separate directories:
|
|
|
|
|
|
|
|
* ``xc7`` directory for the Artix-7 devices
|
|
|
|
* ``eos-s3`` directory for the EOS S3 devices
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
|
|
|
|
|
2020-09-09 03:38:20 -04:00
|
|
|
Example designs for the Artix-7 devices:
|
|
|
|
****************************************
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
Before building any example, set the installation directory to match what you set it to earlier,
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
export INSTALL_DIR=~/opt/symbiflow
|
|
|
|
|
|
|
|
and prepare the environment:
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-prepare-env
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
# adding symbiflow toolchain binaries to PATH
|
|
|
|
export PATH="$INSTALL_DIR/xc7/install/bin:$PATH"
|
|
|
|
source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh"
|
|
|
|
conda activate xc7
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
To build the counter example, run any or all of the following commands:
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-counter
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-10-13 19:21:28 -04:00
|
|
|
pushd xc7/counter_test && make clean && TARGET="arty_35" make && popd
|
2020-09-24 14:11:34 -04:00
|
|
|
pushd xc7/counter_test && make clean && TARGET="arty_100" make && popd
|
|
|
|
pushd xc7/counter_test && make clean && TARGET="basys3" make && popd
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
To build the picosoc example, run the following commands:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-picosoc
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
pushd xc7/picosoc_demo && make && popd
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
To build the litex example, run the following commands:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-litex
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
|
|
|
|
chmod +x litex_setup.py
|
|
|
|
./litex_setup.py init
|
|
|
|
./litex_setup.py install
|
|
|
|
wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2019.01.0-x86_64-linux-ubuntu14.tar.gz
|
|
|
|
tar -xf riscv64-unknown-elf-gcc-8.1.0-2019.01.0-x86_64-linux-ubuntu14.tar.gz
|
|
|
|
export PATH=$PATH:$PWD/riscv64-unknown-elf-gcc-8.1.0-2019.01.0-x86_64-linux-ubuntu14/bin/
|
2020-11-23 06:16:04 -05:00
|
|
|
pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --sys-clk-freq 80e6 --no-ident-version --build && popd
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
To build the linux-litex-demo example, run the following commands:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-24 14:11:34 -04:00
|
|
|
:name: xc7-linux
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
pushd xc7/linux_litex_demo && make && popd
|
|
|
|
pushd xc7/linux_litex_demo && TARGET="arty_100" make && popd
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
Example design for the EOS S3 devices:
|
|
|
|
**************************************
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
Before building any example, set the installation directory to match what you set it to earlier,
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-09-18 01:54:05 -04:00
|
|
|
export INSTALL_DIR=~/opt/symbiflow
|
|
|
|
|
|
|
|
and prepare the environment:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-28 09:59:30 -04:00
|
|
|
:name: eos-s3-prepare-env
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
export PATH="$INSTALL_DIR/eos-s3/install/bin:$PATH"
|
|
|
|
source "$INSTALL_DIR/eos-s3/conda/etc/profile.d/conda.sh"
|
|
|
|
conda activate eos-s3
|
2020-09-09 03:38:20 -04:00
|
|
|
|
|
|
|
To build the example, run the following command:
|
|
|
|
|
|
|
|
.. code:: bash
|
2020-09-28 09:59:30 -04:00
|
|
|
:name: eos-s3-counter
|
2020-09-09 03:38:20 -04:00
|
|
|
|
2020-09-24 14:11:34 -04:00
|
|
|
pushd eos-s3/btn_counter && make && popd
|
2020-09-09 03:38:20 -04:00
|
|
|
|