From d554c280e1878b8f955c2c9a0e10e7d842b5a43f Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 22 Sep 2022 13:14:42 -0700 Subject: [PATCH] Add CI tests for constellation --- .github/scripts/defaults.sh | 5 +- .github/scripts/remote-do-rtl-build.sh | 7 ++ .github/scripts/run-tests.sh | 6 ++ .github/workflows/chipyard-run-tests.yml | 106 +++++++++++++++++++++-- scripts/tutorial-patches/build.sbt.patch | 5 +- 5 files changed, 117 insertions(+), 12 deletions(-) diff --git a/.github/scripts/defaults.sh b/.github/scripts/defaults.sh index e196b99457..046dac3886 100755 --- a/.github/scripts/defaults.sh +++ b/.github/scripts/defaults.sh @@ -28,8 +28,9 @@ declare -A grouping grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad" grouping["group-peripherals"]="chipyard-dmirocket chipyard-blkdev chipyard-spiflashread chipyard-spiflashwrite chipyard-mmios chipyard-lbwif" grouping["group-accels"]="chipyard-fftgenerator chipyard-nvdla chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-streaming-fir chipyard-streaming-passthrough" +grouping["group-constellation"]="chipyard-constellation" grouping["group-tracegen"]="tracegen tracegen-boom" -grouping["group-other"]="icenet testchipip" +grouping["group-other"]="icenet testchipip constellation" grouping["group-fpga"]="arty vcu118" # key value store to get the build strings @@ -58,7 +59,9 @@ mapping["chipyard-sodor"]=" CONFIG=Sodor5StageConfig" mapping["chipyard-multiclock-rocket"]=" CONFIG=MulticlockRocketConfig" mapping["chipyard-nomem-scratchpad"]=" CONFIG=MMIOScratchpadOnlyRocketConfig" mapping["chipyard-fftgenerator"]=" CONFIG=FFTRocketConfig" +mapping["chipyard-constellation"]=" CONFIG=SharedNoCConfig" +mapping["constellation"]=" SUB_PROJECT=constellation" mapping["firesim"]="SCALA_TEST=firesim.firesim.RocketNICF1Tests" mapping["firesim-multiclock"]="SCALA_TEST=firesim.firesim.RocketMulticlockF1Tests" mapping["fireboom"]="SCALA_TEST=firesim.firesim.BoomF1Tests" diff --git a/.github/scripts/remote-do-rtl-build.sh b/.github/scripts/remote-do-rtl-build.sh index 802525116d..06804f4517 100755 --- a/.github/scripts/remote-do-rtl-build.sh +++ b/.github/scripts/remote-do-rtl-build.sh @@ -18,6 +18,13 @@ cd $REMOTE_CHIPYARD_DIR ./scripts/init-submodules-no-riscv-tools.sh --skip-validate ./scripts/init-fpga.sh + +# Constellation can run without espresso, but this improves +# elaboration time drastically +pushd $REMOTE_CHIPYARD_DIR/generators/constellation +scripts/install-espresso.sh $RISCV +popd + if [ $1 = "group-accels" ]; then pushd $REMOTE_CHIPYARD_DIR/generators/gemmini/software git submodule update --init --recursive gemmini-rocc-tests diff --git a/.github/scripts/run-tests.sh b/.github/scripts/run-tests.sh index d97f05dce1..b35f447209 100755 --- a/.github/scripts/run-tests.sh +++ b/.github/scripts/run-tests.sh @@ -102,12 +102,18 @@ case $1 in make -C $LOCAL_CHIPYARD_DIR/tests make -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} BINARY=$LOCAL_CHIPYARD_DIR/tests/fft.riscv run-binary-fast ;; + chipyard-constellation) + run_bmark ${mapping[$1]} + ;; icenet) make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} ;; testchipip) make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} ;; + constellation) + make run-binary-fast BINARY=none -C $LOCAL_SIM_DIR $DISABLE_SIM_PREREQ ${mapping[$1]} + ;; *) echo "No set of tests for $1. Did you spell it right?" exit 1 diff --git a/.github/workflows/chipyard-run-tests.yml b/.github/workflows/chipyard-run-tests.yml index 02c3ec6829..bee8b80256 100644 --- a/.github/workflows/chipyard-run-tests.yml +++ b/.github/workflows/chipyard-run-tests.yml @@ -261,6 +261,28 @@ jobs: with: group-key: "group-cores" + prepare-chipyard-constellation: + name: prepare-chipyard-constellation + needs: setup-complete + 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: Build RTL on self-hosted + uses: ./.github/actions/prepare-rtl + with: + group-key: "group-constellation" + prepare-chipyard-peripherals: name: prepare-chipyard-peripherals needs: setup-complete @@ -861,6 +883,53 @@ jobs: group-key: "group-other" project-key: "testchipip" + constellation-run-tests: + name: constellation-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 tests + uses: ./.github/actions/run-tests + with: + group-key: "group-other" + project-key: "constellation" + + chipyard-constellation-run-tests: + name: chipyard-constellation-run-tests + needs: prepare-chipyard-constellation + 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 tests + uses: ./.github/actions/run-tests + with: + group-key: "group-constellation" + project-key: "chipyard-constellation" + + firesim-run-tests: name: firesim-run-tests needs: setup-complete @@ -939,16 +1008,35 @@ jobs: # When adding new top level jobs, please add them to `needs` below all_tests_passed: name: "all tests passed" - needs: [commit-on-master-check, tutorial-setup-check, documentation-check, - chipyard-rocket-run-tests, chipyard-hetero-run-tests, chipyard-boom-run-tests, chipyard-cva6-run-tests, chipyard-ibex-run-tests, - chipyard-sodor-run-tests, chipyard-dmirocket-run-tests, chipyard-spiflashwrite-run-tests, chipyard-fftgenerator-run-tests, - chipyard-spiflashread-run-tests, chipyard-lbwif-run-tests, chipyard-sha3-run-tests, - chipyard-streaming-fir-run-tests, chipyard-streaming-passthrough-run-tests, chipyard-hwacha-run-tests, - chipyard-gemmini-run-tests, chipyard-nvdla-run-tests, - tracegen-boom-run-tests, tracegen-run-tests, - icenet-run-tests, testchipip-run-tests, + needs: [commit-on-master-check, + tutorial-setup-check, + documentation-check, + chipyard-rocket-run-tests, + chipyard-hetero-run-tests, + chipyard-boom-run-tests, + chipyard-cva6-run-tests, + chipyard-ibex-run-tests, + chipyard-sodor-run-tests, + chipyard-dmirocket-run-tests, + chipyard-spiflashwrite-run-tests, + chipyard-fftgenerator-run-tests, + chipyard-spiflashread-run-tests, + chipyard-lbwif-run-tests, + chipyard-sha3-run-tests, + chipyard-streaming-fir-run-tests, + chipyard-streaming-passthrough-run-tests, + chipyard-hwacha-run-tests, + chipyard-gemmini-run-tests, + chipyard-nvdla-run-tests, + chipyard-constellation-run-tests, + tracegen-boom-run-tests, + tracegen-run-tests, + icenet-run-tests, + testchipip-run-tests, + constellation-run-tests, prepare-chipyard-fpga, # firesim-run-tests, - fireboom-run-tests, firesim-multiclock-run-tests] + fireboom-run-tests, + firesim-multiclock-run-tests] runs-on: ubuntu-latest steps: - run: echo Success! diff --git a/scripts/tutorial-patches/build.sbt.patch b/scripts/tutorial-patches/build.sbt.patch index a701ecf12b..1064bb99d5 100644 --- a/scripts/tutorial-patches/build.sbt.patch +++ b/scripts/tutorial-patches/build.sbt.patch @@ -2,14 +2,15 @@ diff --git a/build.sbt b/build.sbt index bbbb8251..b7adcb73 100644 --- a/build.sbt +++ b/build.sbt -@@ -143,7 +143,7 @@ lazy val testchipip = (project in file("generators/testchipip")) +@@ -143,8 +143,8 @@ lazy val testchipip = (project in file("generators/testchipip")) lazy val chipyard = (project in file("generators/chipyard")) .dependsOn(testchipip, rocketchip, boom, hwacha, sifive_blocks, sifive_cache, iocell, - sha3, // On separate line to allow for cleaner tutorial-setup patches +// sha3, // On separate line to allow for cleaner tutorial-setup patches dsptools, `rocket-dsp-utils`, - gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator) + gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator, + constellation) .settings(libraryDependencies ++= rocketLibDeps.value) @@ -189,11 +189,11 @@ lazy val sodor = (project in file("generators/riscv-sodor")) .settings(libraryDependencies ++= rocketLibDeps.value)