diff --git a/build.sbt b/build.sbt new file mode 100644 index 00000000..2fbb499d --- /dev/null +++ b/build.sbt @@ -0,0 +1,46 @@ +// See LICENSE.Berkeley for license details. + +import sbt.complete._ +import sbt.complete.DefaultParsers._ +import xerial.sbt.pack._ +import sys.process._ + +enablePlugins(PackPlugin) + +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), + 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 ) + +val chipSettings = Seq( + 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 + s"make -C $makeDir -j $jobs $target".! + } +) diff --git a/chisel3 b/chisel3 index 30e8eb55..9f504b99 160000 --- a/chisel3 +++ b/chisel3 @@ -1 +1 @@ -Subproject commit 30e8eb552a29b22bc23faa06f5661da6129188b2 +Subproject commit 9f504b9926d38d11fb8003c72360ff11d24b5ef6 diff --git a/emulator/Makefrag-verilator b/emulator/Makefrag-verilator index 021e131c..a83426ba 100644 --- a/emulator/Makefrag-verilator +++ b/emulator/Makefrag-verilator @@ -10,7 +10,7 @@ verilog = \ $(generated_dir)/%.fir $(generated_dir)/%.d: $(FIRRTL_JAR) $(chisel_srcs) $(bootrom_img) mkdir -p $(dir $@) - cd $(base_dir) && $(SBT) "run-main $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" + cd $(base_dir) && $(SBT) "runMain $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" %.v %.conf: %.fir $(FIRRTL_JAR) mkdir -p $(dir $@) diff --git a/firrtl b/firrtl index 40dda493..8ab501e7 160000 --- a/firrtl +++ b/firrtl @@ -1 +1 @@ -Subproject commit 40dda493a277f721306d428ee967dcb670813275 +Subproject commit 8ab501e7527139a4ee8d0b38f9b4384551387043 diff --git a/project/build.properties b/project/build.properties index c091b86c..394cb75c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16 +sbt.version=1.0.4 diff --git a/project/build.scala b/project/build.scala deleted file mode 100644 index 6d8d1e28..00000000 --- a/project/build.scala +++ /dev/null @@ -1,46 +0,0 @@ -// See LICENSE.Berkeley for license details. - -import sbt._ -import Keys._ -import complete._ -import complete.DefaultParsers._ -import xerial.sbt.Pack._ - -object BuildSettings extends Build { - - override lazy val settings = super.settings ++ Seq( - organization := "berkeley", - version := "1.2", - scalaVersion := "2.11.11", - parallelExecution in Global := false, - traceLevel := 15, - scalacOptions ++= Seq("-deprecation","-unchecked"), - libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value), - addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) - ) - - lazy val chisel = project in file("chisel3") - lazy val hardfloat = project.dependsOn(chisel) - lazy val macros = project in file("macros") - lazy val rocketchip = (project in file(".")).settings(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 ) - - val chipSettings = packAutoSettings ++ Seq( - 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 - s"make -C $makeDir -j $jobs $target" ! - } - ) -} diff --git a/project/plugins.sbt b/project/plugins.sbt index 715be580..ed9ac0ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,11 +2,11 @@ resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven" addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") -addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.8.0") +addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.9.3") addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1") diff --git a/vsim/Makefrag-verilog b/vsim/Makefrag-verilog index d0571eeb..7514be2e 100644 --- a/vsim/Makefrag-verilog +++ b/vsim/Makefrag-verilog @@ -10,7 +10,7 @@ verilog = $(generated_dir)/$(long_name).v $(generated_dir)/%.fir $(generated_dir)/%.d: $(FIRRTL_JAR) $(chisel_srcs) $(bootrom_img) mkdir -p $(dir $@) - cd $(base_dir) && $(SBT) "run-main $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" + cd $(base_dir) && $(SBT) "runMain $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" $(generated_dir)/%.v $(generated_dir)/%.conf: $(generated_dir)/%.fir $(FIRRTL_JAR) mkdir -p $(dir $@)