f4pga-examples/README.md

4.1 KiB

SymbiFlow examples

This repository provides example FPGA designs that can be built using SymbiFlow open source toolchain. The examples target the Artix-7 devices.

The repository includes:

  • Travis CI configuration file

  • Build scripts to generate the environment:

    • Conda configurations
    • Python requirements
    • Environment setup
  • Example FPGA designs including:

    • Verilog code
    • Pin constraints files
    • Timing constraints files
    • Makefiles for running the SymbiFlow toolchain

Description

Travis-based CI in this repository runs all the steps required to build the example designs and generate bitstreams for programming the FPGA devices.

The CI performs the following steps:

Toolchain installation

This block of code regards the toolchain installation. It is divided in three main steps:

  • Conda setup
  • Conda packages installation
  • Architecture definitions installation
INSTALL_DIR=/opt/symbiflow
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $INSTALL_DIR/conda && rm Miniconda3-latest-Linux-x86_64.sh
source $INSTALL_DIR/conda/etc/profile.d/conda.sh
conda update -y -q conda
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/4/20200416-002215/symbiflow-arch-defs-install-a321d9d9.tar.xz | tar -xJ -C $INSTALL_DIR
conda install -y -c symbiflow yosys yosys-plugins
conda install -y -c symbiflow -c conda-forge vtr=8.0.0.rc2_3575_g253f75b6d
conda install -y make lxml simplejson intervaltree git pip
conda activate
pip install python-constraint
pip install git+https://github.com/symbiflow/fasm
conda deactivate

Build Example Designs

With the toolchain installed, you can build the example designs.

The example designs are provided in separate directories:

  1. counter - simple 4-bit counter driving LEDs. The design targets the Basys3 board .
  2. picosoc - picorv32 based SoC. The design targets the Basys3 board.
  3. linux_litex - LiteX based system with Linux capable VexRiscv core. The design includes DDR and Ethernet controllers. The design targets the Arty board.

The Linux images for the linux_litex example can be build following the linux on litex vexriscv instructions. The linux_litex example is already provided with working Linux images.

To build the examples, run following commands:

export INSTALL_DIR=/opt/symbiflow
# adding symbiflow toolchain binaries to PATH
export PATH=$INSTALL_DIR/install/bin:$PATH
source $INSTALL_DIR/conda/etc/profile.d/conda.sh
conda activate
git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples
# counter example
pushd counter_test && make && popd
# picosoc example
pushd picosoc_demo && make && popd
# litex example
pushd linux_litex_demo && make && popd