Go to the documentation of this file.
21 #ifndef __ARCH_SIM_DEF_H__
22 #define __ARCH_SIM_DEF_H__
30 #define _SIM_CONTROL_OPERATOR_BITS 8
38 #define SIM_CONTROL_PROFILER_DISABLE 0
41 #define SIM_CONTROL_PROFILER_ENABLE 1
44 #define SIM_CONTROL_PROFILER_CLEAR 2
47 #define SIM_CONTROL_CHECKPOINT 3
53 #define SIM_CONTROL_SET_TRACING 4
59 #define SIM_CONTROL_DUMP 5
62 #define SIM_CONTROL_PROFILER_CHIP_CLEAR 6
65 #define SIM_CONTROL_PROFILER_CHIP_DISABLE 7
68 #define SIM_CONTROL_PROFILER_CHIP_ENABLE 8
71 #define SIM_CONTROL_ENABLE_FUNCTIONAL 9
74 #define SIM_CONTROL_DISABLE_FUNCTIONAL 10
82 #define SIM_CONTROL_ENABLE_FUNCTIONAL_BARRIER 11
91 #define SIM_CONTROL_PUTC 12
99 #define SIM_CONTROL_GRINDER_CLEAR 13
102 #define SIM_CONTROL_SHUTDOWN 14
108 #define SIM_CONTROL_OS_FORK 15
114 #define SIM_CONTROL_OS_EXIT 16
120 #define SIM_CONTROL_OS_SWITCH 17
127 #define SIM_CONTROL_OS_EXEC 18
135 #define SIM_CONTROL_OS_INTERP 19
143 #define SIM_CONTROL_DLOPEN 20
151 #define SIM_CONTROL_DLCLOSE 21
159 #define SIM_CONTROL_ALLOW_MULTIPLE_CACHING 22
162 #define SIM_CONTROL_ENABLE_MEM_LOGGING 23
165 #define SIM_CONTROL_DISABLE_MEM_LOGGING 24
172 #define SIM_CONTROL_SHAPING 25
179 #define SIM_CONTROL_COMMAND 26
185 #define SIM_CONTROL_PANIC 27
191 #define SIM_CONTROL_SYSCALL 32
198 #define SIM_CONTROL_OS_FORK_PARENT 33
206 #define SIM_CONTROL_CLEAR_MPIPE_MAGIC_BYTES 34
214 #define SIM_CONTROL_APPEND_MPIPE_MAGIC_BYTE 35
222 #define SIM_CONTROL_ENABLE_MPIPE_LINK_MAGIC_BYTE 36
230 #define SIM_SYSCALL_ADD_WATCHPOINT 2
233 #define SIM_SYSCALL_REMOVE_WATCHPOINT 3
236 #define SIM_SYSCALL_QUERY_WATCHPOINT 4
244 #define SIM_SYSCALL_VALIDATE_LINES_EVICTED 5
247 #define SIM_SYSCALL_QUERY_CPU_SPEED 6
261 #define SIM_TRACE_CYCLES 0x01
264 #define SIM_TRACE_ROUTER 0x02
267 #define SIM_TRACE_REGISTER_WRITES 0x04
270 #define SIM_TRACE_DISASM 0x08
273 #define SIM_TRACE_STALL_INFO 0x10
276 #define SIM_TRACE_MEMORY_CONTROLLER 0x20
279 #define SIM_TRACE_L2_CACHE 0x40
282 #define SIM_TRACE_LINES 0x80
285 #define SIM_TRACE_NONE 0
288 #define SIM_TRACE_ALL (-1)
293 #define SIM_TRACE_SPR_ARG(mask) \
294 (SIM_CONTROL_SET_TRACING | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
308 #define SIM_DUMP_REGS 0x001
311 #define SIM_DUMP_SPRS 0x002
314 #define SIM_DUMP_ITLB 0x004
317 #define SIM_DUMP_DTLB 0x008
320 #define SIM_DUMP_L1I 0x010
323 #define SIM_DUMP_L1D 0x020
326 #define SIM_DUMP_L2 0x040
329 #define SIM_DUMP_SNREGS 0x080
332 #define SIM_DUMP_SNITLB 0x100
335 #define SIM_DUMP_SNL1I 0x200
338 #define SIM_DUMP_BACKTRACE 0x400
341 #define SIM_DUMP_VALID_LINES 0x800
344 #define SIM_DUMP_ALL (-1 & ~SIM_DUMP_VALID_LINES)
349 #define SIM_DUMP_SPR_ARG(mask) \
350 (SIM_CONTROL_DUMP | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
364 #define SIM_CHIP_MEMCTL 0x001
367 #define SIM_CHIP_XAUI 0x002
370 #define SIM_CHIP_PCIE 0x004
373 #define SIM_CHIP_MPIPE 0x008
376 #define SIM_CHIP_TRIO 0x010
379 #define SIM_CHIP_ALL (-1)
384 #define SIM_PROFILER_CHIP_CLEAR_SPR_ARG(mask) \
385 (SIM_CONTROL_PROFILER_CHIP_CLEAR | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
388 #define SIM_PROFILER_CHIP_DISABLE_SPR_ARG(mask) \
389 (SIM_CONTROL_PROFILER_CHIP_DISABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
392 #define SIM_PROFILER_CHIP_ENABLE_SPR_ARG(mask) \
393 (SIM_CONTROL_PROFILER_CHIP_ENABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
400 #define SIM_CONTROL_SHAPING_SHIM_ID_BITS 3
408 #define SIM_CONTROL_SHAPING_GBE_0 0x0
411 #define SIM_CONTROL_SHAPING_GBE_1 0x1
414 #define SIM_CONTROL_SHAPING_GBE_2 0x2
417 #define SIM_CONTROL_SHAPING_GBE_3 0x3
420 #define SIM_CONTROL_SHAPING_XGBE_0 0x4
423 #define SIM_CONTROL_SHAPING_XGBE_1 0x5
426 #define SIM_CONTROL_SHAPING_TYPE_BITS 2
429 #define SIM_CONTROL_SHAPING_MULTIPLIER 0
432 #define SIM_CONTROL_SHAPING_PPS 1
435 #define SIM_CONTROL_SHAPING_BPS 2
438 #define SIM_CONTROL_SHAPING_UNITS_BITS 2
441 #define SIM_CONTROL_SHAPING_UNITS_SINGLE 0
444 #define SIM_CONTROL_SHAPING_UNITS_KILO 1
447 #define SIM_CONTROL_SHAPING_UNITS_MEGA 2
450 #define SIM_CONTROL_SHAPING_UNITS_GIGA 3
455 #define SIM_CONTROL_SHAPING_RATE_BITS \
456 (32 - (_SIM_CONTROL_OPERATOR_BITS + \
457 SIM_CONTROL_SHAPING_SHIM_ID_BITS + \
458 SIM_CONTROL_SHAPING_TYPE_BITS + \
459 SIM_CONTROL_SHAPING_UNITS_BITS))
462 #define SIM_SHAPING_SPR_ARG(shim, type, units, rate) \
463 (SIM_CONTROL_SHAPING | \
465 ((type) << (SIM_CONTROL_SHAPING_SHIM_ID_BITS)) | \
466 ((units) << (SIM_CONTROL_SHAPING_SHIM_ID_BITS + \
467 SIM_CONTROL_SHAPING_TYPE_BITS)) | \
468 ((rate) << (SIM_CONTROL_SHAPING_SHIM_ID_BITS + \
469 SIM_CONTROL_SHAPING_TYPE_BITS + \
470 SIM_CONTROL_SHAPING_UNITS_BITS))) << _SIM_CONTROL_OPERATOR_BITS)
482 #define SIM_TRACE_FLAG_MASK 0xFFFF
485 #define SIM_PROFILER_ENABLED_MASK 0x10000
496 #define SIM_PUTC_FLUSH_STRING 0x100
502 #define SIM_PUTC_FLUSH_BINARY 0x101