Skip to content

Commit

Permalink
Merge pull request #528 from ucb-bar/firesim-scalatest
Browse files Browse the repository at this point in the history
Make CI use ScalaTest for FireSim
  • Loading branch information
davidbiancolin authored Apr 27, 2020
2 parents 9d15f2e + 462f4d0 commit b042886
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 88 deletions.
50 changes: 22 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,6 @@ jobs:
steps:
- prepare-rtl:
project-key: "tracegen-boom"
prepare-firesim:
executor: main-env
steps:
- prepare-rtl:
project-key: "firesim"
build-script: "do-firesim-build.sh"
prepare-fireboom:
executor: main-env
steps:
- prepare-rtl:
project-key: "fireboom"
build-script: "do-firesim-build.sh"
prepare-chipyard-ariane:
executor: main-env
steps:
Expand All @@ -279,6 +267,7 @@ jobs:
steps:
- run-tests:
project-key: "chipyard-hetero"
timeout: "15m"
chipyard-boom-run-tests:
executor: main-env
steps:
Expand Down Expand Up @@ -317,15 +306,24 @@ jobs:
- run-tests:
extra-cache-restore: "extra-tests"
project-key: "firesim"
run-script: "run-firesim-tests.sh"
run-script: "run-firesim-scala-tests.sh"
timeout: "20m"
fireboom-run-tests:
executor: main-env
steps:
- run-tests:
extra-cache-restore: "extra-tests"
project-key: "fireboom"
run-script: "run-firesim-tests.sh"
timeout: "30m"
run-script: "run-firesim-scala-tests.sh"
timeout: "45m"
firesim-multiclock-run-tests:
executor: main-env
steps:
- run-tests:
extra-cache-restore: "extra-tests"
project-key: "firesim-multiclock"
run-script: "run-firesim-scala-tests.sh"
timeout: "20m"
midasexamples-run-tests:
executor: main-env
steps:
Expand Down Expand Up @@ -428,16 +426,6 @@ workflows:
- install-riscv-toolchain
- install-verilator

- prepare-firesim:
requires:
- install-riscv-toolchain
- install-verilator

- prepare-fireboom:
requires:
- install-riscv-toolchain
- install-verilator

- prepare-chipyard-ariane:
requires:
- install-riscv-toolchain
Expand Down Expand Up @@ -490,12 +478,18 @@ workflows:
# Run the firesim tests
- firesim-run-tests:
requires:
- prepare-firesim
- install-riscv-toolchain
- install-verilator
- build-extra-tests
- firesim-multiclock-run-tests:
requires:
- install-riscv-toolchain
- install-verilator
- build-extra-tests

- fireboom-run-tests:
requires:
- prepare-fireboom
- install-riscv-toolchain
- install-verilator
- build-extra-tests

- chipyard-ariane-run-tests:
Expand Down
11 changes: 6 additions & 5 deletions .circleci/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ REMOTE_ESP_DIR=$REMOTE_WORK_DIR/esp-tools-install
REMOTE_CHIPYARD_DIR=$REMOTE_WORK_DIR/chipyard
REMOTE_SIM_DIR=$REMOTE_CHIPYARD_DIR/sims/verilator
REMOTE_FIRESIM_DIR=$REMOTE_CHIPYARD_DIR/sims/firesim/sim
REMOTE_JAVA_ARGS="-Xmx8G -Xss8M -Dsbt.ivy.home=$REMOTE_WORK_DIR/.ivy2 -Dsbt.global.base=$REMOTE_WORK_DIR/.sbt -Dsbt.boot.directory=$REMOTE_WORK_DIR/.sbt/boot"
# Disable the supershell to greatly improve the readability of SBT output when captured by Circle CI
REMOTE_JAVA_ARGS="-Xmx9G -Xss8M -Dsbt.ivy.home=$REMOTE_WORK_DIR/.ivy2 -Dsbt.supershell=false -Dsbt.global.base=$REMOTE_WORK_DIR/.sbt -Dsbt.boot.directory=$REMOTE_WORK_DIR/.sbt/boot"
REMOTE_VERILATOR_DIR=$CI_DIR/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_SHA1-verilator-install

