Skip to content

Commit

Permalink
changing makefiles to comma-delimited configs
Browse files Browse the repository at this point in the history
  • Loading branch information
debs-sifive committed Feb 11, 2020
1 parent db5bb87 commit bfeccdf
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
7 changes: 6 additions & 1 deletion Makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ PROJECT ?= freechips.rocketchip.system
CFG_PROJECT ?= $(PROJECT)
CONFIG ?= DefaultConfig
# TODO: For now must match rocketchip.Generator
long_name = $(PROJECT).$(CONFIG)
comma := ,
space := $() $()
splitConfigs := $(subst $(comma), ,$(CONFIG))
configBases := $(foreach config,$(splitConfigs),$(lastword $(subst ., ,$(config))))
CONFIG_STR := $(subst $(space),_,$(configBases))
long_name = $(PROJECT).$(CONFIG_STR)

VLSI_MEM_GEN ?= $(base_dir)/scripts/vlsi_mem_gen

Expand Down
2 changes: 1 addition & 1 deletion emulator/Makefrag-verilator
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ verilog = \

$(generated_dir)/%.fir $(generated_dir)/%.d: $(FIRRTL_JAR) $(chisel_srcs) $(bootrom_img)
mkdir -p $(dir $@)
cd $(base_dir) && $(SBT) "runMain freechips.rocketchip.stage.RocketChipMain -td $(generated_dir) -T $(PROJECT).$(MODEL) -C $(CFG_PROJECT).$(CONFIG)"
cd $(base_dir) && $(SBT) "runMain freechips.rocketchip.stage.RocketChipMain -td $(generated_dir) -T $(PROJECT).$(MODEL) -C $(CONFIG)"

%.v %.conf: %.fir $(FIRRTL_JAR)
mkdir -p $(dir $@)
Expand Down
40 changes: 20 additions & 20 deletions regression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,36 @@ endif

ifeq ($(SUITE),RocketSuiteA)
PROJECT=freechips.rocketchip.system
CONFIGS=DefaultConfig
CONFIGS=$(PROJECT).DefaultConfig
endif

ifeq ($(SUITE),RocketSuiteB)
PROJECT=freechips.rocketchip.system
CONFIGS=DefaultBufferlessConfig
CONFIGS=$(PROJECT).DefaultBufferlessConfig
endif

ifeq ($(SUITE),RocketSuiteC)
PROJECT=freechips.rocketchip.system
CONFIGS=TinyConfig
CONFIGS=$(PROJECT).TinyConfig
endif

ifeq ($(SUITE),UnittestSuite)
PROJECT=freechips.rocketchip.unittest
CONFIGS=AMBAUnitTestConfig TLSimpleUnitTestConfig TLWidthUnitTestConfig
CONFIGS=$(PROJECT).AMBAUnitTestConfig $(PROJECT).TLSimpleUnitTestConfig $(PROJECT).TLWidthUnitTestConfig
endif

ifeq ($(SUITE), JtagDtmSuite)
PROJECT=freechips.rocketchip.system

export JTAG_DTM_ENABLE_SBA ?= off
ifeq ($(JTAG_DTM_ENABLE_SBA), off)
CONFIGS_32=WithJtagDTMSystem_DefaultRV32Config
CONFIGS_64=WithJtagDTMSystem_DefaultConfig
CONFIGS_32=$(PROJECT).WithJtagDTMSystem,$(PROJECT).DefaultRV32Config
CONFIGS_64=$(PROJECT).WithJtagDTMSystem,$(PROJECT).DefaultConfig
endif

ifeq ($(JTAG_DTM_ENABLE_SBA), on)
CONFIGS_32=WithJtagDTMSystem_WithDebugSBASystem_DefaultRV32Config
CONFIGS_64=WithJtagDTMSystem_WithDebugSBASystem_DefaultConfig
CONFIGS_32=$(PROJECT).WithJtagDTMSystem,$(PROJECT).WithDebugSBASystem,$(PROJECT).DefaultRV32Config
CONFIGS_64=$(PROJECT).WithJtagDTMSystem,$(PROJECT).WithDebugSBASystem,$(PROJECT).DefaultConfig
endif

