From 5f02c7a69a77dceef65c9155c1418131730cb95d Mon Sep 17 00:00:00 2001 From: chick Date: Wed, 24 Feb 2016 13:03:02 -0800 Subject: changing build.sbt to prepare for chisel3 distribution copied machinery from chisel2 build.sbt added a few intellij lines to gitignore --- .gitignore | 3 +++ build.sbt | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 76 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index e59c9b3b..3242c220 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ generated/ /bin/ +.idea +target/ +*.iml \ No newline at end of file diff --git a/build.sbt b/build.sbt index 664a717e..87220069 100644 --- a/build.sbt +++ b/build.sbt @@ -1,22 +1,82 @@ -organization := "edu.berkeley.cs" +// See LICENSE for license details. -version := "3.0" +site.settings -name := "Chisel" +site.includeScaladoc() -scalaVersion := "2.11.6" +ghpages.settings -libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value, - "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test", - "org.scalacheck" %% "scalacheck" % "1.12.4" % "test") +lazy val chiselBuildSettings = Seq ( + organization := "edu.berkeley.cs", + version := "3.0", + name := "Chisel", + git.remoteRepo := "git@github.com:ucb-bar/chisel3.git", -site.settings + scalaVersion := "2.11.7", + publishMavenStyle := true, + publishArtifact in Test := false, + pomIncludeRepository := { x => false }, + pomExtra := http://chisel.eecs.berkeley.edu/ + + + BSD-style + http://www.opensource.org/licenses/bsd-license.php + repo + + + + https://github.com/ucb-bar/chisel3.git + scm:git:github.com/ucb-bar/chisel3.git + + + + jackbackrack + Jonathan Bachrach + http://www.eecs.berkeley.edu/~jrb/ + + , -site.includeScaladoc() + publishTo <<= version { v: String => + val nexus = "https://oss.sonatype.org/" + if (v.trim.endsWith("SNAPSHOT")) { + Some("snapshots" at nexus + "content/repositories/snapshots") + } + else { + Some("releases" at nexus + "service/local/staging/deploy/maven2") + } + }, -ghpages.settings + resolvers ++= Seq( + "Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", + "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases" + ), + + /* Bumping "com.novocode" % "junit-interface" % "0.11", causes DelayTest testSeqReadBundle to fail + * in subtly disturbing ways on Linux (but not on Mac): + * - some fields in the generated .h file are re-named, + * - an additional field is added + * - the generated .cpp file has additional differences: + * - different temps in clock_lo + * - missing assignments + * - change of assignment order + * - use of "Tx" vs. "Tx.values" + */ + libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test", + libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, + libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.12.4" % "test", + + // Tests from other projects may still run concurrently. + parallelExecution in Test := true, + + (scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml", -git.remoteRepo := "git@github.com:ucb-bar/chisel3.git" + javacOptions ++= Seq("-target", "1.7") + // Hopefully we get these options back in Chisel3 + // scalacOptions in (Compile, doc) <++= (baseDirectory in LocalProject("chisel"), version) map { (bd, v) => + // Seq("-diagrams", "-diagrams-max-classes", "25", "-sourcepath", bd.getAbsolutePath, "-doc-source-url", + // "https://github.com/ucb-bar/chisel/tree/master/€{FILE_PATH}.scala") + // } +) -(scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml" -(parallelExecution in Test) := true +lazy val chisel = (project in file(".")). + settings(chiselBuildSettings: _*) -- cgit v1.2.3 From 8c332c16d05eccc735b45b1f2ad42a501d6f5105 Mon Sep 17 00:00:00 2001 From: chick Date: Wed, 24 Feb 2016 13:51:49 -0800 Subject: sonatype repo will be using chisel3 as the base name --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 87220069..9d75cac1 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ ghpages.settings lazy val chiselBuildSettings = Seq ( organization := "edu.berkeley.cs", version := "3.0", - name := "Chisel", + name := "Chisel3", git.remoteRepo := "git@github.com:ucb-bar/chisel3.git", scalaVersion := "2.11.7", -- cgit v1.2.3 From 3d6bc9270d5c08941a2b2e17cbf028368b220c07 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Sat, 5 Mar 2016 18:25:38 -0800 Subject: Remove scalastyle test hook I can't get this to work when Chisel 3 is installed as a submodule. --- build.sbt | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.sbt b/build.sbt index 9d75cac1..3cd496bb 100644 --- a/build.sbt +++ b/build.sbt @@ -68,8 +68,6 @@ lazy val chiselBuildSettings = Seq ( // Tests from other projects may still run concurrently. parallelExecution in Test := true, - (scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml", - javacOptions ++= Seq("-target", "1.7") // Hopefully we get these options back in Chisel3 // scalacOptions in (Compile, doc) <++= (baseDirectory in LocalProject("chisel"), version) map { (bd, v) => -- cgit v1.2.3 From 33e90d106a782f0f1075b0fab8ac344503a6cadf Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Sat, 5 Mar 2016 21:40:14 -0800 Subject: Actually parse "--targetDir" I'm trying to get RocketChip to work with Chisel3 again, and we need to run in multiple directories. This fixes the workaround I made earlier to actually parse the passed command-line arguments so I can emit FIRRTL in the correct directory. --- src/main/scala/Chisel/Driver.scala | 11 +++++++++-- src/main/scala/Chisel/Main.scala | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/scala/Chisel/Driver.scala b/src/main/scala/Chisel/Driver.scala index a6f61f69..61b74dcd 100644 --- a/src/main/scala/Chisel/Driver.scala +++ b/src/main/scala/Chisel/Driver.scala @@ -114,6 +114,13 @@ object Driver extends BackendCompilationUtilities { f } - // FIXME: This is hard coded and should come in from a command-line argument - def targetDir(): String = { "vsim/generated-src" } + private var target_dir: Option[String] = None + def parseArgs(args: Array[String]): Unit = { + for (i <- 0 until args.size) { + if (args(i) == "--targetDir") + target_dir = Some(args(i+1)) + } + } + + def targetDir(): String = { target_dir.get } } diff --git a/src/main/scala/Chisel/Main.scala b/src/main/scala/Chisel/Main.scala index 750e8712..349f8b18 100644 --- a/src/main/scala/Chisel/Main.scala +++ b/src/main/scala/Chisel/Main.scala @@ -11,6 +11,7 @@ import java.io.File def run[T <: Module] (args: Array[String], gen: () => T) = { def circuit = Driver.elaborate(gen) def output_file = new File(Driver.targetDir + "/" + circuit.name + ".fir") + Driver.parseArgs(args) Driver.dumpFirrtl(circuit, Option(output_file)) } } -- cgit v1.2.3 From 4083fcdeaeaeec543fbda48208dde14405f22f8f Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Sun, 6 Mar 2016 00:03:08 -0800 Subject: Print a better message on constant width failures I'm getting this error and the message is awful. --- src/main/scala/Chisel/internal/firrtl/IR.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/Chisel/internal/firrtl/IR.scala b/src/main/scala/Chisel/internal/firrtl/IR.scala index 60a38a08..d53807c6 100644 --- a/src/main/scala/Chisel/internal/firrtl/IR.scala +++ b/src/main/scala/Chisel/internal/firrtl/IR.scala @@ -57,7 +57,7 @@ abstract class LitArg(val num: BigInt, widthArg: Width) extends Arg { protected def minWidth: Int if (forcedWidth) { - require(widthArg.get >= minWidth) + require(widthArg.get >= minWidth, s"The literal value ${num} was elaborated with a specificed width of ${widthArg.get} bits, but at least ${minWidth} bits are required.") } } -- cgit v1.2.3