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
70
71
72
73
74
75
76
|
#ifndef _ENV_PHYSICAL_SINGLE_CORE_H
#define _ENV_PHYSICAL_SINGLE_CORE_H
//-----------------------------------------------------------------------
// Begin Macro
//-----------------------------------------------------------------------
#define RVTEST_RV64U \
#define RVTEST_RV64S \
#define RVTEST_FP_ENABLE \
setpcr cr0, 2; \
mfpcr a0, cr0; \
and a0, a0, 2; \
beqz a0, 1f; \
mtfsr x0; \
1:
#define RVTEST_PASS_NOFP \
RVTEST_FP_ENABLE \
bnez a0, 2f; \
RVTEST_PASS \
2: \
#define RVTEST_VEC_ENABLE \
mfpcr a0, cr0; \
ori a0, a0, 4; \
mtpcr a0, cr0; \
li a0, 0xff; \
mtpcr a0, cr18; \
#define RVTEST_CODE_BEGIN \
.text; \
.align 4; \
.global _start; \
_start: \
RVTEST_FP_ENABLE \
RVTEST_VEC_ENABLE \
mfpcr a0, cr10; 1: bnez a0, 1b; \
//-----------------------------------------------------------------------
// End Macro
//-----------------------------------------------------------------------
#define RVTEST_CODE_END \
//-----------------------------------------------------------------------
// Pass/Fail Macro
//-----------------------------------------------------------------------
#define RVTEST_PASS \
fence; \
li x1, 1; \
mtpcr x1, cr30; \
1: b 1b; \
#define RVTEST_FAIL \
fence; \
beqz x28, 1f; \
sll x28, x28, 1; \
or x28, x28, 1; \
mtpcr x28, cr30; \
1: b 1b; \
//-----------------------------------------------------------------------
// Data Section Macro
//-----------------------------------------------------------------------
#define RVTEST_DATA_BEGIN
#define RVTEST_DATA_END
//#define RVTEST_DATA_BEGIN .align 4; .global begin_signature; begin_signature:
//#define RVTEST_DATA_END .align 4; .global end_signature; end_signature:
#endif
|