Skip to content

Commit

Permalink
[UPGRADE REPOSITORY]
Browse files Browse the repository at this point in the history
Add Wishbone implementation files
For mult_wfifos and multp_wfifos
Through nextpnr

Update implementation.yml to perform the bitstream generation in CI
  • Loading branch information
Unike267 authored and Unai267 committed Jun 7, 2024
1 parent ddd4285 commit 8746a66
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/Implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,83 @@ jobs:
name: multp_slink_100t
path: ./neorv32_multp_slink_100t.bit

impl_mult_wfifos_wishbone_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_mult_wfifos_wishbone.sh

- name: '📤 Upload artifact'
uses: actions/upload-artifact@v4
with:
name: mult_wfifos_wishbone_35t
path: ./neorv32_mult_wfifos_wishbone_35t.bit

impl_mult_wfifos_wishbone_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_mult_wfifos_wishbone.sh

- name: '📤 Upload artifact'
uses: actions/upload-artifact@v4
with:
name: mult_wfifos_wishbone_100t
path: ./neorv32_mult_wfifos_wishbone_100t.bit

impl_multp_wfifos_wishbone_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_multp_wfifos_wishbone.sh

- name: '📤 Upload artifact'
uses: actions/upload-artifact@v4
with:
name: multp_wfifos_wishbone_35t
path: ./neorv32_multp_wfifos_wishbone_35t.bit

impl_multp_wfifos_wishbone_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_multp_wfifos_wishbone.sh

- name: '📤 Upload artifact'
uses: actions/upload-artifact@v4
with:
name: multp_wfifos_wishbone_100t
path: ./neorv32_multp_wfifos_wishbone_100t.bit

58 changes: 58 additions & 0 deletions impl/nextpnr/impl_mult_wfifos_wishbone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/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/EMEM/neorv32_application_image.vhd neorv32-setups/neorv32/rtl/core

mkdir -p build

echo "Analyze NEORV32 CPU + MULT(P) via slink"

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/mult/EMEM/neorv32_mult_wfifos_wishbone.vhd
ghdl -m --std=08 --workdir=build --work=neorv32 neorv32_mult_wfifos_wishbone

echo "Synthesis with yosys and ghdl as module"

yosys -m ghdl -p 'ghdl --std=08 --workdir=build --work=neorv32 neorv32_mult_wfifos_wishbone; synth_xilinx -nodsp -nolutram -flatten -abc9 -arch xc7 -top neorv32_mult_wfifos_wishbone; write_json neorv32_mult_wfifos_wishbone.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_mult_wfifos_wishbone.json --write neorv32_mult_wfifos_wishbone_routed.json --fasm neorv32_mult_wfifos_wishbone.fasm
echo "Generate bitstream"
../../prjxray/utils/fasm2frames.py --part xc7a35tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_mult_wfifos_wishbone.fasm > neorv32_mult_wfifos_wishbone.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_mult_wfifos_wishbone.frames --output_file neorv32_mult_wfifos_wishbone_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_mult_wfifos_wishbone.json --write neorv32_mult_wfifos_wishbone_routed.json --fasm neorv32_mult_wfifos_wishbone.fasm
echo "Generate bitstream"
../../prjxray/utils/fasm2frames.py --part xc7a100tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_mult_wfifos_wishbone.fasm > neorv32_mult_wfifos_wishbone.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_mult_wfifos_wishbone.frames --output_file neorv32_mult_wfifos_wishbone_100t.bit
fi

echo "Implementation completed"
59 changes: 59 additions & 0 deletions impl/nextpnr/impl_multp_wfifos_wishbone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/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/EMEM/neorv32_application_image.vhd neorv32-setups/neorv32/rtl/core

mkdir -p build

echo "Analyze NEORV32 CPU + MULT(P) via slink"

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/fifo.vhd
ghdl -i --std=08 --workdir=build --work=neorv32 ./rtl/multp/*.vhd
ghdl -i --std=08 --workdir=build --work=neorv32 ./rtl/multp/EMEM/neorv32_multp_wfifos_wishbone.vhd
ghdl -m --std=08 --workdir=build --work=neorv32 neorv32_multp_wfifos_wishbone

echo "Synthesis with yosys and ghdl as module"

yosys -m ghdl -p 'ghdl --std=08 --workdir=build --work=neorv32 neorv32_multp_wfifos_wishbone; synth_xilinx -nodsp -nolutram -flatten -abc9 -arch xc7 -top neorv32_multp_wfifos_wishbone; write_json neorv32_multp_wfifos_wishbone.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_multp_wfifos_wishbone.json --write neorv32_multp_wfifos_wishbone_routed.json --fasm neorv32_multp_wfifos_wishbone.fasm
echo "Generate bitstream"
../../prjxray/utils/fasm2frames.py --part xc7a35tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_multp_wfifos_wishbone.fasm > neorv32_multp_wfifos_wishbone.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_multp_wfifos_wishbone.frames --output_file neorv32_multp_wfifos_wishbone_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_multp_wfifos_wishbone.json --write neorv32_multp_wfifos_wishbone_routed.json --fasm neorv32_multp_wfifos_wishbone.fasm
echo "Generate bitstream"
../../prjxray/utils/fasm2frames.py --part xc7a100tcsg324-1 --db-root /usr/local/share/nextpnr/prjxray-db/artix7 neorv32_multp_wfifos_wishbone.fasm > neorv32_multp_wfifos_wishbone.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_multp_wfifos_wishbone.frames --output_file neorv32_multp_wfifos_wishbone_100t.bit
fi

echo "Implementation completed"

0 comments on commit 8746a66

Please sign in to comment.