Support SBT thin client | Rename JAVA_ARGS -> OPTS | Support env. SBT_OPTS
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,3 +20,4 @@ tags
|
||||
env-riscv-tools.sh
|
||||
env-esp-tools.sh
|
||||
.bloop/
|
||||
.bsp/
|
||||
|
||||
@@ -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
|
||||
|
||||
14
common.mk
14
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
|
||||
#########################################################################################
|
||||
|
||||
@@ -1 +1 @@
|
||||
sbt.version=1.3.13
|
||||
sbt.version=1.4.4
|
||||
|
||||
21
variables.mk
21
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user