Skip to content

Commit

Permalink
fix ENABLE_SBT_THIN_CLIENT and refactor run_main
Browse files Browse the repository at this point in the history
Chipyard doesn't use run_main so define it here.  Also make it revert to using
run_scala_main when ENABLE_SBT_THIN_CLIENT
  • Loading branch information
timsnyder committed May 6, 2021
1 parent 5b861dc commit 7c299da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions sim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ SBT ?= java $(JAVA_OPTS) -jar $(rocketchip_dir)/sbt-launch.jar $(SBT_OPTS) $(SBT
define run_scala_main
cd $(base_dir) && $(SBT) ";project $(1); runMain $(2) $(3)"
endef
# recipes for generator and gg using sbt are calls out to FAT_JAR instead of SBT
run_main = cd $(base_dir) && java $(JAVA_ARGS) -cp $(FAT_JAR) $(2) $(3)

##############################################################################
# SBT Server Setup (start server / rebuild proj. defs. if SBT_SOURCES change)
Expand Down Expand Up @@ -96,6 +94,15 @@ include $(base_dir)/variables.mk
include $(base_dir)/common.mk
endif

ifdef ENABLE_SBT_THIN_CLIENT
# when asking to use SBT_THIN_CLIENT (typically for faster turnaround on scala tests)
# continue to use SBT for main class invocations of the generator and goldengate
run_main = run_scala_main
else
# recipes for generator and gg using sbt are calls out to FAT_JAR instead of SBT
run_main = cd $(base_dir) && java $(JAVA_OPTS) -cp $(FAT_JAR) $(2) $(3)
endif

# Include target-specific sources and input generation recipes
include $(TARGET_PROJECT_MAKEFRAG)

Expand Down
7 changes: 6 additions & 1 deletion sim/target-agnostic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ conf: $(fame_annos) $(FAT_JAR)
mkdir -p $(GENERATED_DIR)
# Runtime configuration generator must run under SBT currently; When
# launched via bloop some Console input and output is lost.
cd $(base_dir) && java $(JAVA_ARGS) -cp $(FAT_JAR) midas.stage.RuntimeConfigGeneratorMain \
cd $(base_dir) && java $(JAVA_OPTS) -cp $(FAT_JAR) midas.stage.RuntimeConfigGeneratorMain \
-td $(GENERATED_DIR) \
-faf $(fame_annos) \
-ggcp $(PLATFORM_CONFIG_PACKAGE) \
Expand Down Expand Up @@ -245,8 +245,13 @@ fpga: $(fpga_v) $(base_dir)/scripts/checkpoints/$(name_tuple)
# that look like "make: Nothing to be done for `replace-rtl'."
.PHONY: gen-replace-rtl-script
gen-replace-rtl-script: $(PRE_ELABORATION_TARGETS) | $(GENERATED_DIR)
ifdef ENABLE_SBT_THIN_CLIENT
@echo "Use of ENABLE_SBT_THIN_CLIENT is inconsistent with the purpose of 'gen-replace-rtl-script'. Aborting."
@exit 1
else
$(MAKE) replace-rtl -n --no-print-directory $(addprefix --assume-new=, $(PRE_ELABORATION_TARGETS)) > $(GENERATED_DIR)/replace-rtl.sh
$(firesim_base_dir)/../scripts/repo_state_summary.sh > $(GENERATED_DIR)/repo_state
endif


#############################
Expand Down

0 comments on commit 7c299da

Please sign in to comment.