From 7b623cdfdf052d6eca2ee1ab74f1926751a4bf53 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 29 Jul 2020 12:19:34 -0700 Subject: [PATCH 1/4] Remove the extra examples directory. Signed-off-by: Tim 'mithro' Ansell --- README.md | 27 +++++++++++------- {examples/eos-s3 => eos-s3}/Makefile | 0 {examples/eos-s3 => eos-s3}/btn_counter.v | 0 {examples/eos-s3 => eos-s3}/chandalar.pcf | 0 {examples/eos-s3 => eos-s3}/environment.yml | 0 {examples/eos-s3 => eos-s3}/quickfeather.pcf | 0 {examples/eos-s3 => eos-s3}/requirements.txt | 0 {examples/xc7 => xc7}/counter_test/Makefile | 0 {examples/xc7 => xc7}/counter_test/arty.pcf | 0 {examples/xc7 => xc7}/counter_test/basys3.pcf | 0 .../xc7 => xc7}/counter_test/counter.sdc | 0 {examples/xc7 => xc7}/counter_test/counter.v | 0 {examples/xc7 => xc7}/environment.yml | 0 .../xc7 => xc7}/linux_litex_demo/Makefile | 0 .../linux_litex_demo/VexRiscv_Linux.v | 0 .../xc7 => xc7}/linux_litex_demo/arty.pcf | 0 .../xc7 => xc7}/linux_litex_demo/arty.sdc | 0 .../xc7 => xc7}/linux_litex_demo/arty.xdc | 0 .../linux_litex_demo/baselitex_arty.v | 0 .../linux_litex_demo/buildroot/Image | Bin .../linux_litex_demo/buildroot/rootfs.cpio | Bin .../linux_litex_demo/buildroot/rv32.dtb | Bin .../linux_litex_demo/emulator/emulator.bin | Bin .../xc7 => xc7}/linux_litex_demo/mem.init | 0 .../xc7 => xc7}/linux_litex_demo/mem_1.init | 0 .../xc7 => xc7}/linux_litex_demo/mem_2.init | 0 {examples/xc7 => xc7}/picosoc_demo/Makefile | 0 {examples/xc7 => xc7}/picosoc_demo/basys3.pcf | 0 {examples/xc7 => xc7}/picosoc_demo/basys3.sdc | 0 .../picosoc_demo/basys3_demo_no_roi.v | 0 {examples/xc7 => xc7}/picosoc_demo/picorv32.v | 0 .../picosoc_demo/picosoc_noflash.v | 0 {examples/xc7 => xc7}/picosoc_demo/progmem.v | 0 .../xc7 => xc7}/picosoc_demo/simpleuart.v | 0 {examples/xc7 => xc7}/requirements.txt | 0 35 files changed, 17 insertions(+), 10 deletions(-) rename {examples/eos-s3 => eos-s3}/Makefile (100%) rename {examples/eos-s3 => eos-s3}/btn_counter.v (100%) rename {examples/eos-s3 => eos-s3}/chandalar.pcf (100%) rename {examples/eos-s3 => eos-s3}/environment.yml (100%) rename {examples/eos-s3 => eos-s3}/quickfeather.pcf (100%) rename {examples/eos-s3 => eos-s3}/requirements.txt (100%) rename {examples/xc7 => xc7}/counter_test/Makefile (100%) rename {examples/xc7 => xc7}/counter_test/arty.pcf (100%) rename {examples/xc7 => xc7}/counter_test/basys3.pcf (100%) rename {examples/xc7 => xc7}/counter_test/counter.sdc (100%) rename {examples/xc7 => xc7}/counter_test/counter.v (100%) rename {examples/xc7 => xc7}/environment.yml (100%) rename {examples/xc7 => xc7}/linux_litex_demo/Makefile (100%) rename {examples/xc7 => xc7}/linux_litex_demo/VexRiscv_Linux.v (100%) rename {examples/xc7 => xc7}/linux_litex_demo/arty.pcf (100%) rename {examples/xc7 => xc7}/linux_litex_demo/arty.sdc (100%) rename {examples/xc7 => xc7}/linux_litex_demo/arty.xdc (100%) rename {examples/xc7 => xc7}/linux_litex_demo/baselitex_arty.v (100%) rename {examples/xc7 => xc7}/linux_litex_demo/buildroot/Image (100%) rename {examples/xc7 => xc7}/linux_litex_demo/buildroot/rootfs.cpio (100%) rename {examples/xc7 => xc7}/linux_litex_demo/buildroot/rv32.dtb (100%) rename {examples/xc7 => xc7}/linux_litex_demo/emulator/emulator.bin (100%) rename {examples/xc7 => xc7}/linux_litex_demo/mem.init (100%) rename {examples/xc7 => xc7}/linux_litex_demo/mem_1.init (100%) rename {examples/xc7 => xc7}/linux_litex_demo/mem_2.init (100%) rename {examples/xc7 => xc7}/picosoc_demo/Makefile (100%) rename {examples/xc7 => xc7}/picosoc_demo/basys3.pcf (100%) rename {examples/xc7 => xc7}/picosoc_demo/basys3.sdc (100%) rename {examples/xc7 => xc7}/picosoc_demo/basys3_demo_no_roi.v (100%) rename {examples/xc7 => xc7}/picosoc_demo/picorv32.v (100%) rename {examples/xc7 => xc7}/picosoc_demo/picosoc_noflash.v (100%) rename {examples/xc7 => xc7}/picosoc_demo/progmem.v (100%) rename {examples/xc7 => xc7}/picosoc_demo/simpleuart.v (100%) rename {examples/xc7 => xc7}/requirements.txt (100%) diff --git a/README.md b/README.md index 2e58b5c..e2b1d5f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,14 @@ The examples target the Xilinx Artix-7 and the QuickLogic EOS S3 devices. The repository includes: -* [examples](./examples) - Example FPGA designs including: +* [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 @@ -35,7 +42,7 @@ For the Artix-7 devices: 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 env create -f examples/xc7/environment.yml +conda env create -f xc7/environment.yml conda activate xc7 wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install conda deactivate @@ -54,8 +61,8 @@ bash Symbiflow_v1.1.0.gz.run With the toolchain installed, you can build the example designs. The example designs are provided in separate directories: -* `examples/xc7` directory for the Artix-7 devices -* `examples/eos-s3` directory for the EOS S3 devices +* `xc7` directory for the Artix-7 devices +* `eos-s3` directory for the EOS S3 devices ### Example designs for the Artix-7 devices: @@ -76,11 +83,11 @@ source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" conda activate xc7 git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples # counter example -pushd examples/xc7/counter_test && TARGET="arty_50" make && popd -pushd examples/xc7/counter_test && TARGET="arty_100" make && popd -pushd examples/xc7/counter_test && make clean && TARGET="basys3" make && popd +pushd xc7/counter_test && TARGET="arty_50" make && popd +pushd xc7/counter_test && TARGET="arty_100" make && popd +pushd xc7/counter_test && make clean && TARGET="basys3" make && popd # picosoc example -pushd examples/xc7/picosoc_demo && make && popd +pushd xc7/picosoc_demo && make && popd # litex example wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py chmod +x litex_setup.py @@ -91,7 +98,7 @@ 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/ pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd # linux litex example -pushd examples/xc7/linux_litex_demo && make && popd +pushd xc7/linux_litex_demo && make && popd ``` ### Example design for the EOS S3 devices: @@ -107,5 +114,5 @@ source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" conda activate git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples -pushd examples/eos-s3 && make && popd +pushd eos-s3 && make && popd ``` diff --git a/examples/eos-s3/Makefile b/eos-s3/Makefile similarity index 100% rename from examples/eos-s3/Makefile rename to eos-s3/Makefile diff --git a/examples/eos-s3/btn_counter.v b/eos-s3/btn_counter.v similarity index 100% rename from examples/eos-s3/btn_counter.v rename to eos-s3/btn_counter.v diff --git a/examples/eos-s3/chandalar.pcf b/eos-s3/chandalar.pcf similarity index 100% rename from examples/eos-s3/chandalar.pcf rename to eos-s3/chandalar.pcf diff --git a/examples/eos-s3/environment.yml b/eos-s3/environment.yml similarity index 100% rename from examples/eos-s3/environment.yml rename to eos-s3/environment.yml diff --git a/examples/eos-s3/quickfeather.pcf b/eos-s3/quickfeather.pcf similarity index 100% rename from examples/eos-s3/quickfeather.pcf rename to eos-s3/quickfeather.pcf diff --git a/examples/eos-s3/requirements.txt b/eos-s3/requirements.txt similarity index 100% rename from examples/eos-s3/requirements.txt rename to eos-s3/requirements.txt diff --git a/examples/xc7/counter_test/Makefile b/xc7/counter_test/Makefile similarity index 100% rename from examples/xc7/counter_test/Makefile rename to xc7/counter_test/Makefile diff --git a/examples/xc7/counter_test/arty.pcf b/xc7/counter_test/arty.pcf similarity index 100% rename from examples/xc7/counter_test/arty.pcf rename to xc7/counter_test/arty.pcf diff --git a/examples/xc7/counter_test/basys3.pcf b/xc7/counter_test/basys3.pcf similarity index 100% rename from examples/xc7/counter_test/basys3.pcf rename to xc7/counter_test/basys3.pcf diff --git a/examples/xc7/counter_test/counter.sdc b/xc7/counter_test/counter.sdc similarity index 100% rename from examples/xc7/counter_test/counter.sdc rename to xc7/counter_test/counter.sdc diff --git a/examples/xc7/counter_test/counter.v b/xc7/counter_test/counter.v similarity index 100% rename from examples/xc7/counter_test/counter.v rename to xc7/counter_test/counter.v diff --git a/examples/xc7/environment.yml b/xc7/environment.yml similarity index 100% rename from examples/xc7/environment.yml rename to xc7/environment.yml diff --git a/examples/xc7/linux_litex_demo/Makefile b/xc7/linux_litex_demo/Makefile similarity index 100% rename from examples/xc7/linux_litex_demo/Makefile rename to xc7/linux_litex_demo/Makefile diff --git a/examples/xc7/linux_litex_demo/VexRiscv_Linux.v b/xc7/linux_litex_demo/VexRiscv_Linux.v similarity index 100% rename from examples/xc7/linux_litex_demo/VexRiscv_Linux.v rename to xc7/linux_litex_demo/VexRiscv_Linux.v diff --git a/examples/xc7/linux_litex_demo/arty.pcf b/xc7/linux_litex_demo/arty.pcf similarity index 100% rename from examples/xc7/linux_litex_demo/arty.pcf rename to xc7/linux_litex_demo/arty.pcf diff --git a/examples/xc7/linux_litex_demo/arty.sdc b/xc7/linux_litex_demo/arty.sdc similarity index 100% rename from examples/xc7/linux_litex_demo/arty.sdc rename to xc7/linux_litex_demo/arty.sdc diff --git a/examples/xc7/linux_litex_demo/arty.xdc b/xc7/linux_litex_demo/arty.xdc similarity index 100% rename from examples/xc7/linux_litex_demo/arty.xdc rename to xc7/linux_litex_demo/arty.xdc diff --git a/examples/xc7/linux_litex_demo/baselitex_arty.v b/xc7/linux_litex_demo/baselitex_arty.v similarity index 100% rename from examples/xc7/linux_litex_demo/baselitex_arty.v rename to xc7/linux_litex_demo/baselitex_arty.v diff --git a/examples/xc7/linux_litex_demo/buildroot/Image b/xc7/linux_litex_demo/buildroot/Image similarity index 100% rename from examples/xc7/linux_litex_demo/buildroot/Image rename to xc7/linux_litex_demo/buildroot/Image diff --git a/examples/xc7/linux_litex_demo/buildroot/rootfs.cpio b/xc7/linux_litex_demo/buildroot/rootfs.cpio similarity index 100% rename from examples/xc7/linux_litex_demo/buildroot/rootfs.cpio rename to xc7/linux_litex_demo/buildroot/rootfs.cpio diff --git a/examples/xc7/linux_litex_demo/buildroot/rv32.dtb b/xc7/linux_litex_demo/buildroot/rv32.dtb similarity index 100% rename from examples/xc7/linux_litex_demo/buildroot/rv32.dtb rename to xc7/linux_litex_demo/buildroot/rv32.dtb diff --git a/examples/xc7/linux_litex_demo/emulator/emulator.bin b/xc7/linux_litex_demo/emulator/emulator.bin similarity index 100% rename from examples/xc7/linux_litex_demo/emulator/emulator.bin rename to xc7/linux_litex_demo/emulator/emulator.bin diff --git a/examples/xc7/linux_litex_demo/mem.init b/xc7/linux_litex_demo/mem.init similarity index 100% rename from examples/xc7/linux_litex_demo/mem.init rename to xc7/linux_litex_demo/mem.init diff --git a/examples/xc7/linux_litex_demo/mem_1.init b/xc7/linux_litex_demo/mem_1.init similarity index 100% rename from examples/xc7/linux_litex_demo/mem_1.init rename to xc7/linux_litex_demo/mem_1.init diff --git a/examples/xc7/linux_litex_demo/mem_2.init b/xc7/linux_litex_demo/mem_2.init similarity index 100% rename from examples/xc7/linux_litex_demo/mem_2.init rename to xc7/linux_litex_demo/mem_2.init diff --git a/examples/xc7/picosoc_demo/Makefile b/xc7/picosoc_demo/Makefile similarity index 100% rename from examples/xc7/picosoc_demo/Makefile rename to xc7/picosoc_demo/Makefile diff --git a/examples/xc7/picosoc_demo/basys3.pcf b/xc7/picosoc_demo/basys3.pcf similarity index 100% rename from examples/xc7/picosoc_demo/basys3.pcf rename to xc7/picosoc_demo/basys3.pcf diff --git a/examples/xc7/picosoc_demo/basys3.sdc b/xc7/picosoc_demo/basys3.sdc similarity index 100% rename from examples/xc7/picosoc_demo/basys3.sdc rename to xc7/picosoc_demo/basys3.sdc diff --git a/examples/xc7/picosoc_demo/basys3_demo_no_roi.v b/xc7/picosoc_demo/basys3_demo_no_roi.v similarity index 100% rename from examples/xc7/picosoc_demo/basys3_demo_no_roi.v rename to xc7/picosoc_demo/basys3_demo_no_roi.v diff --git a/examples/xc7/picosoc_demo/picorv32.v b/xc7/picosoc_demo/picorv32.v similarity index 100% rename from examples/xc7/picosoc_demo/picorv32.v rename to xc7/picosoc_demo/picorv32.v diff --git a/examples/xc7/picosoc_demo/picosoc_noflash.v b/xc7/picosoc_demo/picosoc_noflash.v similarity index 100% rename from examples/xc7/picosoc_demo/picosoc_noflash.v rename to xc7/picosoc_demo/picosoc_noflash.v diff --git a/examples/xc7/picosoc_demo/progmem.v b/xc7/picosoc_demo/progmem.v similarity index 100% rename from examples/xc7/picosoc_demo/progmem.v rename to xc7/picosoc_demo/progmem.v diff --git a/examples/xc7/picosoc_demo/simpleuart.v b/xc7/picosoc_demo/simpleuart.v similarity index 100% rename from examples/xc7/picosoc_demo/simpleuart.v rename to xc7/picosoc_demo/simpleuart.v diff --git a/examples/xc7/requirements.txt b/xc7/requirements.txt similarity index 100% rename from examples/xc7/requirements.txt rename to xc7/requirements.txt From a240eda9c72f5bf32adec733bb68f5633e38ef6d Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 29 Jul 2020 12:22:42 -0700 Subject: [PATCH 2/4] FIXME: WIP changes. Signed-off-by: Tim 'mithro' Ansell --- README.md | 7 +++++++ eos-s3/README.md | 11 +++++++++++ xc7/README.md | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 eos-s3/README.md create mode 100644 xc7/README.md diff --git a/README.md b/README.md index e2b1d5f..84dc9ad 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O co 2. Toolchain +FIXME: This should be included from xc7/README.md + For the Artix-7 devices: ```bash @@ -48,6 +50,8 @@ wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss conda deactivate ``` +FIXME: This should be included from eos-s3/README.md + For the EOS S3 devices: ```bash @@ -66,6 +70,7 @@ The example designs are provided in separate directories: ### 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/) and the [Arty board](https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/). 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/). @@ -103,6 +108,8 @@ pushd xc7/linux_litex_demo && make && popd ### Example design for the EOS S3 devices: +FIXME: This should be included from eos-s3/README.md + 1. `btn_counter` - simple 4-bit counter driving LEDs. The design targets the [EOS S3 FPGA](https://www.quicklogic.com/products/eos-s3/). To build the example, run the following commands: diff --git a/eos-s3/README.md b/eos-s3/README.md new file mode 100644 index 0000000..a2dc18a --- /dev/null +++ b/eos-s3/README.md @@ -0,0 +1,11 @@ +# SymbiFlow Toolchain Examples for QuickLogic EOS S3 + +FIXME: put stuff here + +## Setting up the toolchain + +FIXME: put stuff here + +## Building the examples + +FIXME: put stuff here diff --git a/xc7/README.md b/xc7/README.md new file mode 100644 index 0000000..a57036d --- /dev/null +++ b/xc7/README.md @@ -0,0 +1,11 @@ +# SymbiFlow Toolchain Examples for Xilinx 7 Series + +FIXME: put stuff here + +## Setting up the toolchain + +FIXME: put stuff here + +## Building the examples + +FIXME: put stuff here From 21390ff61ff4edde6776ef5ffe869d564ea6f485 Mon Sep 17 00:00:00 2001 From: Kamil Rakoczy Date: Mon, 7 Sep 2020 09:36:35 +0200 Subject: [PATCH 3/4] Update README.md files Signed-off-by: Kamil Rakoczy --- .travis.yml | 8 +-- README.md | 74 ++------------------------ eos-s3/README.md | 26 +++++++-- eos-s3/{ => btn_counter}/Makefile | 0 eos-s3/{ => btn_counter}/btn_counter.v | 0 eos-s3/{ => btn_counter}/chandalar.pcf | 0 eos-s3/environment.yml | 9 ++-- eos-s3/quickfeather.pcf | 5 -- eos-s3/requirements.txt | 4 +- xc7/README.md | 46 ++++++++++++++-- 10 files changed, 80 insertions(+), 92 deletions(-) rename eos-s3/{ => btn_counter}/Makefile (100%) rename eos-s3/{ => btn_counter}/btn_counter.v (100%) rename eos-s3/{ => btn_counter}/chandalar.pcf (100%) delete mode 100644 eos-s3/quickfeather.pcf diff --git a/.travis.yml b/.travis.yml index ab3c343..6293756 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,14 +20,14 @@ jobs: include: - stage: SymbiFlow install: - - tuttest README.md unnamed1 | bash - + - tuttest xc7/README.md unnamed0 | bash - script: - - tuttest README.md unnamed3 | bash - + - tuttest xc7/README.md unnamed1 | bash - - # install: - - tuttest README.md unnamed2 | bash - + - tuttest eos-s3/README.md unnamed0 | bash - script: - - tuttest README.md unnamed4 | bash - + - tuttest eos-s3/README.md unnamed1 | bash - diff --git a/README.md b/README.md index 84dc9ad..f0f1425 100644 --- a/README.md +++ b/README.md @@ -36,29 +36,10 @@ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O co 2. Toolchain -FIXME: This should be included from xc7/README.md +* For the Artix-7 devices see [xc7/README.md](xc7/README.md#setting-up-the-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 env create -f xc7/environment.yml -conda activate xc7 -wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install -conda deactivate -``` - -FIXME: This should be included from eos-s3/README.md - -For the EOS S3 devices: - -```bash -export INSTALL_DIR="/opt/symbiflow/eos-s3" -wget 'https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain/releases/download/v1.1.0/Symbiflow_v1.1.0.gz.run' -bash Symbiflow_v1.1.0.gz.run -``` +* For the EOS S3 devices see [eos-s3/README.md](eos-s3/README.md#setting-up-the-toolchain). ## Build Example Designs @@ -70,56 +51,9 @@ The example designs are provided in separate directories: ### 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/) and the [Arty board](https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/). -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 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 the following commands: - -```bash -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" -conda activate xc7 -git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples -# counter example -pushd xc7/counter_test && TARGET="arty_50" make && popd -pushd xc7/counter_test && TARGET="arty_100" make && popd -pushd xc7/counter_test && make clean && TARGET="basys3" make && popd -# picosoc example -pushd xc7/picosoc_demo && make && popd -# litex example -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/ -pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd -# linux litex example -pushd xc7/linux_litex_demo && make && popd -``` +* For the Artix-7 devices see [xc7/README.md](xc7/README.md#building-the-examples). ### Example design for the EOS S3 devices: -FIXME: This should be included from eos-s3/README.md +* For the EOS S3 devices see [eos-s3/README.md](eos-s3/README.md#building-the-examples). -1. `btn_counter` - simple 4-bit counter driving LEDs. The design targets the [EOS S3 FPGA](https://www.quicklogic.com/products/eos-s3/). - -To build the example, run the following commands: - -```bash -export INSTALL_DIR="/opt/symbiflow/eos-s3" -export PATH="$INSTALL_DIR/install/bin:$INSTALL_DIR/install/bin/python:$PATH" -source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" -conda activate - -git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples -pushd eos-s3 && make && popd -``` diff --git a/eos-s3/README.md b/eos-s3/README.md index a2dc18a..c4aed4f 100644 --- a/eos-s3/README.md +++ b/eos-s3/README.md @@ -1,11 +1,31 @@ # SymbiFlow Toolchain Examples for QuickLogic EOS S3 -FIXME: put stuff here +1. `btn_counter` - simple 4-bit counter driving LEDs. The design targets the [EOS S3 FPGA](https://www.quicklogic.com/products/eos-s3/). ## Setting up the toolchain -FIXME: put stuff here +```bash +export INSTALL_DIR="/opt/symbiflow/eos-s3" +bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh +source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" +conda env create -f eos-s3/environment.yml +conda activate eos-s3 +wget -qO- https://quicklogic-my.sharepoint.com/:u:/p/kkumar/Eb7341Bq-XRAukVQ6oQ6PrgB-qdFbrsrPEON1yTa4krFSA?download=1 | tar -xJ -C $INSTALL_DIR +cp -r $INSTALL_DIR/conda/envs/eos-s3/share/yosys/* $INSTALL_DIR/conda/envs/eos-s3/share/ +conda deactivate +``` ## Building the examples -FIXME: put stuff here +To build the examples, run the following commands: + +```bash +export INSTALL_DIR="/opt/symbiflow/eos-s3" +export PATH="$INSTALL_DIR/install/bin:$PATH" +source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" +conda activate eos-s3 + +git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples +pushd eos-s3/btn_counter && make && popd +``` + diff --git a/eos-s3/Makefile b/eos-s3/btn_counter/Makefile similarity index 100% rename from eos-s3/Makefile rename to eos-s3/btn_counter/Makefile diff --git a/eos-s3/btn_counter.v b/eos-s3/btn_counter/btn_counter.v similarity index 100% rename from eos-s3/btn_counter.v rename to eos-s3/btn_counter/btn_counter.v diff --git a/eos-s3/chandalar.pcf b/eos-s3/btn_counter/chandalar.pcf similarity index 100% rename from eos-s3/chandalar.pcf rename to eos-s3/btn_counter/chandalar.pcf diff --git a/eos-s3/environment.yml b/eos-s3/environment.yml index 1e43f56..f28ee91 100644 --- a/eos-s3/environment.yml +++ b/eos-s3/environment.yml @@ -1,10 +1,11 @@ name: eos-s3 channels: - - antmicro/label/ql + - conda-forge + - quicklogic-corp dependencies: - - antmicro/label/ql::yosys - - antmicro/label/ql::yosys-plugins - - antmicro/label/ql::vtr + - quicklogic-corp::yosys=0.6.0_0013_g2478b28 + - quicklogic-corp::yosys-plugins=0.1.0_0005_g6bbbc9b + - quicklogic-corp::vtr=v8.0.0_rc2_4006_g36a4d4b - make - lxml - simplejson diff --git a/eos-s3/quickfeather.pcf b/eos-s3/quickfeather.pcf deleted file mode 100644 index b9a2aef..0000000 --- a/eos-s3/quickfeather.pcf +++ /dev/null @@ -1,5 +0,0 @@ -set_io clk 63 -set_io led(0) 34 -set_io led(1) 39 -set_io led(2) 38 -set_io led(3) 25 diff --git a/eos-s3/requirements.txt b/eos-s3/requirements.txt index fc75d5e..3042694 100644 --- a/eos-s3/requirements.txt +++ b/eos-s3/requirements.txt @@ -1,4 +1,2 @@ python-constraint -git+https://github.com/symbiflow/fasm -git+https://github.com/antmicro/quicklogic-fasm -git+https://github.com/antmicro/quicklogic-fasm-utils +git+https://github.com/QuickLogic-Corp/quicklogic-fasm diff --git a/xc7/README.md b/xc7/README.md index a57036d..266dedb 100644 --- a/xc7/README.md +++ b/xc7/README.md @@ -1,11 +1,51 @@ # SymbiFlow Toolchain Examples for Xilinx 7 Series -FIXME: put stuff here +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/) and the [Arty board](https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/). +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 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. ## Setting up the toolchain -FIXME: put stuff here +```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 env create -f xc7/environment.yml +conda activate xc7 +wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install +conda deactivate +``` ## Building the examples -FIXME: put stuff here +To build the example, run the following commands: + +```bash +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" +conda activate xc7 +git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples +# counter example +pushd xc7/counter_test && make clean && TARGET="arty_50" make && popd +pushd xc7/counter_test && make clean && TARGET="arty_100" make && popd +pushd xc7/counter_test && make clean && TARGET="basys3" make && popd +# picosoc example +pushd xc7/picosoc_demo && make && popd +# litex example +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/ +pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd +# linux litex example +pushd xc7/linux_litex_demo && make && popd +``` + From 045dc79d4f89310f794f6f9b1ddff0c3cb88afa9 Mon Sep 17 00:00:00 2001 From: Kamil Rakoczy Date: Wed, 9 Sep 2020 09:38:20 +0200 Subject: [PATCH 4/4] Change README Markdown format to reStructuredText This commit is workaround for Github not rendering `.. include::`. This PR adds: - Adds Makefile for creating conda environment under `env/conda` and installs `rst_include` tool. - Adds make README.rst target to generate `README.rst` from `README.src.rst` - Has Travis CI run on repository and check that the `README.rst` file has been rebuilt and committed if any of the dependencies have change. Signed-off-by: Kamil Rakoczy --- .github/travis/common.sh | 30 ++++++++ .github/travis/git-check.sh | 27 +++++++ .travis.yml | 12 +-- Makefile | 5 ++ README.md | 59 --------------- README.rst | 145 ++++++++++++++++++++++++++++++++++++ README.src.rst | 80 ++++++++++++++++++++ environment.yml | 8 ++ eos-s3/README.md | 31 -------- eos-s3/README.rst | 46 ++++++++++++ requirements.txt | 1 + scripts/make/conda.mk | 97 ++++++++++++++++++++++++ xc7/README.md | 51 ------------- xc7/README.rst | 79 ++++++++++++++++++++ 14 files changed, 525 insertions(+), 146 deletions(-) create mode 100644 .github/travis/common.sh create mode 100755 .github/travis/git-check.sh create mode 100644 Makefile delete mode 100644 README.md create mode 100644 README.rst create mode 100644 README.src.rst create mode 100644 environment.yml delete mode 100644 eos-s3/README.md create mode 100644 eos-s3/README.rst create mode 100644 requirements.txt create mode 100644 scripts/make/conda.mk delete mode 100644 xc7/README.md create mode 100644 xc7/README.rst diff --git a/.github/travis/common.sh b/.github/travis/common.sh new file mode 100644 index 0000000..b827736 --- /dev/null +++ b/.github/travis/common.sh @@ -0,0 +1,30 @@ +# Some colors, use it like following; +# echo -e "Hello ${YELLOW}yellow${NC}" +GRAY=' \033[0;30m' +RED=' \033[0;31m' +GREEN=' \033[0;32m' +YELLOW=' \033[0;33m' +PURPLE=' \033[0;35m' +NC='\033[0m' # No Color + +SPACER="echo -e ${GRAY} - ${NC}" + +export -f travis_nanoseconds +export -f travis_fold +export -f travis_time_start +export -f travis_time_finish +export -f travis_wait +export -f travis_jigger + +function start_section() { + travis_fold start "$1" + travis_time_start + echo -e "${PURPLE}${1}${NC}: $2${NC}" + echo -e "${GRAY}-------------------------------------------------------------------${NC}" +} + +function end_section() { + echo -e "${GRAY}-------------------------------------------------------------------${NC}" + travis_time_finish + travis_fold end "$1" +} diff --git a/.github/travis/git-check.sh b/.github/travis/git-check.sh new file mode 100755 index 0000000..b88c2db --- /dev/null +++ b/.github/travis/git-check.sh @@ -0,0 +1,27 @@ +set -e + +source .github/travis/common.sh + +# Output any changes in the repository +# ------------------------------------------------------------------------ +start_section git-status "Current git status" + +git diff + +$SPACER + +git status + +end_section git-status + +# Check there are not changes in the repository +# ------------------------------------------------------------------------ +start_section git-check "Checking git repository isn't dirty" + +( + . "$(git --exec-path)/git-sh-setup" + + require_clean_work_tree "continue" "Please run ``make README.rst`` to generate correct ``README.rst``." +) + +end_section git-check diff --git a/.travis.yml b/.travis.yml index 6293756..89d4188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,20 +14,22 @@ addons: before_install: - sudo locale-gen "en_US.UTF-8" - export LANG="en_US.UTF-8" + - source .github/travis/common.sh + - rm README.rst && make README.rst && .github/travis/git-check.sh - pip install git+https://github.com/antmicro/tuttest - - tuttest README.md unnamed0 | bash - + - tuttest README.rst unnamed0 | bash - jobs: include: - stage: SymbiFlow install: - - tuttest xc7/README.md unnamed0 | bash - + - tuttest xc7/README.rst unnamed0 | bash - script: - - tuttest xc7/README.md unnamed1 | bash - + - tuttest xc7/README.rst unnamed1,unnamed2,unnamed3,unnamed4,unnamed5 | bash - - # install: - - tuttest eos-s3/README.md unnamed0 | bash - + - tuttest eos-s3/README.rst unnamed0 | bash - script: - - tuttest eos-s3/README.md unnamed1 | bash - + - tuttest eos-s3/README.rst unnamed1,unnamed2 | bash - diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..917c62a --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +include scripts/make/conda.mk + +README.rst: README.src.rst eos-s3/README.rst xc7/README.rst | $(CONDA_ENV_PYTHON) + @rm -f README.rst + $(IN_CONDA_ENV) rst_include include README.src.rst - > README.rst diff --git a/README.md b/README.md deleted file mode 100644 index f0f1425..0000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# 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 - -## Toolchain installation - -This section describes how to install the toolchain. This procedure is divided in two steps: - -- Installing the Conda package manager -- Downloading the architecture definitions and installing the toolchain - -1. Conda - -```bash -wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh -``` - -2. Toolchain - -* For the Artix-7 devices see [xc7/README.md](xc7/README.md#setting-up-the-toolchain). - - -* For the EOS S3 devices see [eos-s3/README.md](eos-s3/README.md#setting-up-the-toolchain). - -## 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 - -### Example designs for the Artix-7 devices: - -* For the Artix-7 devices see [xc7/README.md](xc7/README.md#building-the-examples). - -### Example design for the EOS S3 devices: - -* For the EOS S3 devices see [eos-s3/README.md](eos-s3/README.md#building-the-examples). - diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..660be00 --- /dev/null +++ b/README.rst @@ -0,0 +1,145 @@ +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 `_ - 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 `_ - 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 + +Toolchain installation +---------------------- + +This section describes how to install the toolchain. This procedure is divided in two steps: + +- Installing the Conda package manager +- Downloading the architecture definitions and installing the toolchain + +#. Conda + +.. code:: bash + + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh + +#. Toolchain + +* For the Artix-7 devices: + +.. code:: 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 env create -f xc7/environment.yml + conda activate xc7 + wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install + conda deactivate + +* For the EOS S3 devices: + +.. code:: bash + + export INSTALL_DIR="/opt/symbiflow/eos-s3" + bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh + source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" + conda env create -f eos-s3/environment.yml + conda activate eos-s3 + wget -qO- https://quicklogic-my.sharepoint.com/:u:/p/kkumar/Eb7341Bq-XRAukVQ6oQ6PrgB-qdFbrsrPEON1yTa4krFSA?download=1 | tar -xJ -C $INSTALL_DIR + cp -r $INSTALL_DIR/conda/envs/eos-s3/share/yosys/* $INSTALL_DIR/conda/envs/eos-s3/share/ + conda deactivate + +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 + +Example designs for the Artix-7 devices: +**************************************** + +* For the Artix-7 devices: + +Before building any example, prepare environment: + +.. code:: bash + + 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" + conda activate xc7 + git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples + +To build the counter example, run the following commands: + +.. code:: bash + + pushd xc7/counter_test && make clean && TARGET="arty_50" make && popd + pushd xc7/counter_test && make clean && TARGET="arty_100" make && popd + pushd xc7/counter_test && make clean && TARGET="basys3" make && popd + +To build the picosoc example, run the following commands: + +.. code:: bash + + pushd xc7/picosoc_demo && make && popd + +To build the litex example, run the following commands: + +.. code:: bash + + 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/ + pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd + +To build the linux-litex-demo example, run the following commands: + +.. code:: bash + + pushd xc7/linux_litex_demo && make && popd + +Example design for the EOS S3 devices: +************************************** + +* For the EOS S3 devices: + +Before building example, prepare environment: + +.. code:: bash + + export INSTALL_DIR="/opt/symbiflow/eos-s3" + export PATH="$INSTALL_DIR/install/bin:$PATH" + source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" + conda activate eos-s3 + + git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples + +To build the example, run the following command: + +.. code:: bash + + pushd eos-s3/btn_counter && make && popd + diff --git a/README.src.rst b/README.src.rst new file mode 100644 index 0000000..9162f09 --- /dev/null +++ b/README.src.rst @@ -0,0 +1,80 @@ +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 `_ - 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 `_ - 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 + +Toolchain installation +---------------------- + +This section describes how to install the toolchain. This procedure is divided in two steps: + +- Installing the Conda package manager +- Downloading the architecture definitions and installing the toolchain + +#. Conda + +.. code:: bash + + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh + +#. Toolchain + +* For the Artix-7 devices: + +.. include:: xc7/README.rst + :start-after:.. toolchain_include_begin_label + :end-before:.. toolchain_include_end_label + + +* For the EOS S3 devices: + +.. include:: eos-s3/README.rst + :start-after:.. toolchain_include_begin_label + :end-before:.. toolchain_include_end_label + +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 + +Example designs for the Artix-7 devices: +**************************************** + +* For the Artix-7 devices: + +.. include:: xc7/README.rst + :start-after:.. build_examples_include_begin_label + :end-before:.. build_examples_include_end_label + +Example design for the EOS S3 devices: +************************************** + +* For the EOS S3 devices: + +.. include:: eos-s3/README.rst + :start-after:.. build_examples_include_begin_label + :end-before:.. build_examples_include_end_label + diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..0fb71f6 --- /dev/null +++ b/environment.yml @@ -0,0 +1,8 @@ +name: symbiflow-examples +channels: + - defaults +dependencies: + - python + - pip + - pip: + - -r file:requirements.txt diff --git a/eos-s3/README.md b/eos-s3/README.md deleted file mode 100644 index c4aed4f..0000000 --- a/eos-s3/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# SymbiFlow Toolchain Examples for QuickLogic EOS S3 - -1. `btn_counter` - simple 4-bit counter driving LEDs. The design targets the [EOS S3 FPGA](https://www.quicklogic.com/products/eos-s3/). - -## Setting up the toolchain - -```bash -export INSTALL_DIR="/opt/symbiflow/eos-s3" -bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh -source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" -conda env create -f eos-s3/environment.yml -conda activate eos-s3 -wget -qO- https://quicklogic-my.sharepoint.com/:u:/p/kkumar/Eb7341Bq-XRAukVQ6oQ6PrgB-qdFbrsrPEON1yTa4krFSA?download=1 | tar -xJ -C $INSTALL_DIR -cp -r $INSTALL_DIR/conda/envs/eos-s3/share/yosys/* $INSTALL_DIR/conda/envs/eos-s3/share/ -conda deactivate -``` - -## Building the examples - -To build the examples, run the following commands: - -```bash -export INSTALL_DIR="/opt/symbiflow/eos-s3" -export PATH="$INSTALL_DIR/install/bin:$PATH" -source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" -conda activate eos-s3 - -git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples -pushd eos-s3/btn_counter && make && popd -``` - diff --git a/eos-s3/README.rst b/eos-s3/README.rst new file mode 100644 index 0000000..57b36c7 --- /dev/null +++ b/eos-s3/README.rst @@ -0,0 +1,46 @@ +SymbiFlow Toolchain Examples for QuickLogic EOS S3 +================================================== + +#. ``btn_counter`` - simple 4-bit counter driving LEDs. The design targets the `EOS S3 FPGA `__. + +Setting up the toolchain +------------------------ + +.. toolchain_include_begin_label + +.. code:: bash + + export INSTALL_DIR="/opt/symbiflow/eos-s3" + bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh + source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" + conda env create -f eos-s3/environment.yml + conda activate eos-s3 + wget -qO- https://quicklogic-my.sharepoint.com/:u:/p/kkumar/Eb7341Bq-XRAukVQ6oQ6PrgB-qdFbrsrPEON1yTa4krFSA?download=1 | tar -xJ -C $INSTALL_DIR + cp -r $INSTALL_DIR/conda/envs/eos-s3/share/yosys/* $INSTALL_DIR/conda/envs/eos-s3/share/ + conda deactivate + +.. toolchain_include_end_label + +Building the examples +--------------------- + +.. build_examples_include_begin_label + +Before building example, prepare environment: + +.. code:: bash + + export INSTALL_DIR="/opt/symbiflow/eos-s3" + export PATH="$INSTALL_DIR/install/bin:$PATH" + source "$INSTALL_DIR/conda/etc/profile.d/conda.sh" + conda activate eos-s3 + + git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples + +To build the example, run the following command: + +.. code:: bash + + pushd eos-s3/btn_counter && make && popd + +.. build_examples_include_end_label diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fa1f4f8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +rst_include diff --git a/scripts/make/conda.mk b/scripts/make/conda.mk new file mode 100644 index 0000000..26f0a42 --- /dev/null +++ b/scripts/make/conda.mk @@ -0,0 +1,97 @@ +SHELL := /bin/bash + +UNAME_S := $(shell uname -s) +ifneq (, $(findstring Linux, $(UNAME_S))) + OSFLAG := Linux +endif +ifeq ($(UNAME_S), Darwin) + OSFLAG := MacOSX +endif +ifneq (, $(findstring Cygwin, $(UNAME_S))) + OSFLAG := Linux +endif +ifneq (, $(findstring MINGW, $(UNAME_S))) + OSFLAG := Linux +endif + +MAKE_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +TOP_DIR := $(realpath $(MAKE_DIR)/../..) +ENV_DIR := $(TOP_DIR)/env +REQUIREMENTS_FILE := $(TOP_DIR)/requirements.txt +ENVIRONMENT_FILE := $(TOP_DIR)/environment.yml + +CONDA_DIR := $(ENV_DIR)/conda +DOWNLOADS_DIR := $(ENV_DIR)/downloads +CONDA_PYTHON := $(CONDA_DIR)/bin/python +CONDA_PKGS_DIR := $(DOWNLOADS_DIR)/conda-pkgs +CONDA_PKGS_DEP := $(CONDA_PKGS_DIR)/urls.txt +CONDA_ENV_NAME := symbiflow-examples +CONDA_ENV_PYTHON := $(CONDA_DIR)/envs/$(CONDA_ENV_NAME)/bin/python +IN_CONDA_ENV_BASE := source $(CONDA_DIR)/bin/activate && +IN_CONDA_ENV := $(IN_CONDA_ENV_BASE) conda activate $(CONDA_ENV_NAME) && + +$(ENV_DIR): | $(DOWNLOADS_DIR) + mkdir -p $(END_DIR) + +$(DOWNLOADS_DIR): + mkdir -p $(DOWNLOADS_DIR) + +$(DOWNLOADS_DIR)/Miniconda3-latest-$(OSFLAG)-x86_64.sh: | $(DOWNLOADS_DIR) + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-$(OSFLAG)-x86_64.sh -O $(DOWNLOADS_DIR)/Miniconda3-latest-$(OSFLAG)-x86_64.sh + chmod a+x $(DOWNLOADS_DIR)/Miniconda3-latest-$(OSFLAG)-x86_64.sh + +$(CONDA_PKGS_DEP): $(CONDA_PYTHON) + $(IN_CONDA_ENV_BASE) conda config --system --add pkgs_dirs $(CONDA_PKGS_DIR) + +$(CONDA_PYTHON): $(DOWNLOADS_DIR)/Miniconda3-latest-$(OSFLAG)-x86_64.sh + $(DOWNLOADS_DIR)/Miniconda3-latest-$(OSFLAG)-x86_64.sh -p $(CONDA_DIR) -b -f + touch $(CONDA_PYTHON) + +$(CONDA_DIR)/envs: $(CONDA_PYTHON) + $(IN_CONDA_ENV_BASE) conda config --system --add envs_dirs $(CONDA_DIR)/envs + +$(CONDA_ENV_PYTHON): $(ENVIRONMENT_FILE) $(REQUIREMENTS_FILE) | $(CONDA_PYTHON) $(CONDA_DIR)/envs $(CONDA_PKGS_DEP) + $(IN_CONDA_ENV_BASE) conda env update --name $(CONDA_ENV_NAME) --file $(ENVIRONMENT_FILE) + touch $(CONDA_ENV_PYTHON) + +env: $(CONDA_ENV_PYTHON) + $(IN_CONDA_ENV) conda info + +.PHONY: env + +enter: $(CONDA_ENV_PYTHON) + $(IN_CONDA_ENV) bash + +.PHONY: enter + +clean: + rm -rf env/conda + +.PHONY: clean + +dist-clean: + rm -rf conda + +.PHONY: dist-clean + + +FILTER_TOP = sed -e's@$(TOP_DIR)/@$$TOP_DIR/@' +env-info: + @echo " Top level directory is: '$(TOP_DIR)'" + @echo " The version number is: '$$(git describe)'" + @echo " Git repository is using: $$(du -h -s $(TOP_DIR)/.git | sed -e's/\s.*//')" \ + | $(FILTER_TOP) + @echo + @echo " Environment setup directory is: '$(ENV_DIR)'" \ + | $(FILTER_TOP) + @echo " Download and cache directory is: '$(DOWNLOADS_DIR)' (using $$(du -h -s $(DOWNLOADS_DIR) | sed -e's/\s.*//'))" \ + | $(FILTER_TOP) + @echo " Conda's directory is: '$(CONDA_DIR)' (using $$(du -h -s $(CONDA_DIR) | sed -e's/\s.*//'))" \ + | $(FILTER_TOP) + @echo " Conda's packages download cache is: '$(CONDA_PKGS_DIR)' (using $$(du -h -s $(CONDA_PKGS_DIR) | sed -e's/\s.*//'))" \ + | $(FILTER_TOP) + @echo " Conda's Python binary is: '$(CONDA_ENV_PYTHON)'"\ + | $(FILTER_TOP) + + +.PHONY: info diff --git a/xc7/README.md b/xc7/README.md deleted file mode 100644 index 266dedb..0000000 --- a/xc7/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# SymbiFlow Toolchain Examples for Xilinx 7 Series - -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/) and the [Arty board](https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/). -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 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. - -## Setting up the toolchain - -```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 env create -f xc7/environment.yml -conda activate xc7 -wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install -conda deactivate -``` - -## Building the examples - -To build the example, run the following commands: - -```bash -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" -conda activate xc7 -git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples -# counter example -pushd xc7/counter_test && make clean && TARGET="arty_50" make && popd -pushd xc7/counter_test && make clean && TARGET="arty_100" make && popd -pushd xc7/counter_test && make clean && TARGET="basys3" make && popd -# picosoc example -pushd xc7/picosoc_demo && make && popd -# litex example -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/ -pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd -# linux litex example -pushd xc7/linux_litex_demo && make && popd -``` - diff --git a/xc7/README.rst b/xc7/README.rst new file mode 100644 index 0000000..74da718 --- /dev/null +++ b/xc7/README.rst @@ -0,0 +1,79 @@ +SymbiFlow Toolchain Examples for Xilinx 7 Series +================================================ + +#. ``counter`` - simple 4-bit counter driving LEDs. The design targets the `Basys3 board `__ and the `Arty board `__. + +#. ``picosoc`` - `picorv32 `__ based SoC. The design targets the `Basys3 board `__. + +#. ``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 built following the `linux on litex vexriscv `__ instructions. +The ``linux_litex`` example is already provided with working Linux images. + +Setting up the toolchain +------------------------ + +.. toolchain_include_begin_label + +.. code:: 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 env create -f xc7/environment.yml + conda activate xc7 + wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/presubmit/install/477/20200714-082108/symbiflow-arch-defs-install-8eb88e76.tar.xz | tar -xJ --one-top-level=$INSTALL_DIR/install + conda deactivate + +.. toolchain_include_end_label + +Building the examples +--------------------- + +.. build_examples_include_begin_label + +Before building any example, prepare environment: + +.. code:: bash + + 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" + conda activate xc7 + git clone https://github.com/SymbiFlow/symbiflow-examples && cd symbiflow-examples + +To build the counter example, run the following commands: + +.. code:: bash + + pushd xc7/counter_test && make clean && TARGET="arty_50" make && popd + pushd xc7/counter_test && make clean && TARGET="arty_100" make && popd + pushd xc7/counter_test && make clean && TARGET="basys3" make && popd + +To build the picosoc example, run the following commands: + +.. code:: bash + + pushd xc7/picosoc_demo && make && popd + +To build the litex example, run the following commands: + +.. code:: bash + + 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/ + pushd litex/litex/boards/targets && ./arty.py --toolchain symbiflow --cpu-type vexriscv --build && popd + +To build the linux-litex-demo example, run the following commands: + +.. code:: bash + + pushd xc7/linux_litex_demo && make && popd + +.. build_examples_include_end_label