2018-11-09 13:41:11 +08:00
|
|
|
import Tests._
|
|
|
|
|
2018-05-14 03:40:34 +08:00
|
|
|
lazy val commonSettings = Seq(
|
|
|
|
organization := "berkeley",
|
|
|
|
version := "1.0",
|
2019-12-11 06:48:11 +08:00
|
|
|
scalaVersion := "2.12.10",
|
2018-05-14 03:40:34 +08:00
|
|
|
traceLevel := 15,
|
2018-09-23 07:34:05 +08:00
|
|
|
scalacOptions ++= Seq("-deprecation","-unchecked","-Xsource:2.11"),
|
2019-12-11 06:48:11 +08:00
|
|
|
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test",
|
2019-05-28 06:49:44 +08:00
|
|
|
libraryDependencies += "org.json4s" %% "json4s-native" % "3.6.1",
|
2018-05-14 03:40:34 +08:00
|
|
|
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
|
2019-06-29 03:15:02 +08:00
|
|
|
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
|
2019-09-24 11:52:14 +08:00
|
|
|
exportJars := true,
|
2019-06-29 03:15:02 +08:00
|
|
|
resolvers ++= Seq(
|
|
|
|
Resolver.sonatypeRepo("snapshots"),
|
|
|
|
Resolver.sonatypeRepo("releases"),
|
|
|
|
Resolver.mavenLocal)
|
2018-05-14 03:40:34 +08:00
|
|
|
)
|
|
|
|
|
2018-11-09 13:41:11 +08:00
|
|
|
// Fork each scala test for now, to work around persistent mutable state
|
2019-05-28 06:49:44 +08:00
|
|
|
// in Rocket-Chip based generators
|
2018-11-09 13:41:11 +08:00
|
|
|
def isolateAllTests(tests: Seq[TestDefinition]) = tests map { test =>
|
|
|
|
val options = ForkOptions()
|
|
|
|
new Group(test.name, Seq(test), SubProcess(options))
|
|
|
|
} toSeq
|
|
|
|
|
|
|
|
testGrouping in Test := isolateAllTests( (definedTests in Test).value )
|
|
|
|
|
2019-05-28 06:49:44 +08:00
|
|
|
lazy val firesimAsLibrary = sys.env.get("FIRESIM_STANDALONE") == None
|
2018-05-14 03:40:34 +08:00
|
|
|
|
2019-06-29 01:56:11 +08:00
|
|
|
lazy val chipyardDir = if(firesimAsLibrary) {
|
2019-05-28 06:49:44 +08:00
|
|
|
file("../../../")
|
|
|
|
} else {
|
2019-11-06 05:15:34 +08:00
|
|
|
file("../target-design/chipyard")
|
2019-05-28 06:49:44 +08:00
|
|
|
}
|
2018-11-28 04:40:59 +08:00
|
|
|
|
2020-02-07 12:04:48 +08:00
|
|
|
lazy val chipyard = ProjectRef(chipyardDir, "chipyard")
|
2019-06-29 01:56:11 +08:00
|
|
|
lazy val chisel = ProjectRef(chipyardDir, "chisel")
|
|
|
|
lazy val rocketchip = ProjectRef(chipyardDir, "rocketchip")
|
|
|
|
lazy val barstools = ProjectRef(chipyardDir, "barstoolsMacros")
|
|
|
|
lazy val icenet = ProjectRef(chipyardDir, "icenet")
|
|
|
|
lazy val testchipip = ProjectRef(chipyardDir, "testchipip")
|
|
|
|
lazy val sifive_blocks = ProjectRef(chipyardDir, "sifive_blocks")
|
|
|
|
lazy val firechip = ProjectRef(chipyardDir, "firechip")
|
2018-11-28 04:40:59 +08:00
|
|
|
|
2019-05-28 06:49:44 +08:00
|
|
|
lazy val targetutils = (project in file("midas/targetutils"))
|
2018-11-28 04:40:59 +08:00
|
|
|
.settings(commonSettings)
|
2019-05-28 06:49:44 +08:00
|
|
|
.dependsOn(chisel)
|
2018-11-28 04:40:59 +08:00
|
|
|
|
2019-09-24 11:52:14 +08:00
|
|
|
// We cannot forward reference firesim from midas (this creates a circular
|
|
|
|
// dependency on the project definitions), so declare a reference to it
|
|
|
|
// first and use that to append to our RuntimeClasspath
|
|
|
|
lazy val firesimRef = ProjectRef(file("."), "firesim")
|
|
|
|
|
|
|
|
lazy val midas = (project in file("midas"))
|
|
|
|
.dependsOn(barstools, rocketchip)
|
|
|
|
.settings(commonSettings,
|
|
|
|
Runtime / fullClasspathAsJars ++= ((firesimRef / Runtime / fullClasspath).value ++
|
|
|
|
(firechip / Runtime / fullClasspath).value)
|
|
|
|
)
|
2019-05-28 06:49:44 +08:00
|
|
|
|
|
|
|
lazy val firesimLib = (project in file("firesim-lib"))
|
2020-02-07 12:04:48 +08:00
|
|
|
.settings(commonSettings).dependsOn(midas, icenet, testchipip, chipyard, sifive_blocks)
|
2018-05-14 03:40:34 +08:00
|
|
|
|
2019-05-28 06:49:44 +08:00
|
|
|
// Contains example targets, like the MIDAS examples, and FASED tests
|
2018-11-28 04:40:59 +08:00
|
|
|
lazy val firesim = (project in file("."))
|
2019-05-28 06:49:44 +08:00
|
|
|
.settings(commonSettings).dependsOn(chisel, rocketchip, midas, firesimLib % "test->test;compile->compile")
|