hqjenny-chipyard/variables.mk

97 lines
4.5 KiB
Makefile
Raw Normal View History

2019-03-09 08:23:35 +08:00
#########################################################################################
# makefile variables shared across multiple makefiles
#########################################################################################
#########################################################################################
# default variables to invoke the generator
# descriptions:
2019-04-18 07:06:42 +08:00
# PROJECT = the scala package to find the MODEL/Generator in
# MODEL = the top level module of the project (normally the harness)
2019-03-09 08:23:35 +08:00
# CONFIG = the configuration class to give the parameters for the project
# CFG_PROJECT = the scala package to find the CONFIG class
2019-03-09 10:20:42 +08:00
# SBT_PROJECT = the SBT project that you should find the Generator class in
# TB = wrapper over the TestHarness needed to simulate in VCS
# TOP = top level module of the project (normally the module instantiated by the harness)
#
# project specific:
# SUB_PROJECT = use the specific subproject default variables
2019-03-09 08:23:35 +08:00
#########################################################################################
PROJECT ?= example
MODEL ?= TestHarness
CONFIG ?= DefaultExampleConfig
CFG_PROJECT ?= $(PROJECT)
2019-03-09 10:20:42 +08:00
SBT_PROJECT ?= $(PROJECT)
2019-03-09 08:23:35 +08:00
TB ?= TestDriver
TOP ?= ExampleTop
SUB_PROJECT ?= example
ifeq ($(SUB_PROJECT),boom) # make it so that you only change 1 param to change them all!
SBT_PROJECT=boom
PROJECT=boom.system
TOP=ExampleBoomSystem
endif
2019-03-09 08:23:35 +08:00
#########################################################################################
# path to rocket-chip and testchipip
#########################################################################################
ROCKETCHIP_DIR = $(base_dir)/generators/rocket-chip
TESTCHIP_DIR = $(base_dir)/generators/testchipip
REBAR_FIRRTL_DIR = $(base_dir)/tools/firrtl
2019-03-09 08:23:35 +08:00
#########################################################################################
# names of various files needed to compile and run things
#########################################################################################
long_name = $(PROJECT).$(MODEL).$(CONFIG)
FIRRTL_FILE ?= $(build_dir)/$(long_name).fir
ANNO_FILE ?= $(build_dir)/$(long_name).anno.json
VERILOG_FILE ?= $(build_dir)/$(long_name).top.v
TOP_FIR ?= $(build_dir)/$(long_name).top.fir
TOP_ANNO ?= $(build_dir)/$(long_name).top.anno.json
2019-03-09 08:23:35 +08:00
HARNESS_FILE ?= $(build_dir)/$(long_name).harness.v
HARNESS_FIR ?= $(build_dir)/$(long_name).harness.fir
HARNESS_ANNO ?= $(build_dir)/$(long_name).harness.anno.json
2019-03-09 08:23:35 +08:00
SMEMS_FILE ?= $(build_dir)/$(long_name).mems.v
SMEMS_CONF ?= $(build_dir)/$(long_name).mems.conf
SMEMS_FIR ?= $(build_dir)/$(long_name).mems.fir
2019-03-09 08:23:35 +08:00
sim_dotf ?= $(build_dir)/sim_files.f
sim_harness_blackboxes ?= $(build_dir)/firrtl_black_box_resource_files.harness.f
sim_top_blackboxes ?= $(build_dir)/firrtl_black_box_resource_files.top.f
2019-03-09 08:23:35 +08:00
#########################################################################################
# default sbt launch command
#########################################################################################
SCALA_VERSION=2.12.4
SCALA_VERSION_MAJOR=$(basename $(SCALA_VERSION))
SBT ?= java -Xmx2G -Xss8M -XX:MaxPermSize=256M -jar $(ROCKETCHIP_DIR)/sbt-launch.jar ++$(SCALA_VERSION)
#########################################################################################
# output directory for tests
#########################################################################################
output_dir=$(sim_dir)/output
#########################################################################################
# build output directory for compilation
#########################################################################################
build_dir=$(sim_dir)/generated-src
#########################################################################################
# vsrcs needed to run projects
#########################################################################################
rocketchip_vsrc_dir = $(ROCKETCHIP_DIR)/src/main/resources/vsrc
#########################################################################################
# sources needed to run simulators
#########################################################################################
sim_vsrcs = \
$(VERILOG_FILE) \
$(HARNESS_FILE) \
$(SMEMS_FILE)
#########################################################################################
# assembly/benchmark variables
#########################################################################################
timeout_cycles = 10000000
bmark_timeout_cycles = 100000000