1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,3 +18,4 @@ tags
|
|||||||
*~
|
*~
|
||||||
env-riscv-tools.sh
|
env-riscv-tools.sh
|
||||||
env-esp-tools.sh
|
env-esp-tools.sh
|
||||||
|
.bloop/
|
||||||
|
|||||||
31
common.mk
31
common.mk
@@ -34,13 +34,8 @@ lookup_srcs = $(shell find -L $(1)/ -name target -prune -o -iname "*.$(2)" -prin
|
|||||||
SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim tools/barstools/iocell)
|
SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim tools/barstools/iocell)
|
||||||
SCALA_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),scala)
|
SCALA_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),scala)
|
||||||
VLOG_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),sv) $(call lookup_srcs,$(SOURCE_DIRS),v)
|
VLOG_SOURCES = $(call lookup_srcs,$(SOURCE_DIRS),sv) $(call lookup_srcs,$(SOURCE_DIRS),v)
|
||||||
|
# This assumes no SBT meta-build sources
|
||||||
#########################################################################################
|
SBT_SOURCES = $(call lookup_srcs,$(base_dir),sbt)
|
||||||
# rocket and testchipip classes
|
|
||||||
#########################################################################################
|
|
||||||
# NB: target/ lives under source ----V , due to how we're handling midas dependency injection
|
|
||||||
ROCKET_CLASSES ?= "$(ROCKETCHIP_DIR)/src/target/scala-$(SCALA_VERSION_MAJOR)/classes:$(ROCKETCHIP_DIR)/chisel3/target/scala-$(SCALA_VERSION_MAJOR)/*"
|
|
||||||
TESTCHIPIP_CLASSES ?= "$(TESTCHIP_DIR)/target/scala-$(SCALA_VERSION_MAJOR)/classes"
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# jar creation variables and rules
|
# jar creation variables and rules
|
||||||
@@ -60,11 +55,19 @@ $(FIRRTL_TEST_JAR): $(call lookup_srcs,$(CHIPYARD_FIRRTL_DIR),scala)
|
|||||||
cp -p $(CHIPYARD_FIRRTL_DIR)/utils/bin/firrtl-test.jar $@
|
cp -p $(CHIPYARD_FIRRTL_DIR)/utils/bin/firrtl-test.jar $@
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
# Bloop Project Definitions
|
||||||
|
#########################################################################################
|
||||||
|
$(BLOOP_CONFIG_DIR)/TIMESTAMP: $(SBT_SOURCES)
|
||||||
|
cd $(base_dir) && $(SBT) "project chipyardRoot" "bloopInstall"
|
||||||
|
touch $@
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# create list of simulation file inputs
|
# create list of simulation file inputs
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
$(sim_files): $(call lookup_srcs,$(base_dir)/generators/utilities/src/main/scala,scala) $(FIRRTL_JAR)
|
$(sim_files): $(call lookup_srcs,$(base_dir)/generators/utilities/src/main/scala,scala) $(FIRRTL_JAR) $(SCALA_BUILDTOOL_DEPS)
|
||||||
cd $(base_dir) && $(SBT) "project utilities" "runMain utilities.GenerateSimFiles -td $(build_dir) -sim $(sim_name)"
|
$(call run_scala_main,utilities,utilities.GenerateSimFiles,-td $(build_dir) -sim $(sim_name))
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# create firrtl file rule and variables
|
# create firrtl file rule and variables
|
||||||
@@ -76,11 +79,11 @@ $(FIRRTL_FILE) $(ANNO_FILE): generator_temp
|
|||||||
# AG: must re-elaborate if ariane sources have changed... otherwise just run firrtl compile
|
# AG: must re-elaborate if ariane sources have changed... otherwise just run firrtl compile
|
||||||
generator_temp: $(SCALA_SOURCES) $(sim_files) $(EXTRA_GENERATOR_REQS)
|
generator_temp: $(SCALA_SOURCES) $(sim_files) $(EXTRA_GENERATOR_REQS)
|
||||||
mkdir -p $(build_dir)
|
mkdir -p $(build_dir)
|
||||||
cd $(base_dir) && $(SBT) "project $(SBT_PROJECT)" "runMain $(GENERATOR_PACKAGE).Generator \
|
$(call run_scala_main,$(SBT_PROJECT),$(GENERATOR_PACKAGE).Generator,\
|
||||||
--target-dir $(build_dir) \
|
--target-dir $(build_dir) \
|
||||||
--name $(long_name) \
|
--name $(long_name) \
|
||||||
--top-module $(MODEL_PACKAGE).$(MODEL) \
|
--top-module $(MODEL_PACKAGE).$(MODEL) \
|
||||||
--legacy-configs $(CONFIG_PACKAGE).$(CONFIG)"
|
--legacy-configs $(CONFIG_PACKAGE).$(CONFIG))
|
||||||
|
|
||||||
.PHONY: firrtl
|
.PHONY: firrtl
|
||||||
firrtl: $(FIRRTL_FILE)
|
firrtl: $(FIRRTL_FILE)
|
||||||
@@ -101,7 +104,7 @@ $(TOP_TARGETS) $(HARNESS_TARGETS): firrtl_temp
|
|||||||
@echo "" > /dev/null
|
@echo "" > /dev/null
|
||||||
|
|
||||||
firrtl_temp: $(FIRRTL_FILE) $(ANNO_FILE) $(VLOG_SOURCES)
|
firrtl_temp: $(FIRRTL_FILE) $(ANNO_FILE) $(VLOG_SOURCES)
|
||||||
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateTopAndHarness -o $(TOP_FILE) -tho $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tdf $(sim_top_blackboxes) -tsf $(TOP_FIR) -thaof $(HARNESS_ANNO) -hdf $(sim_harness_blackboxes) -thf $(HARNESS_FIR) $(REPL_SEQ_MEM) $(HARNESS_CONF_FLAGS) -td $(build_dir)" && touch $(sim_top_blackboxes) $(sim_harness_blackboxes)
|
$(call run_scala_main,tapeout,barstools.tapeout.transforms.GenerateTopAndHarness,-o $(TOP_FILE) -tho $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tdf $(sim_top_blackboxes) -tsf $(TOP_FIR) -thaof $(HARNESS_ANNO) -hdf $(sim_harness_blackboxes) -thf $(HARNESS_FIR) $(REPL_SEQ_MEM) $(HARNESS_CONF_FLAGS) -td $(build_dir)) && touch $(sim_top_blackboxes) $(sim_harness_blackboxes)
|
||||||
# DOC include end: FirrtlCompiler
|
# DOC include end: FirrtlCompiler
|
||||||
|
|
||||||
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
||||||
@@ -111,7 +114,7 @@ $(TOP_SMEMS_FILE) $(TOP_SMEMS_FIR): top_macro_temp
|
|||||||
@echo "" > /dev/null
|
@echo "" > /dev/null
|
||||||
|
|
||||||
top_macro_temp: $(TOP_SMEMS_CONF)
|
top_macro_temp: $(TOP_SMEMS_CONF)
|
||||||
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(TOP_SMEMS_CONF) -v $(TOP_SMEMS_FILE) -f $(TOP_SMEMS_FIR) $(MACROCOMPILER_MODE)"
|
$(call run_scala_main,barstoolsMacros,barstools.macros.MacroCompiler,-n $(TOP_SMEMS_CONF) -v $(TOP_SMEMS_FILE) -f $(TOP_SMEMS_FIR) $(MACROCOMPILER_MODE))
|
||||||
|
|
||||||
HARNESS_MACROCOMPILER_MODE = --mode synflops
|
HARNESS_MACROCOMPILER_MODE = --mode synflops
|
||||||
.INTERMEDIATE: harness_macro_temp
|
.INTERMEDIATE: harness_macro_temp
|
||||||
@@ -119,7 +122,7 @@ $(HARNESS_SMEMS_FILE) $(HARNESS_SMEMS_FIR): harness_macro_temp
|
|||||||
@echo "" > /dev/null
|
@echo "" > /dev/null
|
||||||
|
|
||||||
harness_macro_temp: $(HARNESS_SMEMS_CONF) | top_macro_temp
|
harness_macro_temp: $(HARNESS_SMEMS_CONF) | top_macro_temp
|
||||||
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(HARNESS_SMEMS_CONF) -v $(HARNESS_SMEMS_FILE) -f $(HARNESS_SMEMS_FIR) $(HARNESS_MACROCOMPILER_MODE)"
|
$(call run_scala_main,barstoolsMacros,barstools.macros.MacroCompiler, -n $(HARNESS_SMEMS_CONF) -v $(HARNESS_SMEMS_FILE) -f $(HARNESS_SMEMS_FIR) $(HARNESS_MACROCOMPILER_MODE))
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# remove duplicate files and headers in list of simulation file inputs
|
# remove duplicate files and headers in list of simulation file inputs
|
||||||
|
|||||||
@@ -15,5 +15,6 @@ addSbtPlugin("com.simplytyped" % "sbt-antlr4" % "0.8.1")
|
|||||||
addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % "0.6.3")
|
addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % "0.6.3")
|
||||||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.4")
|
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.4")
|
||||||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")
|
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")
|
||||||
|
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.1")
|
||||||
|
|
||||||
libraryDependencies += "com.github.os72" % "protoc-jar" % "3.5.1.1"
|
libraryDependencies += "com.github.os72" % "protoc-jar" % "3.5.1.1"
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ cd "${scripts_dir}/.."
|
|||||||
|
|
||||||
# Reenable the FireSim submodule
|
# Reenable the FireSim submodule
|
||||||
git config --unset submodule.sims/firesim.update || true
|
git config --unset submodule.sims/firesim.update || true
|
||||||
git submodule update --init sims/firesim
|
|
||||||
cd sims/firesim
|
cd sims/firesim
|
||||||
./build-setup.sh "$@" --library
|
./build-setup.sh "$@" --library
|
||||||
cd "$RDIR"
|
cd "$RDIR"
|
||||||
|
|||||||
Submodule sims/firesim updated: 82ce80bc12...8064d8808b
26
variables.mk
26
variables.mk
@@ -125,9 +125,33 @@ JAVA_ARGS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -XX:MaxPermSize=256M
|
|||||||
#########################################################################################
|
#########################################################################################
|
||||||
SCALA_VERSION=2.12.10
|
SCALA_VERSION=2.12.10
|
||||||
SCALA_VERSION_MAJOR=$(basename $(SCALA_VERSION))
|
SCALA_VERSION_MAJOR=$(basename $(SCALA_VERSION))
|
||||||
|
|
||||||
SBT ?= java $(JAVA_ARGS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar
|
SBT ?= java $(JAVA_ARGS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar
|
||||||
|
|
||||||
|
BLOOP ?= bloop
|
||||||
|
BLOOP_CONFIG_DIR ?= $(base_dir)/.bloop
|
||||||
|
# This mirrors the bloop default. Set to a system-unique port in a multi-user environment
|
||||||
|
BLOOP_NAILGUN_PORT ?= 8212
|
||||||
|
|
||||||
|
SCALA_BUILDTOOL_DEPS = $(SBT_SOURCES)
|
||||||
|
|
||||||
|
ifdef ENABLE_BLOOP
|
||||||
|
override SCALA_BUILDTOOL_DEPS += $(BLOOP_CONFIG_DIR)/TIMESTAMP
|
||||||
|
# Two notes about the bloop invocation:
|
||||||
|
# 1) the sed removes a leading {file:<path>} that sometimes needs to be
|
||||||
|
# provided to SBT when a project but not for bloop.
|
||||||
|
# 2) Generally, one could could pass '--' to indicate all remaining arguments are
|
||||||
|
# destined for the scala Main, however a bug in Bloop's argument parsing causes the
|
||||||
|
# --nailgun-port argument to be lost in this case. Workaround this by prefixing
|
||||||
|
# every main-destined argument with "--args"
|
||||||
|
define run_scala_main
|
||||||
|
cd $(base_dir) && bloop --nailgun-port $(BLOOP_NAILGUN_PORT) run $(shell echo $(1) | sed 's/{.*}//') --main $(2) $(addprefix --args ,$3)
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define run_scala_main
|
||||||
|
cd $(base_dir) && $(SBT) "project $(1)" "runMain $(2) $(3)"
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# output directory for tests
|
# output directory for tests
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user