2016-01-29 03:39:33 +01:00
|
|
|
# The default target, which runs all regression targets.
|
|
|
|
regression: vsim-regression fsim-regression emulator-regression
|
|
|
|
|
|
|
|
# Regression targets for the various simulators.
|
|
|
|
%-regression: %-asm-tests %-bmark-tests
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-01-31 05:54:41 +01:00
|
|
|
# Some targets can run torture
|
|
|
|
vsim-regression: vsim-torture
|
|
|
|
emulator-regression: emulator-torture
|
|
|
|
|
2016-01-29 03:39:33 +01:00
|
|
|
ifeq ($(TORTURE_CONFIG),)
|
|
|
|
$(error Set TORTURE_CONFIG to the torture configuration to run)
|
2016-01-27 07:27:21 +01:00
|
|
|
endif
|
|
|
|
|
2016-03-06 02:19:53 +01:00
|
|
|
# The version of Chisel to use
|
|
|
|
CHISEL_VERSION ?= 2
|
|
|
|
|
2016-01-27 07:27:21 +01:00
|
|
|
# The top-level directory that contains rocket-chip
|
|
|
|
TOP ?= ..
|
|
|
|
|
2016-02-23 02:29:07 +01:00
|
|
|
# The hash of the tools that we're using
|
|
|
|
TOOLS_HASH ?= $(shell git -C $(TOP) ls-tree HEAD -- riscv-tools | xargs echo | cut -d' ' -f3)
|
|
|
|
$(info Using riscv-tools of $(TOOLS_HASH))
|
|
|
|
|
2016-01-27 07:27:21 +01:00
|
|
|
# The directory that the tools get built into.
|
2016-02-23 02:29:07 +01:00
|
|
|
RISCV ?= install/$(TOOLS_HASH)
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-01-29 03:39:33 +01:00
|
|
|
# Torture saves the failing tests into a directory, which defaults to just somehing inside the regressions directory.
|
|
|
|
TORTURE_SAVE_DIR ?= torture-failures
|
|
|
|
|
2016-03-16 23:09:42 +01:00
|
|
|
# Include top-level makefrag for options like rocketchip_addons
|
|
|
|
include $(TOP)/Makefrag
|
|
|
|
|
2016-01-29 03:39:33 +01:00
|
|
|
# Removes all the build stamps from the current config
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf stamps $(abspath $(RISCV))
|
2016-01-31 05:56:00 +01:00
|
|
|
$(MAKE) RISCV=$(RISCV) -C $(abspath $(TOP)/vsim) clean
|
|
|
|
$(MAKE) RISCV=$(RISCV) -C $(abspath $(TOP)/fsim) clean
|
|
|
|
$(MAKE) RISCV=$(RISCV) -C $(abspath $(TOP)/emulator) clean
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
ifeq ($(SUITE),)
|
|
|
|
$(error Set SUITE to the regression suite you want to run)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SUITE),RocketSuite)
|
|
|
|
CONFIGS=DefaultConfig DefaultL2Config RoccExampleConfig SplitL2MetadataTestConfig
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SUITE),GroundtestSuite)
|
|
|
|
CONFIGS=MemtestConfig FancyMemtestConfig \
|
|
|
|
BroadcastRegressionTestConfig CacheRegressionTestConfig \
|
|
|
|
ComparatorConfig ComparatorL2Config UnitTestConfig
|
|
|
|
endif
|
|
|
|
|
2016-01-27 07:27:21 +01:00
|
|
|
# These are the named regression targets. While it's expected you run them in
|
|
|
|
# this order, since there's dependencies for everything it doesn't actually
|
2016-01-29 03:39:33 +01:00
|
|
|
# matter. They're here to make running the various targets from the
|
|
|
|
# commandline a bit cleaner.
|
2016-02-23 02:29:07 +01:00
|
|
|
submodules: stamps/other-submodules.stamp
|
|
|
|
tools: $(RISCV)/install.stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
EMU_DEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/emulator-debug.stamp)
|
|
|
|
EMU_NDEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/emulator-ndebug.stamp)
|
|
|
|
EMU_ASM_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/emulator-asm-tests.stamp)
|
|
|
|
EMU_BMARK_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/emulator-bmark-tests.stamp)
|
|
|
|
EMU_TORTURE_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/emulator-torture-$(TORTURE_CONFIG).stamp)
|
|
|
|
|
|
|
|
emulator-debug: $(EMU_DEBUG_STAMPS)
|
|
|
|
emulator-ndebug: $(EMU_NDEBUG_STAMPS)
|
|
|
|
emulator-asm-tests: $(EMU_ASM_TEST_STAMPS)
|
|
|
|
emulator-bmark-tests: $(EMU_BMARK_TEST_STAMPS)
|
|
|
|
emulator-torture: $(EMU_TORTURE_STAMPS)
|
|
|
|
|
|
|
|
VSIM_VERILOG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-verilog.stamp)
|
|
|
|
VSIM_DEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-debug.stamp)
|
|
|
|
VSIM_NDEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-ndebug.stamp)
|
|
|
|
VSIM_ASM_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-asm-tests.stamp)
|
|
|
|
VSIM_BMARK_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-bmark-tests.stamp)
|
|
|
|
VSIM_TORTURE_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/vsim-torture-$(TORTURE_CONFIG).stamp)
|
|
|
|
|
|
|
|
vsim-verilog: $(VSIM_VERILOG_STAMPS)
|
|
|
|
vsim-debug: $(VSIM_DEBUG_STAMPS)
|
|
|
|
vsim-ndebug: $(VSIM_NDEBUG_STAMPS)
|
|
|
|
vsim-asm-tests: $(VSIM_ASM_TEST_STAMPS)
|
|
|
|
vsim-bmark-tests: $(VSIM_BMARK_TEST_STAMPS)
|
|
|
|
vsim-torture: $(VSIM_TORTURE_STAMPS)
|
|
|
|
|
|
|
|
FSIM_VERILOG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-verilog.stamp)
|
|
|
|
FSIM_DEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-debug.stamp)
|
|
|
|
FSIM_NDEBUG_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-ndebug.stamp)
|
|
|
|
FSIM_ASM_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-asm-tests.stamp)
|
|
|
|
FSIM_BMARK_TEST_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-bmark-tests.stamp)
|
|
|
|
FSIM_TORTURE_STAMPS=$(foreach config,$(CONFIGS),stamps/$(config)/fsim-torture-$(TORTURE_CONFIG).stamp)
|
|
|
|
|
|
|
|
fsim-verilog: $(FSIM_VERILOG_STAMPS)
|
|
|
|
fsim-debug: $(FSIM_DEBUG_STAMPS)
|
|
|
|
fsim-ndebug: $(FSIM_NDEBUG_STAMPS)
|
|
|
|
fsim-asm-tests: $(FSIM_ASM_TEST_STAMPS)
|
|
|
|
fsim-bmark-tests: $(FSIM_BMARK_TEST_STAMPS)
|
|
|
|
fsim-torture: $(FSIM_TORTURE_STAMPS)
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-05-16 22:06:45 +02:00
|
|
|
submodule_names = chisel2 chisel3 context-dependent-environments dramsim2 firrtl groundtest hardfloat junctions rocket torture uncore $(ROCKETCHIP_ADDONS)
|
2016-02-26 20:05:41 +01:00
|
|
|
|
2016-01-27 07:27:21 +01:00
|
|
|
# Checks out all the rocket-chip submodules
|
2016-02-23 02:29:07 +01:00
|
|
|
stamps/other-submodules.stamp:
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-02-26 20:05:41 +01:00
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive $(submodule_names)
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
|
|
|
|
|
|
|
$(RISCV)/install.stamp:
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-02-23 02:29:07 +01:00
|
|
|
git -C $(abspath $(TOP)) submodule update --init riscv-tools
|
2016-06-15 06:20:19 +02:00
|
|
|
rm -f $(abspath $(TOP))/riscv-tools/.travis.yml
|
2016-02-23 02:29:07 +01:00
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-gnu-toolchain
|
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-isa-sim
|
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-fesvr
|
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-opcodes
|
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-pk
|
|
|
|
git -C $(abspath $(TOP))/riscv-tools submodule update --init --recursive riscv-tests
|
2016-01-27 07:27:21 +01:00
|
|
|
+cd $(abspath $(TOP))/riscv-tools; RISCV=$(abspath $(RISCV)) ./build.sh
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-01-29 03:39:33 +01:00
|
|
|
# Builds the various simulators
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/emulator-verilog.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/emulator CONFIG=$(patsubst stamps/%/emulator-verilog.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) verilog
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/emulator-ndebug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/emulator CONFIG=$(patsubst stamps/%/emulator-ndebug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION)
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/emulator-debug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/emulator CONFIG=$(patsubst stamps/%/emulator-debug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) debug
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/vsim-verilog.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(patsubst stamps/%/vsim-verilog.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) verilog
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/vsim-ndebug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(patsubst stamps/%/vsim-ndebug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION)
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/vsim-debug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(patsubst stamps/%/vsim-debug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) debug
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/fsim-verilog.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-02-23 02:29:07 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/fsim CONFIG=$(patsubst stamps/%/fsim-verilog.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) verilog
|
2016-03-06 02:19:53 +01:00
|
|
|
date > $@
|
2016-02-23 02:29:07 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/fsim-ndebug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/fsim CONFIG=$(patsubst stamps/%/fsim-ndebug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION)
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/fsim-debug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/fsim CONFIG=$(patsubst stamps/%/fsim-debug.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) debug
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-01-29 03:39:33 +01:00
|
|
|
# Runs tests on one of the simulators
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/emulator-asm-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/emulator CONFIG=$(patsubst stamps/%/emulator-asm-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-asm-tests
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/emulator-bmark-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/emulator CONFIG=$(patsubst stamps/%/emulator-bmark-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-bmark-tests
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/vsim-asm-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(patsubst stamps/%/vsim-asm-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-asm-tests
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/vsim-bmark-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(patsubst stamps/%/vsim-bmark-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-bmark-tests
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/%/fsim-asm-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/fsim CONFIG=$(patsubst stamps/%/fsim-asm-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-asm-tests
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/fsim-bmark-tests.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/fsim CONFIG=$(patsubst stamps/%/fsim-bmark-tests.stamp,%,$@) RISCV=$(abspath $(RISCV)) CHISEL_VERSION=$(CHISEL_VERSION) run-bmark-tests
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-31 05:54:41 +01:00
|
|
|
|
|
|
|
# The torture tests run subtly differently on the different targets, so they
|
|
|
|
# don't have pattern rules like everything else does.
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/vsim-torture-$(TORTURE_CONFIG).stamp: stamps/%/vsim-debug.stamp stamps/%/vsim-ndebug.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/torture rnight RTL_CONFIG=$(patsubst stamps/%/vsim-debug.stamp,%,$<) RISCV=$(abspath $(RISCV)) PATH="$(abspath $(RISCV)/bin:$(PATH))" OPTIONS="-C $(abspath $(TOP)/torture/config/$(TORTURE_CONFIG).config) -p $(abspath $(TORTURE_SAVE_DIR)) -m 30 -t 10"
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-31 05:54:41 +01:00
|
|
|
|
2016-06-24 03:24:59 +02:00
|
|
|
stamps/%/emulator-torture-$(TORTURE_CONFIG).stamp: stamps/%/emulator-debug.stamp stamps/%/emulator-ndebug.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-06-24 03:24:59 +02:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/torture cnight RTL_CONFIG=$(patsubst stamps/%/emulator-debug.stamp,%,$<) RISCV=$(abspath $(RISCV)) PATH="$(abspath $(RISCV)/bin:$(PATH))" OPTIONS="-C $(abspath $(TOP)/torture/config/$(TORTURE_CONFIG).config) -p $(abspath $(TORTURE_SAVE_DIR)) -m 30 -t 10"
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|