# local variables (aka within the docker container)
Expand All @@ -50,9 +51,9 @@ mapping["chipyard-boom"]="SUB_PROJECT=chipyard CONFIG=SmallBoomConfig"
mapping["chipyard-blkdev"]="SUB_PROJECT=chipyard CONFIG=SimBlockDeviceRocketConfig"
mapping["chipyard-hwacha"]="SUB_PROJECT=chipyard CONFIG=HwachaRocketConfig"
mapping["chipyard-gemmini"]="SUB_PROJECT=chipyard CONFIG=GemminiRocketConfig"
mapping["chipyard-ariane"]="SUB_PROJECT=chipyard CONFIG=ArianeConfig"
mapping["tracegen"]="SUB_PROJECT=chipyard CONFIG=NonBlockingTraceGenL2Config TOP=TraceGenSystem"
mapping["tracegen-boom"]="SUB_PROJECT=chipyard CONFIG=BoomTraceGenConfig TOP=TraceGenSystem"
mapping["firesim"]="DESIGN=FireSim TARGET_CONFIG=WithNIC_DDR3FRFCFSLLC4MB_FireSimRocketConfig PLATFORM_CONFIG=BaseF1Config"
mapping["fireboom"]="DESIGN=FireSim TARGET_CONFIG=WithNIC_DDR3FRFCFSLLC4MB_FireSimLargeBoomConfig PLATFORM_CONFIG=BaseF1Config"
mapping["chipyard-ariane"]="SUB_PROJECT=chipyard CONFIG=ArianeConfig"
mapping["fireariane"]="DESIGN=FireSim TARGET_CONFIG=WithNIC_DDR3FRFCFSLLC4MB_FireSimArianeConfig PLATFORM_CONFIG=BaseF1Config"
mapping["firesim"]="SCALA_TEST=firesim.firesim.RocketNICF1Tests"
mapping["firesim-multiclock"]="SCALA_TEST=firesim.firesim.RocketMulticlockF1Tests"
mapping["fireboom"]="SCALA_TEST=firesim.firesim.BoomF1Tests"
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,28 @@ cd $LOCAL_CHIPYARD_DIR/sims/firesim
./scripts/build-libdwarf.sh
cd $LOCAL_CHIPYARD_DIR


# set stricthostkeychecking to no (must happen before rsync)
run "echo \"Ping $SERVER\""

clean

# copy over riscv/esp-tools, and chipyard to remote
run "mkdir -p $REMOTE_CHIPYARD_DIR"
run "mkdir -p $REMOTE_RISCV_DIR"
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR

run "cp -r ~/.ivy2 $REMOTE_WORK_DIR"
run "cp -r ~/.sbt $REMOTE_WORK_DIR"

TOOLS_DIR=$REMOTE_RISCV_DIR
LD_LIB_DIR=$REMOTE_RISCV_DIR/lib

if [ $1 = "hwacha" ] || [ $1 = "gemmini" ]; then
TOOLS_DIR=$REMOTE_ESP_DIR
LD_LIB_DIR=$REMOTE_ESP_DIR/lib
run "mkdir -p $REMOTE_ESP_DIR"
copy $LOCAL_ESP_DIR/ $SERVER:$REMOTE_ESP_DIR
else
run "mkdir -p $REMOTE_RISCV_DIR"
copy $LOCAL_RISCV_DIR/ $SERVER:$REMOTE_RISCV_DIR
fi

# Build MIDAS-level verilator sim
FIRESIM_VARS="${mapping[$1]}"
run "export FIRESIM_ENV_SOURCED=1; make -C $REMOTE_FIRESIM_DIR clean"
# Run Firesim Scala Tests
run "export RISCV=\"$TOOLS_DIR\"; \
export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \
export FIRESIM_ENV_SOURCED=1; \
export PATH=\"$REMOTE_VERILATOR_DIR/bin:\$PATH\"; \
export VERILATOR_ROOT=\"$REMOTE_VERILATOR_DIR\"; \
export FIRESIM_ENV_SOURCED=1; \
make -C $REMOTE_FIRESIM_DIR JAVA_ARGS=\"$REMOTE_JAVA_ARGS\" $FIRESIM_VARS verilator"
run "rm -rf $REMOTE_CHIPYARD_DIR/project"

# copy back the final build
mkdir -p $LOCAL_CHIPYARD_DIR
copy $SERVER:$REMOTE_CHIPYARD_DIR/ $LOCAL_CHIPYARD_DIR

# Fix dramsim2_ini symlink
export $FIRESIM_VARS
ln -sf $LOCAL_FIRESIM_DIR/midas/src/main/resources/dramsim2_ini $LOCAL_FIRESIM_DIR/generated-src/f1/${DESIGN}-${TARGET_CONFIG}-${PLATFORM_CONFIG}/dramsim2_ini
make -C $REMOTE_FIRESIM_DIR JAVA_ARGS=\"$REMOTE_JAVA_ARGS\" testOnly ${mapping[$1]}"
29 changes: 0 additions & 29 deletions .circleci/run-firesim-tests.sh

This file was deleted.

2 changes: 1 addition & 1 deletion generators/ariane
3 changes: 3 additions & 0 deletions generators/firechip/src/test/scala/ScalaTestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class BoomF1Tests extends FireSimTestSuite("FireSim", "DDR3FRFCFSLLC4MB_FireSimL
class RocketNICF1Tests extends FireSimTestSuite("FireSim", "WithNIC_DDR3FRFCFSLLC4MB_FireSimRocketConfig", "BaseF1Config") {
runSuite("verilator")(NICLoopbackTests)
}
class ArianeF1Tests extends FireSimTestSuite("FireSim", "WithNIC_DDR3FRFCFSLLC4MB_FireSimArianeConfig", "BaseF1Config") {
runSuite("verilator")(NICLoopbackTests)
}
// Disabled until RAM optimizations re-enabled in multiclock
//class RamModelRocketF1Tests extends FireSimTestSuite("FireSim", "FireSimDualRocketConfig", "BaseF1Config_MCRams")
//class RamModelBoomF1Tests extends FireSimTestSuite("FireSim", "FireSimBoomConfig", "BaseF1Config_MCRams")
Expand Down
2 changes: 1 addition & 1 deletion sims/firesim

0 comments on commit b042886

Please sign in to comment.