forked from NJU-ProjectN/nemu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kconfig
212 lines (178 loc) · 3.89 KB
/
Kconfig
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
mainmenu "NEMU Configuration Menu"
choice
prompt "Base ISA"
default ISA_riscv32
config ISA_x86
bool "x86"
config ISA_mips32
bool "mips32"
config ISA_riscv32
bool "riscv32"
config ISA_riscv64
bool "riscv64"
endchoice
config ISA
string
default "x86" if ISA_x86
default "mips32" if ISA_mips32
default "riscv32" if ISA_riscv32
default "riscv64" if ISA_riscv64
default "none"
config ISA64
depends on ISA_riscv64
bool
default y
choice
prompt "NEMU execution engine"
default ENGINE_INTERPRETER
config ENGINE_INTERPRETER
bool "Interpreter"
help
Interpreter guest instructions one by one.
endchoice
config ENGINE
string
default "interpreter" if ENGINE_INTERPRETER
default "none"
choice
prompt "Running mode"
default MODE_SYSTEM
config MODE_SYSTEM
bool "System mode"
help
Support full-system functionality, including privileged instructions, MMU and devices.
endchoice
choice
prompt "Build target"
default TARGET_NATIVE_ELF
config TARGET_NATIVE_ELF
bool "Executable on Linux Native"
config TARGET_SHARE
bool "Shared object (used as REF for differential testing)"
config TARGET_AM
bool "Application on Abstract-Machine (DON'T CHOOSE)"
endchoice
menu "Build Options"
choice
prompt "Compiler"
default CC_GCC
config CC_GCC
bool "gcc"
config CC_GPP
bool "g++"
config CC_CLANG
depends on !TARGET_AM
bool "clang"
endchoice
config CC
string
default "gcc" if CC_GCC
default "g++" if CC_GPP
default "clang" if CC_CLANG
default "none"
choice
prompt "Optimization Level"
default CC_O2
config CC_O0
bool "O0"
config CC_O1
bool "O1"
config CC_O2
bool "O2"
config CC_O3
bool "O3"
endchoice
config CC_OPT
string
default "-O0" if CC_O0
default "-O1" if CC_O1
default "-O2" if CC_O2
default "-O3" if CC_O3
default "none"
config CC_LTO
depends on !TARGET_AM
bool "Enable link-time optimization"
default n
config CC_DEBUG
bool "Enable debug information"
default n
config CC_ASAN
depends on MODE_SYSTEM
bool "Enable address sanitizer"
default n
endmenu
menu "Testing and Debugging"
config TRACE
bool "Enable tracer"
default y
config TRACE_START
depends on TRACE
int "When tracing is enabled (unit: number of instructions)"
default 0
config TRACE_END
depends on TRACE
int "When tracing is disabled (unit: number of instructions)"
default 10000
config ITRACE
depends on TRACE && TARGET_NATIVE_ELF && ENGINE_INTERPRETER
bool "Enable instruction tracer"
default y
config ITRACE_COND
depends on ITRACE
string "Only trace instructions when the condition is true"
default "true"
config DIFFTEST
depends on TARGET_NATIVE_ELF
bool "Enable differential testing"
default n
help
Enable differential testing with a reference design.
Note that this will significantly reduce the performance of NEMU.
choice
prompt "Reference design"
default DIFFTEST_REF_SPIKE if ISA_riscv64 || ISA_riscv32
default DIFFTEST_REF_KVM if ISA_x86
default DIFFTEST_REF_QEMU
depends on DIFFTEST
config DIFFTEST_REF_QEMU
bool "QEMU, communicate with socket"
if ISA_riscv64 || ISA_riscv32
config DIFFTEST_REF_SPIKE
bool "Spike"
endif
if ISA_x86
config DIFFTEST_REF_KVM
bool "KVM"
endif
endchoice
config DIFFTEST_REF_PATH
string
default "tools/qemu-diff" if DIFFTEST_REF_QEMU
default "tools/kvm-diff" if DIFFTEST_REF_KVM
default "tools/spike-diff" if DIFFTEST_REF_SPIKE
default "none"
config DIFFTEST_REF_NAME
string
default "qemu" if DIFFTEST_REF_QEMU
default "kvm" if DIFFTEST_REF_KVM
default "spike" if DIFFTEST_REF_SPIKE
default "none"
endmenu
if MODE_SYSTEM
source "src/memory/Kconfig"
source "src/device/Kconfig"
endif
menu "Miscellaneous"
choice
depends on !TARGET_AM
prompt "Host timer"
default TIMER_GETTIMEOFDAY
config TIMER_GETTIMEOFDAY
bool "gettimeofday"
config TIMER_CLOCK_GETTIME
bool "clock_gettime"
endchoice
config RT_CHECK
bool "Enable runtime checking"
default y
endmenu