-
Notifications
You must be signed in to change notification settings - Fork 92
/
Kconfig
388 lines (321 loc) · 7.78 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
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 ILEN_MIN
int
default 1 if ISA_x86
default 4 if ISA_mips32
default 4 if ISA_riscv32
default 2 if ISA_riscv64
default 1
config ISA64
depends on ISA_riscv64
bool
default y
if ISA_x86
source "src/isa/x86/Kconfig"
endif
if ISA_riscv64
source "src/isa/riscv64/Kconfig"
endif
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.
config MODE_USER
bool "User mode"
help
Only support non-privileged instructions. System calls are forwarded to NEMU or Linux host.
endchoice
menu "Build Options"
choice
prompt "Compiler"
default CC_GCC
config CC_GCC
bool "gcc"
config CC_GPP
bool "g++"
config CC_CLANG
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_NATIVE_ARCH
bool "Enable march=native"
default n
config CC_LTO
bool "Enable link-time optimization"
default y
config CC_DEBUG
bool "Enable debug information"
default n
config CC_ASAN
depends on !MODE_USER
bool "Enable address sanitizer"
default n
endmenu
menu "Testing and Debugging"
config DEBUG
bool "Enable debug features: instruction tracing and watchpoint"
default n
help
Enable debug features, which include instruction tracing and watchpoint.
Add -l <logfile path> to enable instruction tracing and log dump.
config DIFFTEST
depends on !SHARE
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_QEMU_DL
depends on DIFFTEST
config DIFFTEST_REF_QEMU_DL
bool "QEMU, communicate with dynamic linking"
config DIFFTEST_REF_QEMU_SOCKET
bool "QEMU, communicate with socket"
config DIFFTEST_REF_KVM
bool "KVM"
config DIFFTEST_REF_NEMU
bool "NEMU"
config DIFFTEST_REF_SPIKE
bool "SPIKE"
endchoice
config DIFFTEST_STORE_COMMIT
depends on DIFFTEST_REF_SPIKE
bool "Check the data of the store class instruction"
default n
config DIFFTEST_REF_QEMU
depends on DIFFTEST_REF_QEMU_DL || DIFFTEST_REF_QEMU_SOCKET
bool
default y
config DIFFTEST_REF_PATH
string
default "tools/qemu-dl-diff" if DIFFTEST_REF_QEMU_DL
default "tools/qemu-socket-diff" if DIFFTEST_REF_QEMU_SOCKET
default "tools/kvm-diff" if DIFFTEST_REF_KVM
default "." if DIFFTEST_REF_NEMU
default "none"
config DIFFTEST_REF_NAME
string
default "qemu" if DIFFTEST_REF_QEMU_DL
default "qemu" if DIFFTEST_REF_QEMU_SOCKET
default "kvm" if DIFFTEST_REF_KVM
default "nemu-interpreter" if DIFFTEST_REF_NEMU
default "none"
config DETERMINISTIC
bool "Make the behavior of NEMU deterministic"
default n
config IQUEUE
bool "Record the last instrucitons executed"
default n
config MEMLOG
bool "Enable Log for memory"
default n
config TRANSLOG
bool "Enable Log for address translation"
default n
config EXITLOG
bool "Enable Log for exiting reasons"
default n
config TRACE_INST
bool "Enable Log for tracing instructions"
default n
config TRACE_INST_DASM
depends on DEBUG
bool "Enable rich Log for tracing instructions, pc, inst and dasm included"
default n
config TRACE_BB
bool "Enable Log for tracing basic block"
default n
config SIMPOINT_LOG
bool "Enable Log for simpoint profiling"
default n
endmenu
if !MODE_USER
source "src/memory/Kconfig"
source "src/device/Kconfig"
endif
choice
prompt "FPU Emulation"
default FPU_SOFT
config FPU_HOST
bool "Use host floating point operation"
config FPU_SOFT
bool "Use softfloat library"
config FPU_NONE
bool "Disable FPU Emulation"
endchoice
choice
prompt "Detecting misaligned memory accessing"
default AC_SOFT
config AC_HOST
bool "By host CPU (x86 host only)"
config AC_SOFT
bool "By software emulation"
config AC_NONE
bool "Disable"
endchoice
config VECTOR_AC_SOFT
bool "Detecting misaligned vector memory accessing"
default y
config MMIO_AC_SOFT
bool "Detecting misaligned mmio memory accessing"
default y
config AMO_AC_SOFT
bool "Detecting misaligned amo memory accessing"
default y
menu "Processor difftest reference config"
config SHARE
bool "Build shared library as processor difftest reference"
default n
config DIFFTEST_STORE_COMMIT
depends on SHARE
bool "Maintain a committed store queue for processor ref"
default y
config DIFFTEST_REF_FOR_GEM5
depends on SHARE
bool "Always copy lrsc valid to lr valid for GEM5"
default n
config DIFFTEST_STORE_COMMIT_AMO
depends on DIFFTEST_STORE_COMMIT
bool "Also record store requests by AMO instructions"
default n
config DIFFTEST_STORE_QUEUE_SIZE
depends on DIFFTEST_STORE_COMMIT
int "Size of committed store queue"
default 64
config GUIDED_EXEC
depends on SHARE
bool "Enable DUT guided execution"
default y
config GUIDED_TVAL
bool "When page fault is present, use DUT's tval"
depends on GUIDED_EXEC
default n
help
This will use the dut's tval as the tval when triggering page fault, but be careful, this may synchronize the wrong data.
This is mainly for vector access, which causes NEMU to trigger pf when vector access actually triggers an pf.
If this option is not enabled, NEMU fires the vector pf on the first element.
config QUERY_REF
depends on SHARE
bool "Enable event query support when used as difftest ref"
default y
config LARGE_COPY
depends on SHARE && !MEM_RANDOM
bool "Enable difftest large memory copy optimization"
default n
config PANIC_ON_UNIMP_CSR
depends on SHARE
bool "Panic if an unimplemented CSR is being accessed"
default n
config REF_STATUS
depends on SHARE
bool "Enable ref status API"
default n
endmenu
menu "Miscellaneous"
choice
prompt "Host timer"
default TIMER_GETTIMEOFDAY
config TIMER_GETTIMEOFDAY
bool "gettimeofday"
config TIMER_CLOCK_GETTIME
bool "clock_gettime"
endchoice
config MEMORY_REGION_ANALYSIS
bool "Enable Program memory segment analysis"
default n
if MEMORY_REGION_ANALYSIS
config MEMORY_REGION_ANALYSIS_SIZE
int "Analysis block MB size"
default 32
endif
config REPORT_ILLEGAL_INSTR
bool "Let NEMU report illegal instruction"
default y
config RT_CHECK
bool "Enable runtime checking"
default y
config PERF_OPT
depends on !SHARE
bool "Performance optimization"
default y
if PERF_OPT
config TCACHE_SIZE
int "Number of entries in trace cache"
default 8192
config BB_LIST_SIZE
int "Number of entries in basic block metadata list"
default 1024
config BB_POOL_SIZE
int "Number of entries in basic block metadata pool"
default 1024
if !DEBUG && !SHARE
config DISABLE_INSTR_CNT
bool "Disable instruction counting (single step is also disabled)"
default y
endif
endif
config ENABLE_INSTR_CNT
bool "Enable instruction counting"
default n if DISABLE_INSTR_CNT
default y
endmenu