Allow default configs for sub projects | have separate build_dir based on long_name

This commit is contained in:
Jerry Zhao 2019-04-25 13:33:08 -07:00
parent b88937b8a0
commit 2e53de6f22
1 changed files with 49 additions and 32 deletions

View File

@ -3,7 +3,7 @@
######################################################################################### #########################################################################################
######################################################################################### #########################################################################################
# default variables to invoke the generator for a example Rocket system # variables to invoke the generator
# descriptions: # descriptions:
# SBT_PROJECT = the SBT project that you should find the classes/packages in # SBT_PROJECT = the SBT project that you should find the classes/packages in
# MODEL = the top level module of the project in Chisel (normally the harness) # MODEL = the top level module of the project in Chisel (normally the harness)
@ -18,6 +18,16 @@
# project specific: # project specific:
# SUB_PROJECT = use the specific subproject default variables # SUB_PROJECT = use the specific subproject default variables
######################################################################################### #########################################################################################
#########################################################################################
# subproject overrides
# description:
# - make it so that you only change 1 param to change most or all of them!
# - mainly intended for quick developer setup for common flags
#########################################################################################
SUB_PROJECT ?= example
ifeq ($(SUB_PROJECT),example)
SBT_PROJECT ?= example SBT_PROJECT ?= example
MODEL ?= RocketTestHarness MODEL ?= RocketTestHarness
VLOG_MODEL ?= TestHarness VLOG_MODEL ?= TestHarness
@ -27,47 +37,54 @@ CONFIG_PACKAGE ?= $(SBT_PROJECT)
GENERATOR_PACKAGE ?= $(SBT_PROJECT) GENERATOR_PACKAGE ?= $(SBT_PROJECT)
TB ?= TestDriver TB ?= TestDriver
TOP ?= RocketTop TOP ?= RocketTop
endif
#########################################################################################
# subproject overrides
# description:
# - make it so that you only change 1 param to change most or all of them!
# - mainly intended for quick developer setup for common flags
# - for each you only need to specify a CONFIG
#########################################################################################
SUB_PROJECT ?= example
# for a BOOM based example system # for a BOOM based example system
ifeq ($(SUB_PROJECT),boomexample) ifeq ($(SUB_PROJECT),boomexample)
MODEL=BoomTestHarness SBT_PROJECT ?= example
TOP=BoomTop MODEL ?= BoomTestHarness
VLOG_MODEL ?= TestHarness
MODEL_PACKAGE ?= $(SBT_PROJECT)
CONFIG ?= DefaultBoomConfig
CONFIG_PACKAGE ?= $(SBT_PROJECT)
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
TB ?= TestDriver
TOP ?= BoomTop
endif endif
# for BOOM developers # for BOOM developers
ifeq ($(SUB_PROJECT),boom) ifeq ($(SUB_PROJECT),boom)
SBT_PROJECT=boom SBT_PROJECT ?= boom
MODEL_PACKAGE=boom.system MODEL ?= TestHarness
MODEL=TestHarness VLOG_MODEL ?= TestHarness
CONFIG_PACKAGE=boom.system MODEL_PACKAGE ?= boom.system
GENERATOR_PACKAGE=boom.system CONFIG ?= BoomConfig
TOP=ExampleBoomSystem CONFIG_PACKAGE ?= boom.system
GENERATOR_PACKAGE ?= boom.system
TB ?= TestDriver
TOP ?= ExampleBoomSystem
endif endif
# for Rocket-chip developers # for Rocket-chip developers
ifeq ($(SUB_PROJECT),rocketchip) ifeq ($(SUB_PROJECT),rocketchip)
SBT_PROJECT=rebarrocketchip SBT_PROJECT ?= rebarrocketchip
MODEL_PACKAGE=freechips.rocketchip.system MODEL ?= TestHarness
MODEL=TestHarness VLOG_MODEL ?= TestHarness
CONFIG_PACKAGE=freechips.rocketchip.system MODEL_PACKAGE ?= freechips.rocketchip.system
GENERATOR_PACKAGE=freechips.rocketchip.system CONFIG ?= DefaultConfig
TOP=ExampleRocketSystem CONFIG_PACKAGE ?= freechips.rocketchip.system
GENERATOR_PACKAGE ?= freechips.rocketchip.system
TB ?= TestDriver
TOP ?= ExampleRocketSystem
endif endif
# for Hwacha developers # for Hwacha developers
ifeq ($(SUB_PROJECT),hwacha) ifeq ($(SUB_PROJECT),hwacha)
SBT_PROJECT=hwacha SBT_PROJECT ?= hwacha
MODEL_PACKAGE=freechips.rocketchip.system MODEL ?= TestHarness
MODEL=TestHarness VLOG_MODEL ?= TestHarness
CONFIG_PACKAGE=hwacha MODEL_PACKAGE ?= freechips.rocketchip.system
GENERATOR_PACKAGE=hwacha CONFIG ?= HwachaConfig
TOP=ExampleRocketSystem CONFIG_PACKAGE ?= hwacha
GENERATOR_PACKAGE ?= hwacha
TB ?= TestDriver
TOP ?= ExampleRocketSystem
endif endif
######################################################################################### #########################################################################################
@ -121,7 +138,7 @@ output_dir=$(sim_dir)/output
######################################################################################### #########################################################################################
# build output directory for compilation # build output directory for compilation
######################################################################################### #########################################################################################
build_dir=$(sim_dir)/generated-src build_dir=$(sim_dir)/generated-src/$(long_name)
######################################################################################### #########################################################################################
# vsrcs needed to run projects # vsrcs needed to run projects