Skip to content

Commit

Permalink
Merge branch 'python-setup' of github.com:IObundle/iob-soc into pytho…
Browse files Browse the repository at this point in the history
…n-setup
  • Loading branch information
arturum1 committed Oct 24, 2023
2 parents 327de43 + 68c496d commit 29ba78d
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 56 deletions.
95 changes: 54 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,50 +79,11 @@ jobs:
- name: verilator test
run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=verilator"

icarus:
runs-on: self-hosted
timeout-minutes: 90
if: ${{ !cancelled() }}
needs: [ pc-emul ]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
# Init mem
- name: clean
run: make clean
- name: setup init_mem
run: nix-shell --run "make setup"
- name: icarus test
run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# No init mem - Disabled because it takes too long and is already checked by verilator
#- name: clean
# run: make clean
#- name: setup
# run: nix-shell --run "make setup INIT_MEM=0"
#- name: icarus test
# run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# Init mem and Ext mem
- name: clean
run: make clean
- name: setup init_mem ext_mem
run: nix-shell --run "make setup INIT_MEM=1 USE_EXTMEM=1"
- name: icarus test
run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# No init mem and Ext mem - Disabled because it takes too long and is already checked by verilator
#- name: clean
# run: make clean
#- name: setup ext_mem
# run: nix-shell --run "make setup INIT_MEM=0 USE_EXTMEM=1"
#- name: icarus test
# run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"

cyclonev:
runs-on: self-hosted
timeout-minutes: 60
if: ${{ !cancelled() }}
needs: [ icarus, verilator ]
needs: [ pc-emul ]

steps:
- uses: actions/checkout@v3
Expand All @@ -133,28 +94,34 @@ jobs:
run: nix-shell --run "make clean"
- name: setup init_mem
run: nix-shell --run "make setup"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: cyclonev test
run: make -C ../iob_soc_V* fpga-test BOARD=CYCLONEV-GT-DK
# No init mem
- name: clean
run: nix-shell --run "make clean"
- name: setup
run: nix-shell --run "make setup INIT_MEM=0"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: cyclonev test
run: make -C ../iob_soc_V* fpga-test BOARD=CYCLONEV-GT-DK
# No init mem and Ext mem
- name: clean
run: nix-shell --run "make clean"
- name: setup ext_mem
run: nix-shell --run "make setup INIT_MEM=0 USE_EXTMEM=1"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: cyclonev test
run: make -C ../iob_soc_V* fpga-test BOARD=CYCLONEV-GT-DK

aes-ku040:
runs-on: self-hosted
timeout-minutes: 90
if: ${{ !cancelled() }}
needs: [ icarus, verilator ]
needs: [ verilator ]

steps:
- uses: actions/checkout@v3
Expand All @@ -165,20 +132,26 @@ jobs:
run: nix-shell --run "make clean"
- name: setup init_mem
run: nix-shell --run "make setup"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: ku040 test
run: make -C ../iob_soc_V* fpga-test BOARD=AES-KU040-DB-G
# No init mem
- name: clean
run: nix-shell --run "make clean"
- name: setup
run: nix-shell --run "make setup INIT_MEM=0"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: ku040 test
run: make -C ../iob_soc_V* fpga-test BOARD=AES-KU040-DB-G
# No init mem and Ext mem
- name: clean
run: nix-shell --run "make clean"
- name: setup ext_mem
run: nix-shell --run "make setup INIT_MEM=0 USE_EXTMEM=1"
- name: build firmware
run: nix-shell --run "make -C ../iob_soc_V* fw-build"
- name: ku040 test
run: make -C ../iob_soc_V* fpga-test BOARD=AES-KU040-DB-G

Expand All @@ -198,3 +171,43 @@ jobs:
run: nix-shell --run "make setup"
- name: doc test
run: nix-shell --run "make -C ../iob_soc_V* doc-test"

icarus:
runs-on: self-hosted
timeout-minutes: 90
if: ${{ !cancelled() }}
needs: [ aes-ku040 ]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
# Init mem
- name: clean
run: make clean
- name: setup init_mem
run: nix-shell --run "make setup"
- name: icarus test
run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# No init mem - Disabled because it takes too long and is already checked by verilator
#- name: clean
# run: make clean
#- name: setup
# run: nix-shell --run "make setup INIT_MEM=0"
#- name: icarus test
# run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# Init mem and Ext mem
- name: clean
run: make clean
- name: setup init_mem ext_mem
run: nix-shell --run "make setup INIT_MEM=1 USE_EXTMEM=1"
- name: icarus test
run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"
# No init mem and Ext mem - Disabled because it takes too long and is already checked by verilator
#- name: clean
# run: make clean
#- name: setup ext_mem
# run: nix-shell --run "make setup INIT_MEM=0 USE_EXTMEM=1"
#- name: icarus test
# run: nix-shell --run "make -C ../iob_soc_V* sim-test SIMULATOR=icarus"

