From 2ac15f4e2f56aaa88dc84d9d8d3a57db170a20d2 Mon Sep 17 00:00:00 2001 From: Unai Sainz-Estebanez Date: Fri, 7 Jun 2024 19:36:26 +0200 Subject: [PATCH] [UPGRADE REPOSITORY] Add CFU implementation files For mult_wfifos, multp_wfifos and multp Through nextpnr Update implementation.yml to perform the bitstream generation in CI --- .github/workflows/Implementation.yml | 40 +++++++++++++++++++ impl/nextpnr/impl_mults_cfu.sh | 60 ++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100755 impl/nextpnr/impl_mults_cfu.sh diff --git a/.github/workflows/Implementation.yml b/.github/workflows/Implementation.yml index 07147fb..53600f9 100644 --- a/.github/workflows/Implementation.yml +++ b/.github/workflows/Implementation.yml @@ -208,3 +208,43 @@ jobs: name: multp_wfifos_wishbone_100t path: ./neorv32_multp_wfifos_wishbone_100t.bit + impl_mults_cfu_35t: + runs-on: ubuntu-latest + env: + Board: 35t + + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v4 + + - uses: docker://ghcr.io/unike267/containers/impl-arty:latest + with: + args: ./impl/nextpnr/impl_mults_cfu.sh + + - name: '📤 Upload artifact' + uses: actions/upload-artifact@v4 + with: + name: mults_cfu_35t + path: ./neorv32_mults_cfu_35t.bit + + impl_mults_cfu_100t: + runs-on: ubuntu-latest + env: + Board: 100t + + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v4 + + - uses: docker://ghcr.io/unike267/containers/impl-arty:latest + with: + args: ./impl/nextpnr/impl_mults_cfu.sh + + - name: '📤 Upload artifact' + uses: actions/upload-artifact@v4 + with: + name: mults_cfu_100t + path: ./neorv32_mults_cfu_100t.bit + diff --git a/impl/nextpnr/impl_mults_cfu.sh b/impl/nextpnr/impl_mults_cfu.sh new file mode 100755 index 0000000..a35a188 --- /dev/null +++ b/impl/nextpnr/impl_mults_cfu.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +set -ex + +cd $(dirname "$0") + +if [[ -z "${Board}" ]]; then + Arty='35t' +elif [[ $Board == '35t' ]]; then + Arty='35t' +elif [[ $Board == '100t' ]]; then + Arty='100t' +else + echo "Error Board must be 35t or 100t" + exit +fi +echo "Selected board is" $Arty + +apt update -qq + +apt install -y git + +cd ../.. + +git clone --recursive https://github.com/stnolting/neorv32-setups + +mv rtl/mult/CFU/neorv32_application_image.vhd neorv32-setups/neorv32/rtl/core +mv rtl/mult/CFU/neorv32_cpu_cp_cfu.vhd neorv32-setups/neorv32/rtl/core + +mkdir -p build + +echo "Analyze NEORV32 CPU + MULT(P) via CFU" + +ghdl -i --std=08 --workdir=build --work=neorv32 ./neorv32-setups/neorv32/rtl/core/*.vhd +ghdl -i --std=08 --workdir=build --work=neorv32 ./neorv32-setups/neorv32/rtl/core/mem/neorv32_dmem.default.vhd +ghdl -i --std=08 --workdir=build --work=neorv32 ./neorv32-setups/neorv32/rtl/core/mem/neorv32_imem.default.vhd +ghdl -i --std=08 --workdir=build --work=neorv32 ./rtl/mult/*.vhd +ghdl -i --std=08 --workdir=build --work=neorv32 ./rtl/multp/*.vhd +ghdl -i --std=08 --workdir=build --work=neorv32 ./rtl/mult/CFU/neorv32_mults_cfu.vhd +ghdl -m --std=08 --workdir=build --work=neorv32 neorv32_mults_cfu + +echo "Synthesis with yosys and ghdl as module" + +yosys -m ghdl -p 'ghdl --std=08 --workdir=build --work=neorv32 neorv32_mults_cfu; synth_xilinx -nodsp -nolutram -flatten -abc9 -arch xc7 -top neorv32_mults_cfu; write_json neorv32_mults_cfu.json' + +if [[ $Arty == '35t' ]]; then + echo "Place and route" + nextpnr-xilinx --chipdb /usr/local/share/nextpnr/xilinx-chipdb/xc7a35t.bin --xdc impl/nextpnr/arty.xdc --json neorv32_mults_cfu.json --write neorv32_mults_cfu_routed.json --fasm neorv32_mults_cfu.fasm + echo "Generate bitstream" + ../../prjxray/utils/fasm2frames.py --part xc7a35tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_mults_cfu.fasm > neorv32_mults_cfu.frames + ../../prjxray/build/tools/xc7frames2bit --part_file /usr/local/share/nextpnr/prjxray-db/artix7/xc7a35tcsg324-1/part.yaml --part_name xc7a35tcsg324-1 --frm_file neorv32_mults_cfu.frames --output_file neorv32_mults_cfu_35t.bit +elif [[ $Arty == '100t' ]]; then + echo "Place and route" + nextpnr-xilinx --chipdb /usr/local/share/nextpnr/xilinx-chipdb/xc7a100t.bin --xdc impl/nextpnr/arty.xdc --json neorv32_mults_cfu.json --write neorv32_mults_cfu_routed.json --fasm neorv32_mults_cfu.fasm + echo "Generate bitstream" + ../../prjxray/utils/fasm2frames.py --part xc7a100tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_mults_cfu.fasm > neorv32_mults_cfu.frames + ../../prjxray/build/tools/xc7frames2bit --part_file /usr/local/share/nextpnr/prjxray-db/artix7/xc7a100tcsg324-1/part.yaml --part_name xc7a100tcsg324-1 --frm_file neorv32_mults_cfu.frames --output_file neorv32_mults_cfu_100t.bit +fi + +echo "Implementation completed"