Merge pull request #15 from antmicro/xc7-cleanup

xc7 cleanup
This commit is contained in:
Karol Gugala 2020-06-09 22:57:39 +02:00 committed by GitHub
commit 823ce906cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 53 additions and 72 deletions

10
.gitattributes vendored
View file

@ -1,15 +1,7 @@
# Settings to improve linguist data reporting (used by GitHub)
*.v linguist-language=Verilog
*.vh linguist-language=Verilog
*.sql linguist-language=SQL
# FIXME: All vendor files should be under third_party
third_party/** linguist-vendored
counter_test/counter_basys3.v linguist-vendored
picosoc_demo/simpleuart.v linguist-vendored
picosoc_demo/picosoc_noflash.v linguist-vendored
picosoc_demo/basys3_demo_no_roi.v linguist-vendored
picosoc_demo/progmem.v linguist-vendored
picosoc_demo/picorv32.v linguist-vendored
linux_litex_demo/baselitex_arty.v linguist-vendored
linux_litex_demo/VexRiscv_Linux.v linguist-vendored
examples/** linguist-vendored

View file

@ -10,15 +10,22 @@ addons:
- wget
- locales
stages:
- xc7
before_install:
- sudo locale-gen "en_US.UTF-8"
- export LANG="en_US.UTF-8"
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
install:
- export 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
jobs:
include:
- stage: SymbiFlow
env:
- INSTALL_DIR: /opt/symbiflow/xc7
install:
- bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.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 vtr-no-gui
@ -27,17 +34,10 @@ install:
- pip install python-constraint
- pip install git+https://github.com/symbiflow/fasm
- conda deactivate
script:
- export INSTALL_DIR=/opt/symbiflow
- # adding symbiflow toolchain binaries to PATH
script:
- source "$INSTALL_DIR/conda/etc/profile.d/conda.sh"
- 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
- pushd examples/xc7/counter_test && make && popd
- pushd examples/xc7/picosoc_demo && make && popd
- pushd examples/xc7/linux_litex_demo && make && popd

View file

@ -1,51 +1,42 @@
# SymbiFlow examples
This repository provides example FPGA designs that can be built using SymbiFlow open source toolchain.
The examples target the Artix-7 devices.
This repository provides example FPGA designs that can be built using the SymbiFlow open source toolchain.
The examples target the Xilinx 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:
* [examples](./examples) - 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:
* [Miniconda](https://docs.conda.io/en/latest/miniconda.html) installation and configuration
* Installation of the required conda packages (toolchains and Python modules). Note that Python packages can be installed using any Python package manager:
* [VTR](https://anaconda.org/symbiflow/vtr)
* [Yosys](https://anaconda.org/symbiflow/yosys)
* [Yosys-plugins](https://anaconda.org/symbiflow/yosys-plugins)
* [lxml](https://anaconda.org/conda-forge/lxml), [simplejson](https://anaconda.org/conda-forge/simplejson), [intervaltree](https://anaconda.org/conda-forge/intervaltree), [python-constraint](https://anaconda.org/conda-forge/python-constraint), [git](https://anaconda.org/conda-forge/git), [pip](https://anaconda.org/conda-forge/pip) and [fasm](https://github.com/SymbiFlow/fasm)
* [.travis.yml](.travis.yml) - Travis CI configuration file
## Toolchain installation
This block of code regards the toolchain installation. It is divided in three main steps:
This section describes how to install the toolchain. This procedure is divided in two steps:
- Conda setup
- Conda packages installation
- Architecture definitions installation
- Installing the Conda package manager
- Downloading the architecture definitions and installing the toolchain
1. Conda
```bash
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
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
```
2. Toolchain
For the Artix-7 devices:
```bash
INSTALL_DIR="/opt/symbiflow/xc7"
bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.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 vtr-no-gui
conda install -y make lxml simplejson intervaltree git pip
@ -58,29 +49,32 @@ 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](https://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/) .
* `examples/xc7` directory for the Artix-7 devices
### Example designs for the Artix-7 devices:
1. `counter` - simple 4-bit counter driving LEDs. The design targets the [Basys3 board](https://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/)
1. `picosoc` - [picorv32](https://github.com/cliffordwolf/picorv32) based SoC. The design targets the [Basys3 board](https://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/).
1. `linux_litex` - [LiteX](https://github.com/enjoy-digital/litex) based system with Linux capable [VexRiscv core](https://github.com/SpinalHDL/VexRiscv). The design includes [DDR](https://github.com/enjoy-digital/litedram) and [Ethernet](https://github.com/enjoy-digital/liteeth) controllers. The design targets the [Arty board](https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/).
The Linux images for the `linux_litex` example can be build following the [linux on litex vexriscv](https://github.com/litex-hub/linux-on-litex-vexriscv) instructions.
The Linux images for the `linux_litex` example can be built following the [linux on litex vexriscv](https://github.com/litex-hub/linux-on-litex-vexriscv) instructions.
The `linux_litex` example is already provided with working Linux images.
To build the examples, run following commands:
To build the examples, run the following commands:
```bash
export INSTALL_DIR=/opt/symbiflow
export INSTALL_DIR="/opt/symbiflow/xc7"
# adding symbiflow toolchain binaries to PATH
export PATH=$INSTALL_DIR/install/bin:$PATH
source $INSTALL_DIR/conda/etc/profile.d/conda.sh
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
pushd examples/xc7/counter_test && make && popd
# picosoc example
pushd picosoc_demo && make && popd
pushd examples/xc7/picosoc_demo && make && popd
# litex example
pushd linux_litex_demo && make && popd
pushd examples/xc7/linux_litex_demo && make && popd
```

View file

@ -1,5 +0,0 @@
lxml
simplejson
intervaltree
python-constraint
git+https://github.com/symbiflow/fasm

View file

@ -1,7 +1,7 @@
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
TOP:=top
VERILOG:=${current_dir}/counter_basys3.v
VERILOG:=${current_dir}/counter.v
PARTNAME:= xc7a35tcpg236-1
DEVICE := xc7a50t_test
BITSTREAM_DEVICE := artix7