23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DISABLE_LINT:=1
include submodules/LIB/setup.mk

INIT_MEM ?= 1
USE_EXT_MEM ?= 0

ifeq ($(INIT_MEM),1)
SETUP_ARGS += INIT_MEM
Expand All @@ -16,25 +17,29 @@ SETUP_ARGS += USE_EXTMEM
endif

sim-run:
make clean && make setup INIT_MEM=$(INIT_MEM) USE_EXTMEM=$(USE_EXTMEM) && make -C ../$(CORE)_V*/ sim-run SIMULATOR=$(SIMULATOR)
nix-shell --run 'make clean && make setup INIT_MEM=$(INIT_MEM) USE_EXTMEM=$(USE_EXTMEM) && make -C ../$(CORE)_V*/ sim-run SIMULATOR=$(SIMULATOR)'

sim-test:
make clean && make setup && make -C ../$(CORE)_V*/ sim-test
make clean && make setup INIT_MEM=0 && make -C ../$(CORE)_V*/ sim-test
make clean && make setup USE_EXTMEM=1 && make -C ../$(CORE)_V*/ sim-test
make clean && make setup INIT_MEM=0 USE_EXTMEM=1 && make -C ../$(CORE)_V*/ sim-test
nix-shell --run 'make clean && make setup && make -C ../$(CORE)_V*/ sim-test'
nix-shell --run 'make clean && make setup INIT_MEM=0 && make -C ../$(CORE)_V*/ sim-test SIMULATOR=verilator'
nix-shell --run 'make clean && make setup USE_EXTMEM=1 && make -C ../$(CORE)_V*/ sim-test'
nix-shell --run 'make clean && make setup INIT_MEM=0 USE_EXTMEM=1 && make -C ../$(CORE)_V*/ sim-test SIMULATOR=verilator'

fpga-run:
nix-shell --run 'make clean && make setup && make -C ../$(CORE)_V*/ fw-build'
make -C ../$(CORE)_V*/ fpga-run

fpga-test:
make clean && make setup && make -C ../$(CORE)_V*/ fpga-test
make clean && make setup INIT_MEM=0 && make -C ../$(CORE)_V*/ fpga-test
make clean && make setup INIT_MEM=0 USE_EXTMEM=1 && make -C ../$(CORE)_V*/ fpga-test
nix-shell --run 'make clean && make setup && make -C ../$(CORE)_V*/ fpga-test'
nix-shell --run 'make clean && make setup INIT_MEM=0 USE_EXTMEM=1 && make -C ../$(CORE)_V*/ fpga-test'


test-all:
make clean && make setup && make -C ../$(CORE)_V*/ pc-emul-test
#make sim-test SIMULATOR=icarus
make sim-test SIMULATOR=verilator
make fpga-test BOARD=CYCLONEV-GT-DK
make fpga-test BOARD=AES-KU040-DB-G
make clean && make setup && make -C ../$(CORE)_V*/ doc-test
#make sim-test SIMULATOR=icarus

.PHONY: sim-test fpga-test test-all
2 changes: 2 additions & 0 deletions iob_soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from iob_ctls import iob_ctls
from iob_ram_2p import iob_ram_2p
from iob_ram_sp import iob_ram_sp
from axi_interconnect import axi_interconnect


class iob_soc(iob_module):
Expand Down Expand Up @@ -106,6 +107,7 @@ def _create_submodules_list(cls, extra_submodules=[]):
iob_ram_dp,
iob_reset_sync,
iob_ctls,
axi_interconnect,
# Simulation headers & modules
(axi_ram, {"purpose": "simulation"}),
({"interface": "axi_s_portmap"}, {"purpose": "simulation"}),
Expand Down
3 changes: 0 additions & 3 deletions scripts/iob_soc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import if_gen
import build_srcs
from iob_module import iob_module
from axi_interconnect import axi_interconnect

######################################
# Specialized IOb-SoC setup functions.
Expand Down Expand Up @@ -60,8 +59,6 @@ def iob_soc_wrapper_setup(python_module, num_extmem_connections, exclude_files=[

python_module._setup_submodules(
[
# Setup interconnect
axi_interconnect,
# Create extmem wrapper files
{
"file_prefix": "ddr4_",
Expand Down
2 changes: 1 addition & 1 deletion submodules/CACHE
2 changes: 1 addition & 1 deletion submodules/UART

0 comments on commit 29ba78d

Please sign in to comment.