2016-11-28 01:16:37 +01:00
|
|
|
// See LICENSE.Berkeley for license details.
|
|
|
|
|
2012-10-02 04:30:11 +02:00
|
|
|
import sbt._
|
|
|
|
import Keys._
|
2015-07-22 20:49:10 +02:00
|
|
|
import complete._
|
|
|
|
import complete.DefaultParsers._
|
2016-08-09 04:31:03 +02:00
|
|
|
import xerial.sbt.Pack._
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2012-10-21 02:27:49 +02:00
|
|
|
object BuildSettings extends Build {
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2015-07-22 20:49:10 +02:00
|
|
|
override lazy val settings = super.settings ++ Seq(
|
|
|
|
organization := "berkeley",
|
|
|
|
version := "1.2",
|
2016-03-06 03:42:45 +01:00
|
|
|
scalaVersion := "2.11.7",
|
2013-11-09 00:30:08 +01:00
|
|
|
parallelExecution in Global := false,
|
2013-07-25 08:28:43 +02:00
|
|
|
traceLevel := 15,
|
|
|
|
scalacOptions ++= Seq("-deprecation","-unchecked"),
|
2017-05-12 15:25:58 +02:00
|
|
|
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value),
|
|
|
|
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
|
2012-10-02 04:30:11 +02:00
|
|
|
)
|
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
lazy val chisel = project in file("chisel3")
|
2015-11-10 22:39:08 +01:00
|
|
|
lazy val hardfloat = project.dependsOn(chisel)
|
2017-09-12 04:31:44 +02:00
|
|
|
lazy val macros = project in file("macros")
|
|
|
|
lazy val rocketchip = (project in file(".")).settings(chipSettings).dependsOn(chisel, hardfloat, macros)
|
2014-09-25 15:45:09 +02:00
|
|
|
|
2015-07-22 20:49:10 +02:00
|
|
|
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 )
|
2012-11-18 04:58:18 +01:00
|
|
|
|
2016-08-09 04:31:03 +02:00
|
|
|
val chipSettings = packAutoSettings ++ Seq(
|
2015-07-22 20:49:10 +02:00
|
|
|
addons := {
|
|
|
|
val a = sys.env.getOrElse("ROCKETCHIP_ADDONS", "")
|
|
|
|
println(s"Using addons: $a")
|
2015-12-09 20:17:16 +01:00
|
|
|
a.split(" ")
|
2012-10-23 21:51:37 +02:00
|
|
|
},
|
2015-07-22 20:49:10 +02:00
|
|
|
unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"),
|
2016-09-23 00:59:29 +02:00
|
|
|
mainClass in (Compile, run) := Some("rocketchip.Generator"),
|
2015-07-22 20:49:10 +02:00
|
|
|
make := {
|
|
|
|
val jobs = java.lang.Runtime.getRuntime.availableProcessors
|
|
|
|
val (makeDir, target) = setMake.parsed
|
|
|
|
(run in Compile).evaluated
|
|
|
|
s"make -C $makeDir -j $jobs $target" !
|
2012-10-23 21:51:37 +02:00
|
|
|
}
|
|
|
|
)
|
2012-10-02 04:30:11 +02:00
|
|
|
}
|