add missing RVTEST_CODE_END macros
[riscv-tests.git] / isa / rv64uv / Makefile
1 #=======================================================================
2 # Makefile for riscv-tests
3 #-----------------------------------------------------------------------
4
5 default: all
6
7 #--------------------------------------------------------------------
8 # Sources
9 #--------------------------------------------------------------------
10
11 rv64uv_sc_tests = \
12 wakeup fence \
13 vvcfgivl vvcfg vsetvl \
14 vfmvv vmsv vmvv \
15 utidx \
16 lb lbu lh lhu lw lwu ld \
17 sb sh sw sd \
18 fld flw \
19 fsd fsw \
20 amoadd_d amoand_d amomax_d amomaxu_d amomin_d amominu_d amoor_d amoswap_d \
21 amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoswap_w \
22 imul \
23 movn movz \
24 fcvt fma \
25 fmovn fmovz \
26 vvadd_d vvadd_w vvadd_fd vvadd_fw \
27 vvmul_d \
28 vvadd_branch \
29
30 rv64uv_mc_tests = \
31
32 rv64uv_sc_vec_tests = \
33 beq bge bgeu blt bltu bne \
34
35 #--------------------------------------------------------------------
36 # Build rules
37 #--------------------------------------------------------------------
38
39 RISCV_GCC = riscv-gcc
40 RISCV_GCC_OPTS = -nostdlib -nostartfiles
41 RISCV_OBJDUMP = riscv-objdump --disassemble-all --disassemble-zeroes --section=.text --section=.data --section=.bss
42 RISCV_SIM = riscv-isa-run
43
44 #------------------------------------------------------------
45 # Build assembly tests
46
47 %.hex: %
48 elf2hex 16 16384 $< > $@
49
50 %.dump: %
51 $(RISCV_OBJDUMP) $< > $@
52
53 %.out: %
54 $(RISCV_SIM) $< 2> $@
55
56 rv64uv_p_tests_bin = $(addprefix rv64uv-p-, $(rv64uv_sc_tests))
57 rv64uv_p_tests_dump = $(addsuffix .dump, $(rv64uv_p_tests_bin))
58 rv64uv_p_tests_hex = $(addsuffix .hex, $(rv64uv_p_tests_bin))
59 rv64uv_p_tests_out = $(addsuffix .out, $(rv64uv_p_tests_bin))
60
61 $(rv64uv_p_tests_bin): rv64uv-p-%: %.S
62 $(RISCV_GCC) $(RISCV_GCC_OPTS) -I../../env/p -I../macros/scalar -T../../env/p/link.ld $< -o $@
63
64 rv64uv_pm_tests_bin = $(addprefix rv64uv-pm-, $(rv64uv_mc_tests))
65 rv64uv_pm_tests_dump = $(addsuffix .dump, $(rv64uv_pm_tests_bin))
66 rv64uv_pm_tests_hex = $(addsuffix .hex, $(rv64uv_pm_tests_bin))
67 rv64uv_pm_tests_out = $(addsuffix .out, $(rv64uv_pm_tests_bin))
68
69 $(rv64uv_pm_tests_bin): rv64uv-pm-%: %.S
70 $(RISCV_GCC) $(RISCV_GCC_OPTS) -I../../env/pm -I../macros/scalar -T../../env/pm/link.ld $< -o $@
71
72 rv64uv_v_tests_bin = $(addprefix rv64uv-v-, $(rv64uv_sc_tests))
73 rv64uv_v_tests_dump = $(addsuffix .dump, $(rv64uv_v_tests_bin))
74 rv64uv_v_tests_hex = $(addsuffix .hex, $(rv64uv_v_tests_bin))
75 rv64uv_v_tests_out = $(addsuffix .out, $(rv64uv_v_tests_bin))
76
77 $(rv64uv_v_tests_bin): rv64uv-v-%: %.S
78 $(RISCV_GCC) $(RISCV_GCC_OPTS) -std=gnu99 -O2 -I../../env/v -I../macros/scalar -T../../env/v/link.ld ../../env/v/entry.S ../../env/v/vm.c $< -lc -o $@
79
80 rv64uv_p_vec_tests_bin = $(addprefix rv64uv-p-vec-, $(rv64uv_sc_vec_tests))
81 rv64uv_p_vec_tests_dump = $(addsuffix .dump, $(rv64uv_p_vec_tests_bin))
82 rv64uv_p_vec_tests_hex = $(addsuffix .hex, $(rv64uv_p_vec_tests_bin))
83 rv64uv_p_vec_tests_out = $(addsuffix .out, $(rv64uv_p_vec_tests_bin))
84
85 $(rv64uv_p_vec_tests_bin): rv64uv-p-vec-%: %.S
86 $(RISCV_GCC) $(RISCV_GCC_OPTS) -I../../env/p -I../macros/vector -T../../env/p/link.ld $< -o $@
87
88 rv64uv_pt_vec_tests_bin = $(addprefix rv64uv-pt-vec-, $(rv64uv_sc_vec_tests))
89 rv64uv_pt_vec_tests_dump = $(addsuffix .dump, $(rv64uv_pt_vec_tests_bin))
90 rv64uv_pt_vec_tests_hex = $(addsuffix .hex, $(rv64uv_pt_vec_tests_bin))
91 rv64uv_pt_vec_tests_out = $(addsuffix .out, $(rv64uv_pt_vec_tests_bin))
92
93 $(rv64uv_pt_vec_tests_bin): rv64uv-pt-vec-%: %.S
94 $(RISCV_GCC) $(RISCV_GCC_OPTS) -I../../env/pt -I../macros/vector -T../../env/pt/link.ld $< -o $@
95
96 rv64uv_v_vec_tests_bin = $(addprefix rv64uv-v-vec-, $(rv64uv_sc_vec_tests))
97 rv64uv_v_vec_tests_dump = $(addsuffix .dump, $(rv64uv_v_vec_tests_bin))
98 rv64uv_v_vec_tests_hex = $(addsuffix .hex, $(rv64uv_v_vec_tests_bin))
99 rv64uv_v_vec_tests_out = $(addsuffix .out, $(rv64uv_v_vec_tests_bin))
100
101 $(rv64uv_v_vec_tests_bin): rv64uv-v-vec-%: %.S
102 $(RISCV_GCC) $(RISCV_GCC_OPTS) -std=gnu99 -O2 -I../../env/v -I../macros/vector -T../../env/v/link.ld ../../env/v/entry.S ../../env/v/vm.c $< -lc -o $@
103
104 riscv-: \
105 $(rv64uv_p_tests_dump) $(rv64uv_p_tests_hex) \
106 $(rv64uv_pm_tests_dump) $(rv64uv_pm_tests_hex) \
107 $(rv64uv_v_tests_dump) $(rv64uv_v_tests_hex) \
108 $(rv64uv_p_vec_tests_dump) $(rv64uv_p_vec_tests_hex) \
109 $(rv64uv_pt_vec_tests_dump) $(rv64uv_pt_vec_tests_hex) \
110 $(rv64uv_v_vec_tests_dump) $(rv64uv_v_vec_tests_hex) \
111
112 out = $(rv64uv_p_tests_out) $(rv64uv_pm_tests_out)
113
114 run: $(out)
115 echo; perl -ne 'print " [$$1] $$ARGV \t$$2\n" if /\*{3}(.{8})\*{3}(.*)/' \
116 $(out); echo;
117
118 junk += \
119 $(rv64uv_p_tests_bin) $(rv64uv_p_tests_dump) $(rv64uv_p_tests_hex) $(rv64uv_p_tests_out) \
120 $(rv64uv_pm_tests_bin) $(rv64uv_pm_tests_dump) $(rv64uv_pm_tests_hex) $(rv64uv_pm_tests_out) \
121 $(rv64uv_v_tests_bin) $(rv64uv_v_tests_dump) $(rv64uv_v_tests_hex) $(rv64uv_v_tests_out) \
122 $(rv64uv_p_vec_tests_bin) $(rv64uv_p_vec_tests_dump) $(rv64uv_p_vec_tests_hex) $(rv64uv_p_vec_tests_out) \
123 $(rv64uv_pt_vec_tests_bin) $(rv64uv_pt_vec_tests_dump) $(rv64uv_pt_vec_tests_hex) $(rv64uv_pt_vec_tests_out) \
124 $(rv64uv_v_vec_tests_bin) $(rv64uv_v_vec_tests_dump) $(rv64uv_v_vec_tests_hex) $(rv64uv_v_vec_tests_out) \
125
126 #------------------------------------------------------------
127 # Default
128
129 all: riscv-
130
131 #------------------------------------------------------------
132 # Clean up
133
134 clean:
135 rm -rf $(junk)