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-27 07:27:21 +01:00
|
|
|
ifeq ($(CONFIG),)
|
2016-01-29 03:39:33 +01:00
|
|
|
$(error Set CONFIG to the rocket-chip configuration to elaborate and test)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(TORTURE_CONFIG),)
|
|
|
|
$(error Set TORTURE_CONFIG to the torture configuration to run)
|
2016-01-27 07:27:21 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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-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
|
|
|
|
|
|
|
emulator-debug: stamps/$(CONFIG)/emulator-debug.stamp
|
|
|
|
emulator-ndebug: stamps/$(CONFIG)/emulator-ndebug.stamp
|
|
|
|
emulator-asm-tests: stamps/$(CONFIG)/emulator-asm-tests.stamp
|
|
|
|
emulator-bmark-tests: stamps/$(CONFIG)/emulator-bmark-tests.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
emulator-torture: stamps/$(CONFIG)/emulator-torture-$(TORTURE_CONFIG).stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-02-23 02:29:07 +01:00
|
|
|
vsim-verilog: stamps/$(CONFIG)/vsim-verilog.stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
vsim-debug: stamps/$(CONFIG)/vsim-debug.stamp
|
|
|
|
vsim-ndebug: stamps/$(CONFIG)/vsim-ndebug.stamp
|
|
|
|
vsim-asm-tests: stamps/$(CONFIG)/vsim-asm-tests.stamp
|
|
|
|
vsim-bmark-tests: stamps/$(CONFIG)/vsim-bmark-tests.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
vsim-torture: stamps/$(CONFIG)/vsim-torture-$(TORTURE_CONFIG).stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-02-23 02:29:07 +01:00
|
|
|
fsim-verilog: stamps/$(CONFIG)/fsim-verilog.stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
fsim-debug: stamps/$(CONFIG)/fsim-debug.stamp
|
|
|
|
fsim-ndebug: stamps/$(CONFIG)/fsim-ndebug.stamp
|
|
|
|
fsim-asm-tests: stamps/$(CONFIG)/fsim-asm-tests.stamp
|
|
|
|
fsim-bmark-tests: stamps/$(CONFIG)/fsim-bmark-tests.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
fsim-torture: stamps/$(CONFIG)/fsim-torture-$(TORTURE_CONFIG).stamp
|
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-23 02:29:07 +01:00
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive chisel
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive context-dependent-environments
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive dramsim2
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive groundtest
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive hardfloat
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive junctions
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive rocket
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive torture
|
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive uncore
|
2016-02-23 21:58:08 +01:00
|
|
|
git -C $(abspath $(TOP)) submodule update --init --recursive zscale
|
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
|
|
|
|
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-02-23 02:29:07 +01:00
|
|
|
stamps/$(CONFIG)/%-verilog.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-verilog.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) verilog
|
|
|
|
date > $@
|
|
|
|
|
|
|
|
stamps/$(CONFIG)/%-ndebug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-29 03:39:33 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-01-31 05:56:36 +01:00
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-ndebug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV))
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-29 03:39:33 +01:00
|
|
|
|
2016-02-23 02:29:07 +01:00
|
|
|
stamps/$(CONFIG)/%-debug.stamp: stamps/other-submodules.stamp $(RISCV)/install.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-01-31 05:56:36 +01:00
|
|
|
+flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-debug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) 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-02-23 02:29:07 +01:00
|
|
|
stamps/$(CONFIG)/%-asm-tests.stamp: stamps/$(CONFIG)/%-ndebug.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-01-29 03:39:33 +01:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-asm-tests.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) run-asm-tests
|
2016-02-23 02:29:07 +01:00
|
|
|
date > $@
|
2016-01-27 07:27:21 +01:00
|
|
|
|
2016-02-23 02:29:07 +01:00
|
|
|
stamps/$(CONFIG)/%-bmark-tests.stamp: stamps/$(CONFIG)/%-ndebug.stamp
|
2016-01-27 07:27:21 +01:00
|
|
|
mkdir -p $(dir $@)
|
2016-01-29 03:39:33 +01:00
|
|
|
$(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-bmark-tests.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) 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.
|
|
|
|
stamps/$(CONFIG)/vsim-torture-$(TORTURE_CONFIG).stamp: stamps/$(CONFIG)/vsim-debug.stamp stamps/$(CONFIG)/vsim-ndebug.stamp
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/torture rnight RTL_CONFIG=$(CONFIG) 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-02-23 02:29:07 +01:00
|
|
|
stamps/$(CONFIG)/emulator-torture-$(TORTURE_CONFIG).stamp: stamps/$(CONFIG)/emulator-debug.stamp stamps/$(CONFIG)/emulator-debug.stamp
|
2016-01-31 05:54:41 +01:00
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(MAKE) -C $(abspath $(TOP))/torture cnight RTL_CONFIG=$(CONFIG) 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 > $@
|