forked from riscv-non-isa/riscv-arch-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (55 loc) · 1.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# Ensure the compiler and necessary executables are on the search PATH
#
#
# Ensure you have set the following Variables
#
#
pipe:= |
empty:=
space:= $(empty) $(empty)
RISCV_ISA_ALL = $(shell ls $(ROOTDIR)/riscv-test-suite)
RISCV_ISA_OPT = $(subst $(space),$(pipe),$(RISCV_ISA_ALL))
export RISCV_TARGET ?= riscvOVPsim
export RISCV_DEVICE ?= rv32i
export RISCV_PREFIX ?= riscv64-unknown-elf-
ifeq ($(RISCV_ISA),)
RISCV_ISA = rv32i
DEFAULT_TARGET=all_variant
else
DEFAULT_TARGET=variant
endif
export ROOTDIR = $(shell pwd)
export WORK = $(ROOTDIR)/work
export SUITEDIR = $(ROOTDIR)/riscv-test-suite/$(RISCV_ISA)
default: $(DEFAULT_TARGET)
variant: simulate verify
all_variant:
for isa in $(RISCV_ISA_ALL); do \
echo $$isa; \
$(MAKE) RISCV_TARGET=$(RISCV_TARGET) RISCV_DEVICE=$$isa RISCV_ISA=$$isa variant; \
rc=$$?; \
if [ $$rc -ne 0 ]; then \
exit $$rc; \
fi \
done
simulate:
make \
RISCV_TARGET=$(RISCV_TARGET) \
RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=$(RISCV_PREFIX) \
run -C $(SUITEDIR)
verify:
riscv-test-env/verify.sh
clean:
make \
RISCV_TARGET=$(RISCV_TARGET) \
RISCV_DEVICE=$(RISCV_DEVICE) \
RISCV_PREFIX=$(RISCV_PREFIX) \
clean -C $(SUITEDIR)
help:
@echo "make"
@echo "RISCV_TARGET='riscvOVPsim|spike'"
@echo "RISCV_DEVICE='rv32i|rv32im|...'"
@echo "RISCV_ISA=$(RISCV_ISA_OPT)"
@echo "make all_variant // all combinations"