Merge remote-tracking branch 'upstream/main' into graphics
This commit is contained in:
89
variables.mk
89
variables.mk
@@ -8,7 +8,7 @@ HELP_COMPILATION_VARIABLES = \
|
||||
" JAVA_TOOL_OPTIONS = if overridden, set underlying java tool options (default sets misc. sizes and tmp dir)" \
|
||||
" SBT_OPTS = set additional sbt command line options (these take the form -Dsbt.<option>=<setting>) " \
|
||||
" See https://www.scala-sbt.org/1.x/docs/Command-Line-Reference.html\#Command+Line+Options" \
|
||||
" SBT_BIN = if overridden, used to invoke sbt (default is to invoke sbt by sbt-launch.jar)" \
|
||||
" SBT = if overridden, used to invoke sbt (default is to invoke sbt by sbt-launch.jar)" \
|
||||
" FIRRTL_LOGLEVEL = if overridden, set firrtl log level (default is error)"
|
||||
|
||||
HELP_PROJECT_VARIABLES = \
|
||||
@@ -25,6 +25,9 @@ HELP_PROJECT_VARIABLES = \
|
||||
|
||||
HELP_SIMULATION_VARIABLES = \
|
||||
" BINARY = riscv elf binary that the simulator will run when using the run-binary* targets" \
|
||||
" BINARIES = list of riscv elf binary that the simulator will run when using the run-binaries* targets" \
|
||||
" LOADMEM = riscv elf binary that should be loaded directly into simulated DRAM. LOADMEM=1 will load the BINARY elf" \
|
||||
" LOADARCH = path to a architectural checkpoint directory that should end in .loadarch/, for restoring from a checkpoint" \
|
||||
" VERBOSE_FLAGS = flags used when doing verbose simulation [$(VERBOSE_FLAGS)]" \
|
||||
" timeout_cycles = number of clock cycles before simulator times out, defaults to 10000000" \
|
||||
" bmark_timeout_cycles = number of clock cycles before benchmark simulator times out, defaults to 100000000"
|
||||
@@ -68,7 +71,7 @@ ifeq ($(SUB_PROJECT),chipyard)
|
||||
SBT_PROJECT ?= chipyard
|
||||
MODEL ?= TestHarness
|
||||
VLOG_MODEL ?= $(MODEL)
|
||||
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
||||
MODEL_PACKAGE ?= chipyard.harness
|
||||
CONFIG ?= RocketConfig
|
||||
CONFIG_PACKAGE ?= $(SBT_PROJECT)
|
||||
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
|
||||
@@ -87,7 +90,7 @@ ifeq ($(SUB_PROJECT),hwacha)
|
||||
TB ?= TestDriver
|
||||
TOP ?= ExampleRocketSystem
|
||||
endif
|
||||
# For TestChipIP developers
|
||||
# For TestChipIP developers running unit-tests
|
||||
ifeq ($(SUB_PROJECT),testchipip)
|
||||
SBT_PROJECT ?= chipyard
|
||||
MODEL ?= TestHarness
|
||||
@@ -99,6 +102,18 @@ ifeq ($(SUB_PROJECT),testchipip)
|
||||
TB ?= TestDriver
|
||||
TOP ?= UnitTestSuite
|
||||
endif
|
||||
# For rocketchip developers running unit-tests
|
||||
ifeq ($(SUB_PROJECT),rocketchip)
|
||||
SBT_PROJECT ?= chipyard
|
||||
MODEL ?= TestHarness
|
||||
VLOG_MODEL ?= $(MODEL)
|
||||
MODEL_PACKAGE ?= chipyard.unittest
|
||||
CONFIG ?= TLSimpleUnitTestConfig
|
||||
CONFIG_PACKAGE ?= freechips.rocketchip.unittest
|
||||
GENERATOR_PACKAGE ?= chipyard
|
||||
TB ?= TestDriver
|
||||
TOP ?= UnitTestSuite
|
||||
endif
|
||||
# For IceNet developers
|
||||
ifeq ($(SUB_PROJECT),icenet)
|
||||
SBT_PROJECT ?= chipyard
|
||||
@@ -155,6 +170,14 @@ ifeq ($(GENERATOR_PACKAGE),hwacha)
|
||||
long_name=$(MODEL_PACKAGE).$(CONFIG)
|
||||
endif
|
||||
|
||||
# classpaths
|
||||
CLASSPATH_CACHE ?= $(base_dir)/.classpath_cache
|
||||
CHIPYARD_CLASSPATH ?= $(CLASSPATH_CACHE)/chipyard.jar
|
||||
TAPEOUT_CLASSPATH ?= $(CLASSPATH_CACHE)/tapeout.jar
|
||||
# if *_CLASSPATH is a true java classpath, it can be colon-delimited list of paths (on *nix)
|
||||
CHIPYARD_CLASSPATH_TARGETS ?= $(subst :, ,$(CHIPYARD_CLASSPATH))
|
||||
TAPEOUT_CLASSPATH_TARGETS ?= $(subst :, ,$(TAPEOUT_CLASSPATH))
|
||||
|
||||
# chisel generated outputs
|
||||
FIRRTL_FILE ?= $(build_dir)/$(long_name).fir
|
||||
ANNO_FILE ?= $(build_dir)/$(long_name).anno.json
|
||||
@@ -198,10 +221,6 @@ MODEL_MODS_FILELIST ?= $(build_dir)/$(long_name).model.f
|
||||
# list of all blackbox files (may be included in the top/model.f files)
|
||||
# this has the build_dir appended
|
||||
BB_MODS_FILELIST ?= $(build_dir)/$(long_name).bb.f
|
||||
# top blackbox module files to include
|
||||
TOP_BB_MODS_FILELIST ?= $(build_dir)/$(long_name).top.bb.f
|
||||
# model blackbox module files to include (not including top blackbox modules)
|
||||
MODEL_BB_MODS_FILELIST ?= $(build_dir)/$(long_name).model.bb.f
|
||||
# all module files to include (top, model, bb included)
|
||||
ALL_MODS_FILELIST ?= $(build_dir)/$(long_name).all.f
|
||||
|
||||
@@ -214,37 +233,46 @@ sim_files ?= $(build_dir)/sim_files.f
|
||||
# single file that contains all files needed for VCS or Verilator simulation (unique and without .h's)
|
||||
sim_common_files ?= $(build_dir)/sim_files.common.f
|
||||
|
||||
SFC_LEVEL ?= $(build_dir)/.sfc_level
|
||||
EXTRA_FIRRTL_OPTIONS ?= $(build_dir)/.extra_firrtl_options
|
||||
MFC_LOWERING_OPTIONS ?= $(build_dir)/.mfc_lowering_options
|
||||
|
||||
#########################################################################################
|
||||
# java arguments used in sbt
|
||||
#########################################################################################
|
||||
JAVA_HEAP_SIZE ?= 8G
|
||||
JAVA_TMP_DIR ?= $(base_dir)/.java_tmp
|
||||
export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Dsbt.supershell=false -Djava.io.tmpdir=$(JAVA_TMP_DIR)
|
||||
export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Djava.io.tmpdir=$(JAVA_TMP_DIR)
|
||||
|
||||
#########################################################################################
|
||||
# default sbt launch command
|
||||
#########################################################################################
|
||||
SCALA_BUILDTOOL_DEPS = $(SBT_SOURCES)
|
||||
|
||||
SBT_THIN_CLIENT_TIMESTAMP = $(base_dir)/project/target/active.json
|
||||
|
||||
ifdef ENABLE_SBT_THIN_CLIENT
|
||||
SCALA_BUILDTOOL_DEPS += $(SBT_THIN_CLIENT_TIMESTAMP)
|
||||
# enabling speeds up sbt loading
|
||||
# use with sbt script or sbtn to bypass error code issues
|
||||
SBT_CLIENT_FLAG = --client
|
||||
endif
|
||||
|
||||
# passes $(JAVA_TOOL_OPTIONS) from env to java
|
||||
export SBT_OPTS ?= -Dsbt.ivy.home=$(base_dir)/.ivy2 -Dsbt.global.base=$(base_dir)/.sbt -Dsbt.boot.directory=$(base_dir)/.sbt/boot/ -Dsbt.color=always
|
||||
SBT_BIN ?= java -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS)
|
||||
SBT = $(SBT_BIN) $(SBT_CLIENT_FLAG)
|
||||
SBT_NON_THIN = $(subst $(SBT_CLIENT_FLAG),,$(SBT))
|
||||
export SBT_OPTS ?= -Dsbt.ivy.home=$(base_dir)/.ivy2 -Dsbt.global.base=$(base_dir)/.sbt -Dsbt.boot.directory=$(base_dir)/.sbt/boot/ -Dsbt.color=always -Dsbt.supershell=false -Dsbt.server.forcestart=true
|
||||
SBT ?= java -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS)
|
||||
|
||||
# (1) - classpath of the fat jar
|
||||
# (2) - main class
|
||||
# (3) - main class arguments
|
||||
define run_jar_scala_main
|
||||
cd $(base_dir) && java -cp $(1) $(2) $(3)
|
||||
endef
|
||||
|
||||
# (1) - sbt project
|
||||
# (2) - main class
|
||||
# (3) - main class arguments
|
||||
define run_scala_main
|
||||
cd $(base_dir) && $(SBT) ";project $(1); runMain $(2) $(3)"
|
||||
endef
|
||||
|
||||
# (1) - sbt project to assemble
|
||||
# (2) - classpath file(s) to create
|
||||
define run_sbt_assembly
|
||||
cd $(base_dir) && $(SBT) ";project $(1); set assembly / assemblyOutputPath := file(\"$(2)\"); assembly" && touch $(2)
|
||||
endef
|
||||
|
||||
FIRRTL_LOGLEVEL ?= error
|
||||
|
||||
#########################################################################################
|
||||
@@ -258,15 +286,20 @@ output_dir=$(sim_dir)/output/$(long_name)
|
||||
PERMISSIVE_ON=+permissive
|
||||
PERMISSIVE_OFF=+permissive-off
|
||||
BINARY ?=
|
||||
LOADMEM ?=
|
||||
LOADMEM_ADDR ?= 81000000
|
||||
BINARIES ?=
|
||||
override SIM_FLAGS += +dramsim +dramsim_ini_dir=$(TESTCHIP_DIR)/src/main/resources/dramsim2_ini +max-cycles=$(timeout_cycles)
|
||||
ifneq ($(LOADMEM),)
|
||||
override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR)
|
||||
endif
|
||||
VERBOSE_FLAGS ?= +verbose
|
||||
sim_out_name = $(output_dir)/$(subst $() $(),_,$(notdir $(basename $(BINARY))))
|
||||
binary_hex= $(sim_out_name).loadmem_hex
|
||||
# get_out_name is a function, 1st argument is the binary
|
||||
get_out_name = $(subst $() $(),_,$(notdir $(basename $(1))))
|
||||
LOADMEM ?=
|
||||
LOADARCH ?=
|
||||
|
||||
ifneq ($(LOADARCH),)
|
||||
override BINARY = $(addsuffix /mem.elf,$(LOADARCH))
|
||||
override BINARIES = $(addsuffix /mem.elf,$(LOADARCH))
|
||||
override get_out_name = $(shell basename $(dir $(1)))
|
||||
override LOADMEM = 1
|
||||
endif
|
||||
|
||||
#########################################################################################
|
||||
# build output directory for compilation
|
||||
|
||||
Reference in New Issue
Block a user