aboutsummaryrefslogtreecommitdiff
path: root/arch_test_target
diff options
context:
space:
mode:
authorNeel Gala <neelgala@incoresemi.com>2022-02-25 11:42:33 +0530
committerNeel Gala <neelgala@incoresemi.com>2022-02-25 11:42:33 +0530
commite78559f521c1cae445e02ec5cd43db15bb32d51e (patch)
tree188af22797ce9d22065dfb3b0265fb6a7e2cdd61 /arch_test_target
parent8ca012a6cc7e5b9edfaacca2d04b5a0f267377cf (diff)
downloadspike-e78559f521c1cae445e02ec5cd43db15bb32d51e.zip
spike-e78559f521c1cae445e02ec5cd43db15bb32d51e.tar.gz
spike-e78559f521c1cae445e02ec5cd43db15bb32d51e.tar.bz2
clean up the the arch-test directory to avoid copypasta
- move all common stuff to a Makefile_common.inc - include this file in all individual Makefile.includes
Diffstat (limited to 'arch_test_target')
-rw-r--r--arch_test_target/spike/device/Makefile_common.inc34
-rw-r--r--arch_test_target/spike/device/rv32i_m/C/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv32i_m/F/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv32i_m/I/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv32i_m/M/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv32i_m/Zifencei/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv32i_m/privilege/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv64i_m/C/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv64i_m/D/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv64i_m/I/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv64i_m/M/Makefile.include35
-rw-r--r--arch_test_target/spike/device/rv64i_m/Zifencei/Makefile.include36
-rw-r--r--arch_test_target/spike/device/rv64i_m/privilege/Makefile.include35
13 files changed, 46 insertions, 409 deletions
diff --git a/arch_test_target/spike/device/Makefile_common.inc b/arch_test_target/spike/device/Makefile_common.inc
new file mode 100644
index 0000000..c43222d
--- /dev/null
+++ b/arch_test_target/spike/device/Makefile_common.inc
@@ -0,0 +1,34 @@
+TARGET_SIM ?= spike
+TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
+ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
+ $(error Target simulator executable '$(TARGET_SIM)` not found)
+endif
+
+RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf-
+RISCV_GCC ?= $(RISCV_PREFIX)gcc
+RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
+RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
+
+COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
+ -I$(ROOTDIR)/riscv-test-suite/env/ \
+ -I$(TARGETDIR)/$(RISCV_TARGET)/ \
+ -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
+ $$(<) -o $$@
+OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
+ $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
+
+
+COMPILE_TARGET=\
+ $(COMPILE_CMD); \
+ if [ $$$$? -ne 0 ] ; \
+ then \
+ echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
+ exit 1 ; \
+ fi ; \
+ $(OBJ_CMD); \
+ if [ $$$$? -ne 0 ] ; \
+ then \
+ echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
+ exit 1 ; \
+ fi ;
+
diff --git a/arch_test_target/spike/device/rv32i_m/C/Makefile.include b/arch_test_target/spike/device/rv32i_m/C/Makefile.include
index 7853baf..346feaa 100644
--- a/arch_test_target/spike/device/rv32i_m/C/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/C/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32ic \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv32i_m/F/Makefile.include b/arch_test_target/spike/device/rv32i_m/F/Makefile.include
index b5030c5..4fb87c6 100644
--- a/arch_test_target/spike/device/rv32i_m/F/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/F/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32if \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv32i_m/I/Makefile.include b/arch_test_target/spike/device/rv32i_m/I/Makefile.include
index 6c3693c..740755c 100644
--- a/arch_test_target/spike/device/rv32i_m/I/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/I/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32i \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv32i_m/M/Makefile.include b/arch_test_target/spike/device/rv32i_m/M/Makefile.include
index 2f1e83c..5d8de47 100644
--- a/arch_test_target/spike/device/rv32i_m/M/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/M/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32im \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv32i_m/Zifencei/Makefile.include b/arch_test_target/spike/device/rv32i_m/Zifencei/Makefile.include
index 6c3693c..740755c 100644
--- a/arch_test_target/spike/device/rv32i_m/Zifencei/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/Zifencei/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32i \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv32i_m/privilege/Makefile.include b/arch_test_target/spike/device/rv32i_m/privilege/Makefile.include
index 2d55242..8275495 100644
--- a/arch_test_target/spike/device/rv32i_m/privilege/Makefile.include
+++ b/arch_test_target/spike/device/rv32i_m/privilege/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv32-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv32ic \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/C/Makefile.include b/arch_test_target/spike/device/rv64i_m/C/Makefile.include
index 4d95759..e6ca9fb 100644
--- a/arch_test_target/spike/device/rv64i_m/C/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/C/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64ic \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/D/Makefile.include b/arch_test_target/spike/device/rv64i_m/D/Makefile.include
index 7c72d03..2611394 100644
--- a/arch_test_target/spike/device/rv64i_m/D/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/D/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64ifd \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/I/Makefile.include b/arch_test_target/spike/device/rv64i_m/I/Makefile.include
index 20a1fdc..2c763bf 100644
--- a/arch_test_target/spike/device/rv64i_m/I/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/I/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64i \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/M/Makefile.include b/arch_test_target/spike/device/rv64i_m/M/Makefile.include
index 0ae9f0a..8ce555c 100644
--- a/arch_test_target/spike/device/rv64i_m/M/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/M/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64im \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/Zifencei/Makefile.include b/arch_test_target/spike/device/rv64i_m/Zifencei/Makefile.include
index 61916a2..2c763bf 100644
--- a/arch_test_target/spike/device/rv64i_m/Zifencei/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/Zifencei/Makefile.include
@@ -1,38 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64i \
+signature=$(*).signature.output +signature-granularity=4\
$<
diff --git a/arch_test_target/spike/device/rv64i_m/privilege/Makefile.include b/arch_test_target/spike/device/rv64i_m/privilege/Makefile.include
index 80e4a69..5ef2802 100644
--- a/arch_test_target/spike/device/rv64i_m/privilege/Makefile.include
+++ b/arch_test_target/spike/device/rv64i_m/privilege/Makefile.include
@@ -1,37 +1,4 @@
-TARGET_SIM ?= spike
-TARGET_FLAGS ?= $(RISCV_TARGET_FLAGS)
-ifeq ($(shell command -v $(TARGET_SIM) 2> /dev/null),)
- $(error Target simulator executable '$(TARGET_SIM)` not found)
-endif
-
-RISCV_PREFIX ?= riscv64-unknown-elf-
-RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump
-RISCV_GCC_OPTS ?= -g -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles $(RVTEST_DEFINES)
-
-COMPILE_CMD = $$(RISCV_GCC) $(1) $$(RISCV_GCC_OPTS) \
- -I$(ROOTDIR)/riscv-test-suite/env/ \
- -I$(TARGETDIR)/$(RISCV_TARGET)/ \
- -T$(TARGETDIR)/$(RISCV_TARGET)/link.ld \
- $$(<) -o $$@
-OBJ_CMD = $$(RISCV_OBJDUMP) $$@ -D > $$@.objdump; \
- $$(RISCV_OBJDUMP) $$@ --source > $$@.debug
-
-
-COMPILE_TARGET=\
- $(COMPILE_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m$$(RISCV_GCC) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ; \
- $(OBJ_CMD); \
- if [ $$$$? -ne 0 ] ; \
- then \
- echo "\e[31m $$(RISCV_OBJDUMP) failed for target $$(@) \e[39m" ; \
- exit 1 ; \
- fi ;
-
+include $(TARGETDIR)/spike/device/Makefile_common.inc
RUN_CMD = $(TARGET_SIM) $(TARGET_FLAGS) --isa=rv64ic \
+signature=$(*).signature.output +signature-granularity=4\
$<