diff --git a/.sbtopts b/.sbtopts new file mode 100644 index 00000000..e6cc0650 --- /dev/null +++ b/.sbtopts @@ -0,0 +1,2 @@ +-Dsbt.sourcemode=true +-Dsbt.workspace=$PWD diff --git a/build.sbt b/build.sbt index bbf7964f..e6320076 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,7 @@ lazy val commonSettings = Seq( case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard case _ => MergeStrategy.first}}, scalacOptions ++= Seq("-deprecation","-unchecked","-Xsource:2.11"), - libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test", + libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.0" % "test", libraryDependencies += "org.json4s" %% "json4s-jackson" % "3.6.1", libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.0", @@ -77,11 +77,7 @@ def isolateAllTests(tests: Seq[TestDefinition]) = tests map { test => } toSeq // Subproject definitions begin -// -// FIRRTL is handled as an unmanaged dependency. Make will build the firrtl jar -// before launching sbt if any of the firrtl source files has been updated -// The jar is dropped in chipyard's lib/ directory, which is used as the unmanagedBase -// for all subprojects + lazy val chisel = (project in file("tools/chisel3")) lazy val firrtl_interpreter = (project in file("tools/firrtl-interpreter")) diff --git a/common.mk b/common.mk index ca34ffce..d0b11fe3 100644 --- a/common.mk +++ b/common.mk @@ -65,24 +65,6 @@ VLOG_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),sv) $(call lookup_srcs,$(SOURCE SBT_SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim tools) SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS),sbt) $(base_dir)/build.sbt $(base_dir)/project/plugins.sbt -######################################################################################### -# jar creation variables and rules -######################################################################################### -FIRRTL_JAR := $(base_dir)/lib/firrtl.jar -FIRRTL_TEST_JAR := $(base_dir)/test_lib/firrtl-test.jar - -$(FIRRTL_JAR): $(call lookup_srcs,$(CHIPYARD_FIRRTL_DIR),scala) - $(MAKE) -C $(CHIPYARD_FIRRTL_DIR) SBT="$(SBT)" root_dir=$(CHIPYARD_FIRRTL_DIR) build-scala - mkdir -p $(@D) - cp -p $(CHIPYARD_FIRRTL_DIR)/utils/bin/firrtl.jar $@ - touch $@ - -$(FIRRTL_TEST_JAR): $(call lookup_srcs,$(CHIPYARD_FIRRTL_DIR),scala) - cd $(CHIPYARD_FIRRTL_DIR) && $(SBT) "test:assembly" - mkdir -p $(@D) - cp -p $(CHIPYARD_FIRRTL_DIR)/utils/bin/firrtl-test.jar $@ - touch $@ - ######################################################################################### # Bloop Project Definitions ######################################################################################### @@ -93,7 +75,7 @@ $(BLOOP_CONFIG_DIR)/TIMESTAMP: $(SBT_SOURCES) ######################################################################################### # create list of simulation file inputs ######################################################################################### -$(sim_files): $(call lookup_srcs,$(base_dir)/generators/utilities/src/main/scala,scala) $(FIRRTL_JAR) $(SCALA_BUILDTOOL_DEPS) +$(sim_files): $(call lookup_srcs,$(base_dir)/generators/utilities/src/main/scala,scala) $(SCALA_BUILDTOOL_DEPS) $(call run_scala_main,utilities,utilities.GenerateSimFiles,-td $(build_dir) -sim $(sim_name)) ######################################################################################### diff --git a/generators/boom b/generators/boom index dc22cacf..2dfec3d0 160000 --- a/generators/boom +++ b/generators/boom @@ -1 +1 @@ -Subproject commit dc22cacf71fe88b95f3393d622f53648bf0440bd +Subproject commit 2dfec3d012e61ff07108af6034a86e60979deecd diff --git a/generators/cva6 b/generators/cva6 index 8a11e2c9..c2b9fc41 160000 --- a/generators/cva6 +++ b/generators/cva6 @@ -1 +1 @@ -Subproject commit 8a11e2c97627459d0449853447bfc7ca64608b82 +Subproject commit c2b9fc412179a386fb4b662d13e588a9613f41d5 diff --git a/generators/hwacha b/generators/hwacha index e29b65db..c1b7306f 160000 --- a/generators/hwacha +++ b/generators/hwacha @@ -1 +1 @@ -Subproject commit e29b65db86e4486ebdfd4f39d1265df83a2d7d9d +Subproject commit c1b7306f319aef6ea9ff0fd88d11d10244ee9e87 diff --git a/generators/riscv-sodor b/generators/riscv-sodor index d92a8476..cca8a7aa 160000 --- a/generators/riscv-sodor +++ b/generators/riscv-sodor @@ -1 +1 @@ -Subproject commit d92a8476e4afbae189381d708136aef7d3970952 +Subproject commit cca8a7aa5743b9f9bf25779b87b464187c5c3fbc diff --git a/generators/sifive-blocks b/generators/sifive-blocks index c240e629..612ed01d 160000 --- a/generators/sifive-blocks +++ b/generators/sifive-blocks @@ -1 +1 @@ -Subproject commit c240e629e2fc111cbb12e4fe707be898b5204984 +Subproject commit 612ed01df3be83ad0198fb9bd7e367ea43df3d56 diff --git a/generators/sifive-cache b/generators/sifive-cache index 4ebefa3e..d4db623f 160000 --- a/generators/sifive-cache +++ b/generators/sifive-cache @@ -1 +1 @@ -Subproject commit 4ebefa3e30ec44bd2f4ff82747025fb7b362b954 +Subproject commit d4db623ff534f775ffc49f59c4a9ef24d5d759d0 diff --git a/project/build.properties b/project/build.properties index 8522443d..0837f7a1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.2 +sbt.version=1.3.13 diff --git a/project/plugins.sbt b/project/plugins.sbt index 3fe776fa..8c0937ed 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,16 +5,18 @@ resolvers += "jgit-repo" at "https://download.eclipse.org/jgit/maven" addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.1") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.9.3") addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.8.1") addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % "0.6.3") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.4") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.1") +addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.5" ) libraryDependencies += "com.github.os72" % "protoc-jar" % "3.5.1.1" diff --git a/tools/chisel-testers b/tools/chisel-testers index 1aa906fe..c5b99a45 160000 --- a/tools/chisel-testers +++ b/tools/chisel-testers @@ -1 +1 @@ -Subproject commit 1aa906fe168eb5ddca705ec955b27cf5c8856e4d +Subproject commit c5b99a452f84af3f581d34e9c51c6c65b6c2a63c diff --git a/tools/firrtl-interpreter b/tools/firrtl-interpreter index a881c07d..5ab0cfe7 160000 --- a/tools/firrtl-interpreter +++ b/tools/firrtl-interpreter @@ -1 +1 @@ -Subproject commit a881c07df6bceea462dbbd9a28e25721a1e88567 +Subproject commit 5ab0cfe7020ca17804078c85d020730764ee176f diff --git a/tools/treadle b/tools/treadle index 1c67bc84..925687ad 160000 --- a/tools/treadle +++ b/tools/treadle @@ -1 +1 @@ -Subproject commit 1c67bc846aafc3bdd707f76ead8cefd5f93e0376 +Subproject commit 925687ad22c42dd2c8b4dc127c0476f9902b3163 diff --git a/variables.mk b/variables.mk index b187a23d..2828366c 100644 --- a/variables.mk +++ b/variables.mk @@ -154,6 +154,12 @@ JAVA_ARGS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -XX:MaxPermSize=256M SCALA_VERSION=2.12.10 SCALA_VERSION_MAJOR=$(basename $(SCALA_VERSION)) SBT ?= java $(JAVA_ARGS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar +# Running with sbt-launch.jar doesn't read .sbtopts by default +# # Set if the file exists (if it exists, we're building chisel3 and firrtl from source) +sbtopts_file := $(base_dir)/.sbtopts +ifneq (,$(wildcard $(sbtopts_file))) + SBT_OPTS ?= $(shell cat $(sbtopts_file)) +endif BLOOP ?= bloop BLOOP_CONFIG_DIR ?= $(base_dir)/.bloop @@ -176,7 +182,7 @@ define run_scala_main endef else define run_scala_main - cd $(base_dir) && $(SBT) "project $(1)" "runMain $(2) $(3)" + cd $(base_dir) && $(SBT) $(SBT_OPTS) "project $(1)" "runMain $(2) $(3)" endef endif