1 #=======================================================================
2 # Makefile for riscv-tests
3 #-----------------------------------------------------------------------
7 #--------------------------------------------------------------------
9 #--------------------------------------------------------------------
12 illegal_tvec_cmd illegal_tvec_regid \
13 illegal_vt_inst illegal_vt_regid \
14 ma_utld ma_utsd ma_vld ma_vsd \
19 rv64sv_sc_vec_tests
= \
21 #--------------------------------------------------------------------
23 #--------------------------------------------------------------------
26 RISCV_GCC_OPTS
= -nostdlib
-nostartfiles
27 RISCV_OBJDUMP
= riscv-objdump
--disassemble-all
--disassemble-zeroes
--section
=.text
--section
=.data
--section
=.bss
28 RISCV_SIM
= riscv-isa-run
30 #------------------------------------------------------------
31 # Build assembly tests
34 elf2hex
16 16384 $< > $@
37 $(RISCV_OBJDUMP
) $< > $@
42 rv64sv_p_tests_bin
= $(addprefix rv64sv-p-
, $(rv64sv_sc_tests
))
43 rv64sv_p_tests_dump
= $(addsuffix .dump
, $(rv64sv_p_tests_bin
))
44 rv64sv_p_tests_hex
= $(addsuffix .hex
, $(rv64sv_p_tests_bin
))
45 rv64sv_p_tests_out
= $(addsuffix .out
, $(rv64sv_p_tests_bin
))
47 $(rv64sv_p_tests_bin
): rv64sv-p-
%: %.S
48 $(RISCV_GCC
) $(RISCV_GCC_OPTS
) -I..
/..
/env
/p
-I..
/macros
/scalar
-T..
/..
/env
/p
/link.
ld $< -o
$@
50 rv64sv_pm_tests_bin
= $(addprefix rv64sv-pm-
, $(rv64sv_mc_tests
))
51 rv64sv_pm_tests_dump
= $(addsuffix .dump
, $(rv64sv_pm_tests_bin
))
52 rv64sv_pm_tests_hex
= $(addsuffix .hex
, $(rv64sv_pm_tests_bin
))
53 rv64sv_pm_tests_out
= $(addsuffix .out
, $(rv64sv_pm_tests_bin
))
55 $(rv64sv_pm_tests_bin
): rv64sv-pm-
%: %.S
56 $(RISCV_GCC
) $(RISCV_GCC_OPTS
) -I..
/..
/env
/pm
-I..
/macros
/scalar
-T..
/..
/env
/pm
/link.
ld $< -o
$@
58 rv64sv_p_vec_tests_bin
= $(addprefix rv64sv-p-vec-
, $(rv64sv_sc_vec_tests
))
59 rv64sv_p_vec_tests_dump
= $(addsuffix .dump
, $(rv64sv_p_vec_tests_bin
))
60 rv64sv_p_vec_tests_hex
= $(addsuffix .hex
, $(rv64sv_p_vec_tests_bin
))
61 rv64sv_p_vec_tests_out
= $(addsuffix .out
, $(rv64sv_p_vec_tests_bin
))
63 $(rv64sv_p_vec_tests_bin
): rv64sv-p-vec-
%: %.S
64 $(RISCV_GCC
) $(RISCV_GCC_OPTS
) -I..
/..
/env
/p
-I..
/macros
/vector
-T..
/..
/env
/p
/link.
ld $< -o
$@
66 rv64sv_pt_vec_tests_bin
= $(addprefix rv64sv-pt-vec-
, $(rv64sv_sc_vec_tests
))
67 rv64sv_pt_vec_tests_dump
= $(addsuffix .dump
, $(rv64sv_pt_vec_tests_bin
))
68 rv64sv_pt_vec_tests_hex
= $(addsuffix .hex
, $(rv64sv_pt_vec_tests_bin
))
69 rv64sv_pt_vec_tests_out
= $(addsuffix .out
, $(rv64sv_pt_vec_tests_bin
))
71 $(rv64sv_pt_vec_tests_bin
): rv64sv-pt-vec-
%: %.S
72 $(RISCV_GCC
) $(RISCV_GCC_OPTS
) -I..
/..
/env
/pt
-I..
/macros
/vector
-T..
/..
/env
/pt
/link.
ld $< -o
$@
75 $(rv64sv_p_tests_dump
) $(rv64sv_p_tests_hex
) \
76 $(rv64sv_pm_tests_dump
) $(rv64sv_pm_tests_hex
) \
77 $(rv64sv_p_vec_tests_dump
) $(rv64sv_p_vec_tests_hex
) \
78 $(rv64sv_pt_vec_tests_dump
) $(rv64sv_pt_vec_tests_hex
) \
83 echo
; perl
-ne
'print " [$$1] $$ARGV \t$$2\n" if /\*{3}(.{8})\*{3}(.*)/' \
87 $(rv64sv_p_tests_bin
) $(rv64sv_p_tests_dump
) $(rv64sv_p_tests_hex
) $(rv64sv_p_tests_out
) \
88 $(rv64sv_pm_tests_bin
) $(rv64sv_pm_tests_dump
) $(rv64sv_pm_tests_hex
) $(rv64sv_pm_tests_out
) \
89 $(rv64sv_p_vec_tests_bin
) $(rv64sv_p_vec_tests_dump
) $(rv64sv_p_vec_tests_hex
) $(rv64sv_p_vec_tests_out
) \
90 $(rv64sv_pt_vec_tests_bin
) $(rv64sv_pt_vec_tests_dump
) $(rv64sv_pt_vec_tests_hex
) $(rv64sv_pt_vec_tests_out
) \
92 #------------------------------------------------------------
97 #------------------------------------------------------------