Skip to content

Commit

Permalink
Bump to scala 2.13.10/chisel 3.5.5/latest rocketchip
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Jan 20, 2023
1 parent 749f844 commit 6ea82bd
Show file tree
Hide file tree
Showing 31 changed files with 81 additions and 66 deletions.
23 changes: 9 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ lazy val chipyardRoot = Project("chipyardRoot", file("."))
lazy val commonSettings = Seq(
organization := "edu.berkeley.cs",
version := "1.6",
scalaVersion := "2.12.10",
scalaVersion := "2.13.10",
assembly / test := {},
assembly / assemblyMergeStrategy := { _ match {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case _ => MergeStrategy.first}},
scalacOptions ++= Seq("-deprecation","-unchecked","-Xsource:2.11"),
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
scalacOptions ++= Seq("-deprecation","-unchecked"),
unmanagedBase := (chipyardRoot / unmanagedBase).value,
allDependencies := {
// drop specific maven dependencies in subprojects in favor of Chipyard's version
Expand Down Expand Up @@ -60,17 +59,14 @@ def isolateAllTests(tests: Seq[TestDefinition]) = tests map { test =>
new Group(test.name, Seq(test), SubProcess(options))
} toSeq

val chiselVersion = "3.5.2"
val chiselVersion = "3.5.5"

lazy val chiselSettings = Seq(
libraryDependencies ++= Seq("edu.berkeley.cs" %% "chisel3" % chiselVersion,
"org.apache.commons" % "commons-lang3" % "3.12.0",
"org.apache.commons" % "commons-text" % "1.9"),
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full))

val firrtlVersion = "1.5.1"

lazy val firrtlSettings = Seq(libraryDependencies ++= Seq("edu.berkeley.cs" %% "firrtl" % firrtlVersion))

val chiselTestVersion = "2.5.1"

Expand All @@ -88,7 +84,7 @@ lazy val hardfloat = (project in rocketChipDir / "hardfloat")
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.json4s" %% "json4s-jackson" % "3.6.1",
"org.json4s" %% "json4s-jackson" % "3.6.6",
"org.scalatest" %% "scalatest" % "3.2.0" % "test"
)
)
Expand All @@ -98,7 +94,7 @@ lazy val rocketMacros = (project in rocketChipDir / "macros")
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.json4s" %% "json4s-jackson" % "3.6.1",
"org.json4s" %% "json4s-jackson" % "3.6.6",
"org.scalatest" %% "scalatest" % "3.2.0" % "test"
)
)
Expand All @@ -108,7 +104,7 @@ lazy val rocketConfig = (project in rocketChipDir / "api-config-chipsalliance/bu
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.json4s" %% "json4s-jackson" % "3.6.1",
"org.json4s" %% "json4s-jackson" % "3.6.6",
"org.scalatest" %% "scalatest" % "3.2.0" % "test"
)
)
Expand All @@ -120,15 +116,14 @@ lazy val rocketchip = freshProject("rocketchip", rocketChipDir)
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.json4s" %% "json4s-jackson" % "3.6.1",
"org.apache.commons" % "commons-lang3" % "3.12.0",
"org.json4s" %% "json4s-jackson" % "3.6.6",
"org.scalatest" %% "scalatest" % "3.2.0" % "test"
)
)
.settings( // Settings for scalafix
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
scalacOptions += "-Ywarn-unused-import"
scalacOptions += "-Ywarn-unused"
)
lazy val rocketLibDeps = (rocketchip / Keys.libraryDependencies)