CONFIGS += $(CONFIGS_32)
Expand All @@ -89,18 +89,18 @@ endif
ifeq ($(SUITE), Miscellaneous)
PROJECT=freechips.rocketchip.system
CONFIGS=\
DefaultSmallConfig \
DualBankConfig \
DualChannelConfig \
DualChannelDualBankConfig \
RoccExampleConfig \
Edge128BitConfig \
Edge32BitConfig \
QuadChannelBenchmarkConfig \
EightChannelConfig \
DualCoreConfig \
MemPortOnlyConfig \
MMIOPortOnlyConfig
$(PROJECT).DefaultSmallConfig \
$(PROJECT).DualBankConfig \
$(PROJECT).DualChannelConfig \
$(PROJECT).DualChannelDualBankConfig \
$(PROJECT).RoccExampleConfig \
$(PROJECT).Edge128BitConfig \
$(PROJECT).Edge32BitConfig \
$(PROJECT).QuadChannelBenchmarkConfig \
$(PROJECT).EightChannelConfig \
$(PROJECT).DualCoreConfig \
$(PROJECT).MemPortOnlyConfig \
$(PROJECT).MMIOPortOnlyConfig
endif

# These are the named regression targets. While it's expected you run them in
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/stage/phases/GenerateTestSuiteMakefrags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class GenerateTestSuiteMakefrags extends Phase with PreservesAll[Phase] with Has
val targetDir = view[StageOptions](annotations).targetDir
val fileName = s"${view[RocketChipOptions](annotations).longName}.d"

//addTestSuites(annotations)
//writeOutputFile(targetDir, fileName, TestGeneration.generateMakefrag)
val makefrag =
annotations
.collect{ case a: RocketTestSuiteAnnotation => a.suite }
Expand Down
4 changes: 2 additions & 2 deletions vsim/Makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ VCS_OPTS = -notice -line +lint=all,noVCDE,noONGS,noUI -error=PCWM-L -timescale=1
# Build the simulator
#--------------------------------------------------------------------

simv = $(sim_dir)/simv-$(PROJECT)-$(CONFIG)
simv = $(sim_dir)/simv-$(PROJECT)-$(CONFIG_STR)
$(simv) : $(sim_vsrcs) $(sim_csrcs)
cd $(sim_dir) && \
rm -rf csrc && \
$(VCS) $(VCS_OPTS) -o $(simv) \
-debug_pp \

simv_debug = $(sim_dir)/simv-$(PROJECT)-$(CONFIG)-debug
simv_debug = $(sim_dir)/simv-$(PROJECT)-$(CONFIG_STR)-debug
$(simv_debug) : $(sim_vsrcs) $(sim_csrcs)
cd $(sim_dir) && \
rm -rf csrc && \
Expand Down
2 changes: 1 addition & 1 deletion vsim/Makefrag-verilog
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ verilog = $(generated_dir)/$(long_name).v

$(generated_dir)/%.fir $(generated_dir)/%.d: $(FIRRTL_JAR) $(chisel_srcs) $(bootrom_img)
mkdir -p $(dir $@)
cd $(base_dir) && $(SBT) "runMain freechips.rocketchip.stage.RocketChipMain -td $(generated_dir) -T $(PROJECT).$(MODEL) -C $(CFG_PROJECT).$(CONFIG)"
cd $(base_dir) && $(SBT) "runMain freechips.rocketchip.stage.RocketChipMain -td $(generated_dir) -T $(PROJECT).$(MODEL) -C $(CONFIG)"

$(generated_dir)/%.v $(generated_dir)/%.conf: $(generated_dir)/%.fir $(FIRRTL_JAR)
mkdir -p $(dir $@)
Expand Down

0 comments on commit bfeccdf

Please sign in to comment.