2017-12-13 03:12:30 +01:00
|
|
|
// See LICENSE.Berkeley for license details.
|
|
|
|
|
|
|
|
import sbt.complete._
|
|
|
|
import sbt.complete.DefaultParsers._
|
2017-12-13 03:46:51 +01:00
|
|
|
import xerial.sbt.pack._
|
|
|
|
import sys.process._
|
|
|
|
|
|
|
|
enablePlugins(PackPlugin)
|
2017-12-13 03:12:30 +01:00
|
|
|
|
|
|
|
lazy val commonSettings = Seq(
|
|
|
|
organization := "berkeley",
|
|
|
|
version := "1.2",
|
|
|
|
scalaVersion := "2.11.12",
|
|
|
|
parallelExecution in Global := false,
|
|
|
|
traceLevel := 15,
|
|
|
|
scalacOptions ++= Seq("-deprecation","-unchecked"),
|
|
|
|
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value),
|
2018-01-09 03:13:00 +01:00
|
|
|
libraryDependencies ++= Seq("org.json4s" %% "json4s-jackson" % "3.5.0"),
|
2017-12-13 03:12:30 +01:00
|
|
|
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val chisel = (project in file("chisel3")).settings(commonSettings)
|
|
|
|
lazy val hardfloat = project.dependsOn(chisel).settings(commonSettings)
|
|
|
|
lazy val macros = (project in file("macros")).settings(commonSettings)
|
|
|
|
lazy val rocketchip = (project in file("."))
|
|
|
|
.settings(commonSettings, chipSettings)
|
|
|
|
.dependsOn(chisel, hardfloat, macros)
|
|
|
|
|
|
|
|
lazy val addons = settingKey[Seq[String]]("list of addons used for this build")
|
|
|
|
lazy val make = inputKey[Unit]("trigger backend-specific makefile command")
|
|
|
|
val setMake = NotSpace ~ ( Space ~> NotSpace )
|
|
|
|
|
2017-12-13 03:46:51 +01:00
|
|
|
val chipSettings = Seq(
|
2017-12-13 03:12:30 +01:00
|
|
|
addons := {
|
|
|
|
val a = sys.env.getOrElse("ROCKETCHIP_ADDONS", "")
|
|
|
|
println(s"Using addons: $a")
|
|
|
|
a.split(" ")
|
|
|
|
},
|
|
|
|
unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"),
|
|
|
|
mainClass in (Compile, run) := Some("rocketchip.Generator"),
|
|
|
|
make := {
|
|
|
|
val jobs = java.lang.Runtime.getRuntime.availableProcessors
|
|
|
|
val (makeDir, target) = setMake.parsed
|
|
|
|
(run in Compile).evaluated
|
2017-12-13 03:46:51 +01:00
|
|
|
s"make -C $makeDir -j $jobs $target".!
|
2017-12-13 03:12:30 +01:00
|
|
|
}
|
|
|
|
)
|
2018-01-09 03:13:00 +01:00
|
|
|
|