Skip to content

Commit

Permalink
Add rocketchip unit-tests to regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed May 19, 2023
1 parent 72d0c41 commit d794581
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/scripts/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboom chipyard-spif
grouping["group-accels"]="chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-manymmioaccels"
grouping["group-constellation"]="chipyard-constellation"
grouping["group-tracegen"]="tracegen tracegen-boom"
grouping["group-other"]="icenet testchipip constellation"
grouping["group-other"]="icenet testchipip constellation rocketchip-amba rocketchip-tlsimple rocketchip-tlwidth rocketchip-tlxbar"
grouping["group-fpga"]="arty vcu118 vc707"

# key value store to get the build strings
Expand Down Expand Up @@ -69,6 +69,10 @@ mapping["firesim"]="SCALA_TEST=firesim.firesim.RocketNICF1Tests"
mapping["fireboom"]="SCALA_TEST=firesim.firesim.BoomF1Tests"
mapping["icenet"]="SUB_PROJECT=icenet"
mapping["testchipip"]="SUB_PROJECT=testchipip"
mapping["rocketchip-amba"]="SUB_PROJECT=rocketchip CONFIG=AMBAUnitTestConfig"
mapping["rocketchip-tlsimple"]="SUB_PROJECT=rocketchip CONFIG=TLSimpleUnitTestConfig"
mapping["rocketchip-tlwidth"]="SUB_PROJECT=rocketchip CONFIG=TLWidthUnitTestConfig"
mapping["rocketchip-tlxbar"]="SUB_PROJECT=rocketchip CONFIG=TLXbarUnitTestConfig"

mapping["arty"]="SUB_PROJECT=arty verilog"
mapping["vcu118"]="SUB_PROJECT=vcu118 verilog"
Expand Down
22 changes: 19 additions & 3 deletions .github/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ run_tracegen () {
make tracegen -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ $@
}

run_none () {
make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ run-binary-fast BINARY=none $@
}

case $1 in
chipyard-rocket)
run_bmark ${mapping[$1]}
Expand Down Expand Up @@ -119,13 +123,25 @@ case $1 in
make run-binary-hex BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]}
;;
icenet)
make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]}
run_none ${mapping[$1]}
;;
testchipip)
make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]}
run_none ${mapping[$1]}
;;
constellation)
make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]}
run_none ${mapping[$1]}
;;
rocketchip-amba)
run_none ${mapping[$1]}
;;
rocketchip-tlsimple)
run_none ${mapping[$1]}
;;
rocketchip-tlwidth)
run_none ${mapping[$1]}
;;
rocketchip-tlxbar)
run_none ${mapping[$1]}
;;
*)
echo "No set of tests for $1. Did you spell it right?"
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/chipyard-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,44 @@ jobs:
group-key: "group-other"
project-key: "testchipip"

rocketchip-run-tests:
name: rocketchip-run-tests
needs: prepare-chipyard-other
runs-on: self-hosted
steps:
- name: Delete old checkout
run: |
ls -alh .
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
ls -alh .
- name: Checkout
uses: actions/checkout@v3
- name: Git workaround
uses: ./.github/actions/git-workaround
- name: Create conda env
uses: ./.github/actions/create-conda-env
- name: Run amba tests
uses: ./.github/actions/run-tests
with:
group-key: "group-other"
project-key: "rocketchip-amba"
- name: Run tlsimple tests
uses: ./.github/actions/run-tests
with:
group-key: "group-other"
project-key: "rocketchip-tlsimple"
- name: Run tlwidth tests
uses: ./.github/actions/run-tests
with:
group-key: "group-other"
project-key: "rocketchip-tlwidth"
- name: Run tlxbar tests
uses: ./.github/actions/run-tests
with:
group-key: "group-other"
project-key: "rocketchip-tlxbar"

constellation-run-tests:
name: constellation-run-tests
needs: prepare-chipyard-other
Expand Down Expand Up @@ -980,6 +1018,7 @@ jobs:
tracegen-run-tests,
icenet-run-tests,
testchipip-run-tests,
rocketchip-run-tests,
constellation-run-tests,
prepare-chipyard-fpga, # firesim-run-tests,
fireboom-run-tests]
Expand Down
14 changes: 13 additions & 1 deletion variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ifeq ($(SUB_PROJECT),hwacha)
TB ?= TestDriver
TOP ?= ExampleRocketSystem
endif
# For TestChipIP developers
# For TestChipIP developers running unit-tests
ifeq ($(SUB_PROJECT),testchipip)
SBT_PROJECT ?= chipyard
MODEL ?= TestHarness
Expand All @@ -101,6 +101,18 @@ ifeq ($(SUB_PROJECT),testchipip)
TB ?= TestDriver
TOP ?= UnitTestSuite
endif
# For rocketchip developers running unit-tests
ifeq ($(SUB_PROJECT),rocketchip)
SBT_PROJECT ?= chipyard
MODEL ?= TestHarness
VLOG_MODEL ?= $(MODEL)
MODEL_PACKAGE ?= chipyard.unittest
CONFIG ?= TLSimpleUnitTestConfig
CONFIG_PACKAGE ?= freechips.rocketchip.unittest
GENERATOR_PACKAGE ?= chipyard
TB ?= TestDriver
TOP ?= UnitTestSuite
endif
# For IceNet developers
ifeq ($(SUB_PROJECT),icenet)
SBT_PROJECT ?= chipyard
Expand Down

0 comments on commit d794581

Please sign in to comment.