From 8a77a25dc9e5736b1408745eaca257916fb46fbe Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Wed, 8 Sep 2021 20:46:57 +0000 Subject: [PATCH 1/3] Bump Firesim --- sims/firesim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sims/firesim b/sims/firesim index b611551c..9598f1ef 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit b611551ca5ea391513584dc2cde3d82717309125 +Subproject commit 9598f1efe9e838858b0b3d0fc66fe22f2471d486 From f064ff8848e75b034e1e567e73a8b8e35c3a9eab Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Wed, 8 Sep 2021 21:06:05 +0000 Subject: [PATCH 2/3] [CI] Update setup for firesim tests --- .circleci/run-firesim-scala-tests.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.circleci/run-firesim-scala-tests.sh b/.circleci/run-firesim-scala-tests.sh index 23c4d08a..a848df62 100755 --- a/.circleci/run-firesim-scala-tests.sh +++ b/.circleci/run-firesim-scala-tests.sh @@ -13,13 +13,20 @@ source $SCRIPT_DIR/defaults.sh # call clean on exit trap clean EXIT +# Directory locations for handling firesim-local installations of libelf/libdwarf +# This would generally be handled by build-setup.sh/firesim-setup.sh +firesim_sysroot=lib-install +local_firesim_sysroot=$LOCAL_FIRESIM_DIR/$firesim_sysroot +remote_firesim_sysroot=$REMOTE_FIRESIM_DIR/$firesim_sysroot + cd $LOCAL_CHIPYARD_DIR ./scripts/init-submodules-no-riscv-tools.sh cd $LOCAL_CHIPYARD_DIR/sims/firesim/sim/firesim-lib/src/main/cc/lib git submodule update --init elfutils libdwarf cd $LOCAL_CHIPYARD_DIR/sims/firesim -./scripts/build-libelf.sh -./scripts/build-libdwarf.sh +mkdir -p $local_firesim_sysroot +./scripts/build-libelf.sh $local_firesim_sysroot +./scripts/build-libdwarf.sh $local_firesim_sysroot cd $LOCAL_CHIPYARD_DIR # replace the workspace dir with a local dir so you can copy around @@ -42,8 +49,8 @@ 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 +LD_LIB_DIR=$remote_firesim_sysroot/lib:$REMOTE_RISCV_DIR/lib # Run Firesim Scala Tests run "export RISCV=\"$TOOLS_DIR\"; \ From 580d3110598e911d32cd840a702a9fc662d52f5f Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Wed, 8 Sep 2021 21:23:43 +0000 Subject: [PATCH 3/3] Use ResetPulseBridge + GlobalResetCondition; bump FireSim --- .../firechip/src/main/scala/FireSim.scala | 18 ++++++++++++++++-- sims/firesim | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/generators/firechip/src/main/scala/FireSim.scala b/generators/firechip/src/main/scala/FireSim.scala index 79242d2e..661ddb99 100644 --- a/generators/firechip/src/main/scala/FireSim.scala +++ b/generators/firechip/src/main/scala/FireSim.scala @@ -13,7 +13,7 @@ import freechips.rocketchip.config.{Field, Config, Parameters} import freechips.rocketchip.diplomacy.{LazyModule, InModuleBody, ValName} import freechips.rocketchip.util.{ResetCatchAndSync, RecordMap} -import midas.widgets.{Bridge, PeekPokeBridge, RationalClockBridge, RationalClock} +import midas.widgets.{Bridge, PeekPokeBridge, RationalClockBridge, RationalClock, ResetPulseBridge, ResetPulseBridgeParameters} import chipyard._ import chipyard.harness._ @@ -227,7 +227,21 @@ class FireSim(implicit val p: Parameters) extends RawModule with HasHarnessSigna val buildtopClock = Wire(Clock()) val buildtopReset = WireInit(false.B) - val peekPokeBridge = PeekPokeBridge(buildtopClock, buildtopReset) + // The peek-poke bridge must still be instantiated even though it's + // functionally unused. This will be removed in a future PR. + val dummy = WireInit(false.B) + val peekPokeBridge = PeekPokeBridge(buildtopClock, dummy) + + val resetBridge = Module(new ResetPulseBridge(ResetPulseBridgeParameters())) + // In effect, the bridge counts the length of the reset in terms of this clock. + resetBridge.io.clock := buildtopClock + buildtopReset := resetBridge.io.reset + // Ensures FireSim-synthesized assertions and instrumentation is disabled + // while buildtopReset is asserted. This ensures assertions do not fire at + // time zero in the event their local reset is delayed (typically because it + // has been pipelined) + midas.targetutils.GlobalResetCondition(buildtopReset) + def dutReset = { require(false, "dutReset should not be used in Firesim"); false.B } def success = { require(false, "success should not be used in Firesim"); false.B } diff --git a/sims/firesim b/sims/firesim index 9598f1ef..a2a6b3bc 160000 --- a/sims/firesim +++ b/sims/firesim @@ -1 +1 @@ -Subproject commit 9598f1efe9e838858b0b3d0fc66fe22f2471d486 +Subproject commit a2a6b3bc27ee049d7bf5048287700d65ac66d126