diff --git a/.gitignore b/.gitignore index a85d0dd2..153e7275 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ tags env-riscv-tools.sh env-esp-tools.sh .bloop/ +.bsp/ diff --git a/.sbtopts b/.sbtopts deleted file mode 100644 index 2358d787..00000000 --- a/.sbtopts +++ /dev/null @@ -1,2 +0,0 @@ --Dsbt.sourcemode=true --Dsbt.workspace=$PWD/tools diff --git a/build.sbt b/build.sbt index 01655abc..1132dde1 100644 --- a/build.sbt +++ b/build.sbt @@ -81,7 +81,7 @@ lazy val chiselLibDeps = (chiselRef / Keys.libraryDependencies) // keeping scalaVersion in sync with chisel3 to the minor version lazy val chiselPluginLib = "edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full -val firrtlVersion = "1.4-SNAPSHOT" +val firrtlVersion = "1.4.+" lazy val firrtlRef = ProjectRef(workspaceDirectory / "firrtl", "firrtl") lazy val firrtlLib = "edu.berkeley.cs" %% "firrtl" % firrtlVersion //lazy val firrtlLibDeps = (firrtlRef / Keys.libraryDependencies) // TODO: Won't work because of antlr plugin diff --git a/common.mk b/common.mk index 80565a37..4f632a26 100644 --- a/common.mk +++ b/common.mk @@ -63,7 +63,7 @@ SCALA_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),scala) VLOG_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),sv) $(call lookup_srcs,$(SOURCE_DIRS),v) # This assumes no SBT meta-build sources 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 +SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS),sbt) $(base_dir)/build.sbt $(base_dir)/project/plugins.sbt $(base_dir)/project/build.properties ######################################################################################### # Bloop Project Definitions @@ -209,7 +209,7 @@ ifneq ($(filter run% %.run %.out %.vpd %.vcd,$(MAKECMDGOALS)),) endif ####################################### -# Rules for building DRAMSim2 library # +# Rules for building DRAMSim2 library ####################################### dramsim_dir = $(base_dir)/tools/DRAMSim2 @@ -218,14 +218,18 @@ dramsim_lib = $(dramsim_dir)/libdramsim.a $(dramsim_lib): $(MAKE) -C $(dramsim_dir) $(notdir $@) -####################################### -# Helper to run SBT # -####################################### +################################################ +# Helper to run SBT or shutdown the SBT server +################################################ .PHONY: launch-sbt launch-sbt: cd $(base_dir) && $(SBT) +.PHONY: launch-sbt +shutdown-sbt: + cd $(base_dir) && $(SBT) shutdown + ######################################################################################### # print help text ######################################################################################### diff --git a/project/build.properties b/project/build.properties index 0837f7a1..7de0a938 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.13 +sbt.version=1.4.4 diff --git a/variables.mk b/variables.mk index 42dc48c5..73918376 100644 --- a/variables.mk +++ b/variables.mk @@ -146,21 +146,22 @@ sim_common_files ?= $(build_dir)/sim_files.common.f # java arguments used in sbt ######################################################################################### JAVA_HEAP_SIZE ?= 8G -JAVA_ARGS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -XX:MaxPermSize=256M +JAVA_OPTS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -XX:MaxPermSize=256M ######################################################################################### # default sbt launch command ######################################################################################### -# 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)) +# by default build chisel3/firrtl and other subprojects from source +override SBT_OPTS += -Dsbt.sourcemode=true -Dsbt.workspace=$(base_dir)/tools + +ifdef ENABLE_SBT_THIN_CLIENT +# enabling speeds up sbt loading +# however if build.sbt changes are done you need to +# "shutdown" the server (shutdown-sbt target) to reload build.sbt changes +SBT_CLIENT_FLAG = --client endif -SCALA_VERSION=2.12.10 -SCALA_VERSION_MAJOR=$(basename $(SCALA_VERSION)) -SBT ?= java $(JAVA_ARGS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS) +SBT ?= java $(JAVA_OPTS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS) $(SBT_CLIENT_FLAG) BLOOP ?= bloop BLOOP_CONFIG_DIR ?= $(base_dir)/.bloop @@ -183,7 +184,7 @@ define run_scala_main endef else define run_scala_main - cd $(base_dir) && $(SBT) "project $(1)" "runMain $(2) $(3)" + cd $(base_dir) && $(SBT) ";project $(1); runMain $(2) $(3)" endef endif