Expand Down Expand Up @@ -242,7 +237,7 @@ lazy val dsptools = freshProject("dsptools", file("./tools/dsptools"))
commonSettings,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.+" % "test",
"org.typelevel" %% "spire" % "0.16.2",
"org.typelevel" %% "spire" % "0.17.0",
"org.scalanlp" %% "breeze" % "1.1",
"junit" % "junit" % "4.13" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.3" % "test",
Expand Down
14 changes: 12 additions & 2 deletions generators/chipyard/src/main/scala/HarnessBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,14 @@ class WithTieOffInterrupts extends OverrideHarnessBinder({

class WithTieOffL2FBusAXI extends OverrideHarnessBinder({
(system: CanHaveSlaveAXI4Port, th: HasHarnessSignalReferences, ports: Seq[ClockedIO[AXI4Bundle]]) => {
ports.foreach({ p => p := DontCare; p.bits.tieoff() })
ports.foreach({ p =>
p.bits := DontCare
p.bits.aw.valid := false.B
p.bits.w.valid := false.B
p.bits.b.ready := false.B
p.bits.ar.valid := false.B
p.bits.r.ready := false.B
})
}
})

Expand Down Expand Up @@ -274,7 +281,10 @@ class WithTiedOffDebug extends OverrideHarnessBinder({
d.dmiClock := false.B.asClock
d.dmiReset := true.B
case a: ClockedAPBBundle =>
a.tieoff()
a.pready := false.B
a.pslverr := false.B
a.prdata := 0.U
a.pduser := DontCare
a.clock := false.B.asClock
a.reset := true.B.asAsyncReset
a.psel := false.B
Expand Down
6 changes: 3 additions & 3 deletions generators/chipyard/src/main/scala/IOBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class WithAXI4MemPunchthrough extends OverrideLazyIOBinder({
p.clock := clockBundle.clock
p.reset := clockBundle.reset
p
})
}).toSeq
(ports, Nil)
}
}
Expand All @@ -307,7 +307,7 @@ class WithAXI4MMIOPunchthrough extends OverrideLazyIOBinder({
p.clock := clockBundle.clock
p.reset := clockBundle.reset
p
})
}).toSeq
(ports, Nil)
}
}
Expand All @@ -326,7 +326,7 @@ class WithL2FBusAXI4Punchthrough extends OverrideLazyIOBinder({
m <> p.bits
p.clock := clockBundle.clock
p
})
}).toSeq
(ports, Nil)
}
}
Expand Down
4 changes: 4 additions & 0 deletions generators/chipyard/src/main/scala/TestSuites.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ class TestSuiteHelper
addSuites(env.map(rv32uf))
if (cfg.fLen >= 64)
addSuites(env.map(rv32ud))
if (cfg.minFLen <= 16)
addSuites(env.map(rv32uzfh))
} else {
addSuite(rv32udBenchmarks)
addSuites(env.map(rv64uf))
if (cfg.fLen >= 64)
addSuites(env.map(rv64ud))
if (cfg.minFLen <= 16)
addSuites(env.map(rv64uzfh))
}
}
if (coreParams.useAtomics) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ case class DividerOnlyClockGeneratorNode(pllName: String)(implicit valName: ValN
class DividerOnlyClockGenerator(pllName: String)(implicit p: Parameters, valName: ValName) extends LazyModule {
val node = DividerOnlyClockGeneratorNode(pllName)

lazy val module = new LazyRawModuleImp(this) {
lazy val module = new Impl
class Impl extends LazyRawModuleImp(this) {
require(node.out.size == 1, "Idealized PLL expects to generate a single output clock group. Use a ClockGroupAggregator")
val (refClock, ClockEdgeParameters(_, refSinkParam, _, _)) = node.in.head
val (outClocks, ClockGroupEdgeParameters(_, outSinkParams, _, _)) = node.out.head
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TileResetSetter(address: BigInt, beatBytes: Int, tileNames: Seq[String], i
}
})
tlNode.regmap((0 until nTiles).map({ i =>
i * 4 -> Seq(RegField.rwReg(1, r_tile_resets(i).io)),
i * 4 -> Seq(RegField.rwReg(1, r_tile_resets(i).io))
}): _*)

val tileMap = tileNames.zipWithIndex.map({ case (n, i) =>
Expand Down
4 changes: 4 additions & 0 deletions generators/chipyard/src/main/scala/example/TutorialTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ case class MyCoreParams(
val decodeWidth: Int = 1 // TODO: Check
val fetchWidth: Int = 1 // TODO: Check
val retireWidth: Int = 2
val useBitManip: Boolean = false
val useBitManipCrypto: Boolean = false
val useCryptoNIST: Boolean = false
val useCryptoSM: Boolean = false
}

// DOC include start: CanAttachTile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AddDefaultTests extends Phase with HasRocketChipStageUtils {
// If a custom test suite is set up, use the custom test suite
annotations += CustomMakefragSnippet(p(TestSuitesKey).apply(tileParams, suiteHelper, p))

RocketTestSuiteAnnotation(suiteHelper.suites.values.toSeq) +: annotations
RocketTestSuiteAnnotation(suiteHelper.suites.values.toSeq) +: annotations.toSeq
}


Expand Down
2 changes: 1 addition & 1 deletion generators/cva6
2 changes: 1 addition & 1 deletion generators/fft-generator
6 changes: 3 additions & 3 deletions generators/firechip/src/main/scala/BridgeBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class WithSerialBridge extends OverrideHarnessBinder({
val ram = withClockAndReset(th.buildtopClock, th.buildtopReset) {
SerialAdapter.connectHarnessRAM(system.serdesser.get, bits, th.buildtopReset)
}
SerialBridge(th.buildtopClock, ram.module.io.tsi_ser, p(ExtMem).map(_ => MainMemoryConsts.globalName))
SerialBridge(th.buildtopClock, ram.module.io.tsi_ser, p(ExtMem).map(_ => MainMemoryConsts.globalName), th.buildtopReset.asBool)
}
Nil
}
Expand All @@ -97,7 +97,7 @@ class WithUARTBridge extends OverrideHarnessBinder({
val pbusClockNode = system.outer.asInstanceOf[HasTileLinkLocations].locateTLBusWrapper(PBUS).fixedClockNode
val pbusClock = pbusClockNode.in.head._1.clock
BoringUtils.bore(pbusClock, Seq(uartSyncClock))
ports.map { p => UARTBridge(uartSyncClock, p)(system.p) }; Nil
ports.map { p => UARTBridge(uartSyncClock, p, th.buildtopReset.asBool)(system.p) }; Nil
})

class WithBlockDeviceBridge extends OverrideHarnessBinder({
Expand Down Expand Up @@ -134,7 +134,7 @@ class WithAXIOverSerialTLCombinedBridges extends OverrideHarnessBinder({
axiClockBundle,
th.buildtopReset)
}
SerialBridge(th.buildtopClock, harnessMultiClockAXIRAM.module.io.tsi_ser, Some(MainMemoryConsts.globalName))
SerialBridge(th.buildtopClock, harnessMultiClockAXIRAM.module.io.tsi_ser, Some(MainMemoryConsts.globalName), th.buildtopReset.asBool)

// connect SimAxiMem
(harnessMultiClockAXIRAM.mem_axi4 zip harnessMultiClockAXIRAM.memNode.edges.in).map { case (axi4, edge) =>
Expand Down
2 changes: 1 addition & 1 deletion generators/ibex
2 changes: 1 addition & 1 deletion generators/icenet
2 changes: 1 addition & 1 deletion generators/rocket-chip
Submodule rocket-chip updated 226 files
2 changes: 1 addition & 1 deletion generators/sha3
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.21")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3")
41 changes: 21 additions & 20 deletions scripts/build-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
set -e
set -o pipefail

RDIR=$(git rev-parse --show-toplevel)
CYDIR=$(git rev-parse --show-toplevel)

# get helpful utilities
source $RDIR/scripts/utils.sh
source $CYDIR/scripts/utils.sh

common_setup

Expand Down Expand Up @@ -90,7 +90,7 @@ run_step() {
# setup and install conda environment
if run_step "1"; then
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154
CONDA_REQS=$RDIR/conda-reqs
CONDA_REQS=$CYDIR/conda-reqs
CONDA_LOCK_REQS=$CONDA_REQS/conda-lock-reqs
LOCKFILE=$CONDA_LOCK_REQS/conda-requirements-$TOOLCHAIN_TYPE-linux-64.conda-lock.yml

Expand All @@ -100,10 +100,10 @@ if run_step "1"; then
fi

# use conda-lock to create env
conda-lock install -p $RDIR/.conda-env $LOCKFILE
conda-lock install -p $CYDIR/.conda-env $LOCKFILE

source $RDIR/.conda-env/etc/profile.d/conda.sh
conda activate $RDIR/.conda-env
source $CYDIR/.conda-env/etc/profile.d/conda.sh
conda activate $CYDIR/.conda-env
fi

if [ -z "$FORCE_FLAG" ]; then
Expand All @@ -115,8 +115,8 @@ fi

# initialize all submodules (without the toolchain submodules)
if run_step "2"; then
$RDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG
$RDIR/scripts/init-fpga.sh $FORCE_FLAG
$CYDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG
$CYDIR/scripts/init-fpga.sh $FORCE_FLAG
fi

# build extra toolchain collateral (i.e. spike, pk, riscv-tests, libgloss)
Expand All @@ -130,34 +130,35 @@ if run_step "3"; then
fi
PREFIX=$RISCV
fi
$RDIR/scripts/build-toolchain-extra.sh $TOOLCHAIN_TYPE -p $PREFIX
$CYDIR/scripts/build-toolchain-extra.sh $TOOLCHAIN_TYPE -p $PREFIX
fi

# run ctags for code navigation
if run_step "4"; then
$RDIR/scripts/gen-tags.sh
$CYDIR/scripts/gen-tags.sh
fi

# precompile chipyard scala sources
if run_step "5"; then
pushd $RDIR/sims/verilator
pushd $CYDIR/sims/verilator
make launch-sbt SBT_COMMAND=";project chipyard; compile"
make launch-sbt SBT_COMMAND=";project tapeout; compile"
popd
fi

# setup firesim
if run_step "6"; then
$RDIR/scripts/firesim-setup.sh
$RDIR/sims/firesim/gen-tags.sh
$CYDIR/scripts/firesim-setup.sh
$CYDIR/sims/firesim/gen-tags.sh

# precompile firesim scala sources
if run_step "7"; then
pushd $RDIR/sims/firesim
pushd $CYDIR/sims/firesim
(
echo $CYDIR
source sourceme-f1-manager.sh --skip-ssh-setup
pushd sim
make sbt SBT_COMMAND="project firechip; compile" TARGET_PROJECT=firesim
make sbt SBT_COMMAND="project {file:$CYDIR}firechip; compile" TARGET_PROJECT=firesim
popd
)
popd
Expand All @@ -166,12 +167,12 @@ fi

# setup firemarshal
if run_step "8"; then
pushd $RDIR/software/firemarshal
pushd $CYDIR/software/firemarshal
./init-submodules.sh

# precompile firemarshal buildroot sources
if run_step "9"; then
source $RDIR/scripts/fix-open-files.sh
source $CYDIR/scripts/fix-open-files.sh
./marshal $VERBOSE_FLAG build br-base.json
./marshal $VERBOSE_FLAG clean br-base.json
fi
Expand All @@ -180,13 +181,13 @@ fi

# do misc. cleanup for a "clean" git status
if run_step "10"; then
$RDIR/scripts/repo-clean.sh
$CYDIR/scripts/repo-clean.sh
fi

cat <<EOT >> env.sh
# line auto-generated by $0
conda activate $RDIR/.conda-env
source $RDIR/scripts/fix-open-files.sh
conda activate $CYDIR/.conda-env
source $CYDIR/scripts/fix-open-files.sh
EOT

echo "Setup complete!"
Expand Down
Loading

0 comments on commit 6ea82bd

Please sign in to comment.