Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
sim_def.h File Reference

Go to the source code of this file.

Macros

#define _SIM_CONTROL_OPERATOR_BITS   8
 
#define SIM_CONTROL_PROFILER_DISABLE   0
 
#define SIM_CONTROL_PROFILER_ENABLE   1
 
#define SIM_CONTROL_PROFILER_CLEAR   2
 
#define SIM_CONTROL_CHECKPOINT   3
 
#define SIM_CONTROL_SET_TRACING   4
 
#define SIM_CONTROL_DUMP   5
 
#define SIM_CONTROL_PROFILER_CHIP_CLEAR   6
 
#define SIM_CONTROL_PROFILER_CHIP_DISABLE   7
 
#define SIM_CONTROL_PROFILER_CHIP_ENABLE   8
 
#define SIM_CONTROL_ENABLE_FUNCTIONAL   9
 
#define SIM_CONTROL_DISABLE_FUNCTIONAL   10
 
#define SIM_CONTROL_ENABLE_FUNCTIONAL_BARRIER   11
 
#define SIM_CONTROL_PUTC   12
 
#define SIM_CONTROL_GRINDER_CLEAR   13
 
#define SIM_CONTROL_SHUTDOWN   14
 
#define SIM_CONTROL_OS_FORK   15
 
#define SIM_CONTROL_OS_EXIT   16
 
#define SIM_CONTROL_OS_SWITCH   17
 
#define SIM_CONTROL_OS_EXEC   18
 
#define SIM_CONTROL_OS_INTERP   19
 
#define SIM_CONTROL_DLOPEN   20
 
#define SIM_CONTROL_DLCLOSE   21
 
#define SIM_CONTROL_ALLOW_MULTIPLE_CACHING   22
 
#define SIM_CONTROL_ENABLE_MEM_LOGGING   23
 
#define SIM_CONTROL_DISABLE_MEM_LOGGING   24
 
#define SIM_CONTROL_SHAPING   25
 
#define SIM_CONTROL_COMMAND   26
 
#define SIM_CONTROL_PANIC   27
 
#define SIM_CONTROL_SYSCALL   32
 
#define SIM_CONTROL_OS_FORK_PARENT   33
 
#define SIM_CONTROL_CLEAR_MPIPE_MAGIC_BYTES   34
 
#define SIM_CONTROL_APPEND_MPIPE_MAGIC_BYTE   35
 
#define SIM_CONTROL_ENABLE_MPIPE_LINK_MAGIC_BYTE   36
 
#define SIM_SYSCALL_ADD_WATCHPOINT   2
 
#define SIM_SYSCALL_REMOVE_WATCHPOINT   3
 
#define SIM_SYSCALL_QUERY_WATCHPOINT   4
 
#define SIM_SYSCALL_VALIDATE_LINES_EVICTED   5
 
#define SIM_SYSCALL_QUERY_CPU_SPEED   6
 
#define SIM_TRACE_CYCLES   0x01
 
#define SIM_TRACE_ROUTER   0x02
 
#define SIM_TRACE_REGISTER_WRITES   0x04
 
#define SIM_TRACE_DISASM   0x08
 
#define SIM_TRACE_STALL_INFO   0x10
 
#define SIM_TRACE_MEMORY_CONTROLLER   0x20
 
#define SIM_TRACE_L2_CACHE   0x40
 
#define SIM_TRACE_LINES   0x80
 
#define SIM_TRACE_NONE   0
 
#define SIM_TRACE_ALL   (-1)
 
#define SIM_TRACE_SPR_ARG(mask)   (SIM_CONTROL_SET_TRACING | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
 
#define SIM_DUMP_REGS   0x001
 
#define SIM_DUMP_SPRS   0x002
 
#define SIM_DUMP_ITLB   0x004
 
#define SIM_DUMP_DTLB   0x008
 
#define SIM_DUMP_L1I   0x010
 
#define SIM_DUMP_L1D   0x020
 
#define SIM_DUMP_L2   0x040
 
#define SIM_DUMP_SNREGS   0x080
 
#define SIM_DUMP_SNITLB   0x100
 
#define SIM_DUMP_SNL1I   0x200
 
#define SIM_DUMP_BACKTRACE   0x400
 
#define SIM_DUMP_VALID_LINES   0x800
 
#define SIM_DUMP_ALL   (-1 & ~SIM_DUMP_VALID_LINES)
 
#define SIM_DUMP_SPR_ARG(mask)   (SIM_CONTROL_DUMP | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
 
#define SIM_CHIP_MEMCTL   0x001
 
#define SIM_CHIP_XAUI   0x002
 
#define SIM_CHIP_PCIE   0x004
 
#define SIM_CHIP_MPIPE   0x008
 
#define SIM_CHIP_TRIO   0x010
 
#define SIM_CHIP_ALL   (-1)
 
#define SIM_PROFILER_CHIP_CLEAR_SPR_ARG(mask)   (SIM_CONTROL_PROFILER_CHIP_CLEAR | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
 
#define SIM_PROFILER_CHIP_DISABLE_SPR_ARG(mask)   (SIM_CONTROL_PROFILER_CHIP_DISABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
 
#define SIM_PROFILER_CHIP_ENABLE_SPR_ARG(mask)   (SIM_CONTROL_PROFILER_CHIP_ENABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))
 
#define SIM_CONTROL_SHAPING_SHIM_ID_BITS   3
 
#define SIM_CONTROL_SHAPING_GBE_0   0x0
 
#define SIM_CONTROL_SHAPING_GBE_1   0x1
 
#define SIM_CONTROL_SHAPING_GBE_2   0x2
 
#define SIM_CONTROL_SHAPING_GBE_3   0x3
 
#define SIM_CONTROL_SHAPING_XGBE_0   0x4
 
#define SIM_CONTROL_SHAPING_XGBE_1   0x5
 
#define SIM_CONTROL_SHAPING_TYPE_BITS   2
 
#define SIM_CONTROL_SHAPING_MULTIPLIER   0
 
#define SIM_CONTROL_SHAPING_PPS   1
 
#define SIM_CONTROL_SHAPING_BPS   2
 
#define SIM_CONTROL_SHAPING_UNITS_BITS   2
 
#define SIM_CONTROL_SHAPING_UNITS_SINGLE   0
 
#define SIM_CONTROL_SHAPING_UNITS_KILO   1
 
#define SIM_CONTROL_SHAPING_UNITS_MEGA   2
 
#define SIM_CONTROL_SHAPING_UNITS_GIGA   3
 
#define SIM_CONTROL_SHAPING_RATE_BITS
 
#define SIM_SHAPING_SPR_ARG(shim, type, units, rate)
 
#define SIM_TRACE_FLAG_MASK   0xFFFF
 
#define SIM_PROFILER_ENABLED_MASK   0x10000
 
#define SIM_PUTC_FLUSH_STRING   0x100
 
#define SIM_PUTC_FLUSH_BINARY   0x101
 

Detailed Description

Some low-level simulator definitions.

Definition in file sim_def.h.

Macro Definition Documentation

#define _SIM_CONTROL_OPERATOR_BITS   8

Internal: the low bits of the SIM_CONTROL_* SPR values specify the operation to perform, and the remaining bits are an operation-specific parameter (often unused).

Definition at line 30 of file sim_def.h.

#define SIM_CONTROL_ALLOW_MULTIPLE_CACHING   22

If written to SPR_SIM_CONTROL, combined with a flag (shifted by 8), indicates whether to allow data reads to remotely-cached dirty cache lines to be cached locally without grinder warnings or assertions (used by Linux kernel fast memcpy).

Definition at line 159 of file sim_def.h.

#define SIM_CONTROL_APPEND_MPIPE_MAGIC_BYTE   35

If written to SPR_SIM_CONTROL, combined with a mPIPE shim number (shifted by 8) and a byte of data (shifted by 16), appends that byte to the shim's pending magic data section. The pending magic data section takes effect when the classifier blast programmer is run.

Definition at line 214 of file sim_def.h.

#define SIM_CONTROL_CHECKPOINT   3

If written to SPR_SIM_CONTROL, checkpoints the simulator.

Definition at line 47 of file sim_def.h.

#define SIM_CONTROL_CLEAR_MPIPE_MAGIC_BYTES   34

If written to SPR_SIM_CONTROL, combined with a mPIPE shim number (shifted by 8), clears the pending magic data section. The cleared pending magic data section and any subsequently appended magic bytes will only take effect when the classifier blast programmer is run.

Definition at line 206 of file sim_def.h.

#define SIM_CONTROL_COMMAND   26

If written to SPR_SIM_CONTROL, combined with character (shifted by 8), requests that a simulator command be executed. Written to once for each character in the command, plus a final NUL.

Definition at line 179 of file sim_def.h.

#define SIM_CONTROL_DISABLE_FUNCTIONAL   10

If written to SPR_SIM_CONTROL, disables chip-level functional mode.

Definition at line 74 of file sim_def.h.

#define SIM_CONTROL_DISABLE_MEM_LOGGING   24

If written to SPR_SIM_CONTROL, disables memory tracing.

Definition at line 165 of file sim_def.h.

#define SIM_CONTROL_DLCLOSE   21

If written to SPR_SIM_CONTROL, combined with a character (shifted by 8), indicates that a dll was unloaded. Written to once for each character in "ADDR", plus a final NUL, where "ADDR" is a hexadecimal load address starting with "0x".

Definition at line 151 of file sim_def.h.

#define SIM_CONTROL_DLOPEN   20

If written to SPR_SIM_CONTROL, combined with a character (shifted by 8), indicates that a dll was loaded. Written to once for each character in "ADDR:PATH", plus a final NUL, where "ADDR" is a hexadecimal load address starting with "0x", and "PATH" is the executable name.

Definition at line 143 of file sim_def.h.

#define SIM_CONTROL_DUMP   5

If written to SPR_SIM_CONTROL, combined with a mask (shifted by 8), dumps the requested items of machine state to the log.

Definition at line 59 of file sim_def.h.

#define SIM_CONTROL_ENABLE_FUNCTIONAL   9

If written to SPR_SIM_CONTROL, enables chip-level functional mode

Definition at line 71 of file sim_def.h.

#define SIM_CONTROL_ENABLE_FUNCTIONAL_BARRIER   11

If written to SPR_SIM_CONTROL, enables chip-level functional mode. All tiles must perform this write for functional mode to be enabled. Ignored in naked boot mode unless –functional is specified. WARNING: Only the hypervisor startup code should use this!

Definition at line 82 of file sim_def.h.

#define SIM_CONTROL_ENABLE_MEM_LOGGING   23

If written to SPR_SIM_CONTROL, enables memory tracing.

Definition at line 162 of file sim_def.h.

#define SIM_CONTROL_ENABLE_MPIPE_LINK_MAGIC_BYTE   36

If written to SPR_SIM_CONTROL, combined with a mPIPE shim number (shifted by 8), an enable=1/disable=0 bit (shifted by 16), and a mask of links (shifted by 32), enable or disable the corresponding mPIPE links.

Definition at line 222 of file sim_def.h.

#define SIM_CONTROL_GRINDER_CLEAR   13

If written to SPR_SIM_CONTROL, clears the –grind-coherence state for this core. This is intended to be used before a loop that will invalidate the cache by loading new data and evicting all current data. Generally speaking, this API should only be used by system code.

Definition at line 99 of file sim_def.h.

#define SIM_CONTROL_OS_EXEC   18

If written to SPR_SIM_CONTROL, combined with a character (shifted by 8), indicates that an exec syscall was just executed. Written to once for each character in the executable name, plus a final NUL.

Definition at line 127 of file sim_def.h.

#define SIM_CONTROL_OS_EXIT   16

If written to SPR_SIM_CONTROL, combined with a pid (shifted by 8), indicates that an exit syscall was just executed by the given process.

Definition at line 114 of file sim_def.h.

#define SIM_CONTROL_OS_FORK   15

If written to SPR_SIM_CONTROL, combined with a pid (shifted by 8), indicates that a fork syscall just created the given process.

Definition at line 108 of file sim_def.h.

#define SIM_CONTROL_OS_FORK_PARENT   33

If written to SPR_SIM_CONTROL, combined with a pid (shifted by 8), provides the pid that subsequent SIM_CONTROL_OS_FORK writes should use as the pid, rather than the default previous SIM_CONTROL_OS_SWITCH.

Definition at line 198 of file sim_def.h.

#define SIM_CONTROL_OS_INTERP   19

If written to SPR_SIM_CONTROL, combined with a character (shifted by 8), indicates that an interpreter (PT_INTERP) was loaded. Written to once for each character in "ADDR:PATH", plus a final NUL, where "ADDR" is a hex load address starting with "0x", and "PATH" is the executable name.

Definition at line 135 of file sim_def.h.

#define SIM_CONTROL_OS_SWITCH   17

If written to SPR_SIM_CONTROL, combined with a pid (shifted by 8), indicates that the OS just switched to the given process.

Definition at line 120 of file sim_def.h.

#define SIM_CONTROL_PANIC   27

If written to SPR_SIM_CONTROL, indicates that the simulated system is panicking, to allow debugging via –debug-on-panic.

Definition at line 185 of file sim_def.h.

#define SIM_CONTROL_PROFILER_CHIP_CLEAR   6

If written to SPR_SIM_CONTROL, clears chip-level profiling counters.

Definition at line 62 of file sim_def.h.

#define SIM_CONTROL_PROFILER_CHIP_DISABLE   7

If written to SPR_SIM_CONTROL, disables chip-level profiling.

Definition at line 65 of file sim_def.h.

#define SIM_CONTROL_PROFILER_CHIP_ENABLE   8

If written to SPR_SIM_CONTROL, enables chip-level profiling.

Definition at line 68 of file sim_def.h.

#define SIM_CONTROL_PROFILER_CLEAR   2

If written to SPR_SIM_CONTROL, clears profiling counters.

Definition at line 44 of file sim_def.h.

#define SIM_CONTROL_PROFILER_DISABLE   0

If written to SPR_SIM_CONTROL, stops profiling.

Definition at line 38 of file sim_def.h.

#define SIM_CONTROL_PROFILER_ENABLE   1

If written to SPR_SIM_CONTROL, starts profiling.

Definition at line 41 of file sim_def.h.

#define SIM_CONTROL_PUTC   12

If written to SPR_SIM_CONTROL, combined with a character (shifted by 8), writes a string directly to the simulator output. Written to once for each character in the string, plus a final NUL. Instead of NUL, you can also use "SIM_PUTC_FLUSH_STRING" or "SIM_PUTC_FLUSH_BINARY".

Definition at line 91 of file sim_def.h.

#define SIM_CONTROL_SET_TRACING   4

If written to SPR_SIM_CONTROL, combined with a mask (shifted by 8), sets the tracing mask to the given mask. See "sim_set_tracing()".

Definition at line 53 of file sim_def.h.

#define SIM_CONTROL_SHAPING   25

If written to SPR_SIM_CONTROL, changes the shaping parameters of one of the gbe or xgbe shims. Must specify the shim id, the type, the units, and the rate, as defined in SIM_SHAPING_SPR_ARG.

Definition at line 172 of file sim_def.h.

#define SIM_CONTROL_SHAPING_RATE_BITS
Value:
SIM_CONTROL_SHAPING_SHIM_ID_BITS + \
SIM_CONTROL_SHAPING_TYPE_BITS + \
SIM_CONTROL_SHAPING_UNITS_BITS))

How many bits are available for the rate.

Definition at line 455 of file sim_def.h.

#define SIM_CONTROL_SHAPING_SHIM_ID_BITS   3

The number of bits used to store the shim id.

Definition at line 400 of file sim_def.h.

#define SIM_CONTROL_SHUTDOWN   14

If written to SPR_SIM_CONTROL, shuts down the simulator.

Definition at line 102 of file sim_def.h.

#define SIM_CONTROL_SYSCALL   32

If written to SPR_SIM_CONTROL, triggers a simulator syscall. See "sim_syscall()" for more info.

Definition at line 191 of file sim_def.h.

#define SIM_DUMP_SPR_ARG (   mask)    (SIM_CONTROL_DUMP | ((mask) << _SIM_CONTROL_OPERATOR_BITS))

Computes the value to write to SPR_SIM_CONTROL to dump machine state.

Definition at line 349 of file sim_def.h.

#define SIM_PROFILER_CHIP_CLEAR_SPR_ARG (   mask)    (SIM_CONTROL_PROFILER_CHIP_CLEAR | ((mask) << _SIM_CONTROL_OPERATOR_BITS))

Computes the value to write to SPR_SIM_CONTROL to clear chip statistics.

Definition at line 384 of file sim_def.h.

#define SIM_PROFILER_CHIP_DISABLE_SPR_ARG (   mask)    (SIM_CONTROL_PROFILER_CHIP_DISABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))

Computes the value to write to SPR_SIM_CONTROL to disable chip statistics.

Definition at line 388 of file sim_def.h.

#define SIM_PROFILER_CHIP_ENABLE_SPR_ARG (   mask)    (SIM_CONTROL_PROFILER_CHIP_ENABLE | ((mask) << _SIM_CONTROL_OPERATOR_BITS))

Computes the value to write to SPR_SIM_CONTROL to enable chip statistics.

Definition at line 392 of file sim_def.h.

#define SIM_PROFILER_ENABLED_MASK   0x10000

When reading SPR_SIM_CONTROL, the mask for whether profiling is enabled.

Definition at line 485 of file sim_def.h.

#define SIM_PUTC_FLUSH_BINARY   0x101

Flag value for forcing a PUTC binary-data-flush, which skips the prefix and does not append a newline.

Definition at line 502 of file sim_def.h.

#define SIM_PUTC_FLUSH_STRING   0x100

Flag value for forcing a PUTC string-flush, including coordinate/cycle prefix and newline.

Definition at line 496 of file sim_def.h.

#define SIM_SHAPING_SPR_ARG (   shim,
  type,
  units,
  rate 
)
Value:
((shim) | \
SIM_CONTROL_SHAPING_TYPE_BITS + \
SIM_CONTROL_SHAPING_UNITS_BITS))) << _SIM_CONTROL_OPERATOR_BITS)

Computes the value to write to SPR_SIM_CONTROL to change a bitrate.

Definition at line 462 of file sim_def.h.

#define SIM_SYSCALL_ADD_WATCHPOINT   2

Syscall number for sim_add_watchpoint().

Definition at line 230 of file sim_def.h.

#define SIM_SYSCALL_QUERY_CPU_SPEED   6

Syscall number for sim_query_cpu_speed().

Definition at line 247 of file sim_def.h.

#define SIM_SYSCALL_QUERY_WATCHPOINT   4

Syscall number for sim_query_watchpoint().

Definition at line 236 of file sim_def.h.

#define SIM_SYSCALL_REMOVE_WATCHPOINT   3

Syscall number for sim_remove_watchpoint().

Definition at line 233 of file sim_def.h.

#define SIM_SYSCALL_VALIDATE_LINES_EVICTED   5

Syscall number that asserts that the cache lines whose 64-bit PA is passed as the second argument to sim_syscall(), and over a range passed as the third argument, are no longer in cache. The simulator raises an error if this is not the case.

Definition at line 244 of file sim_def.h.

#define SIM_TRACE_FLAG_MASK   0xFFFF

When reading SPR_SIM_CONTROL, the mask of simulator tracing bits (SIM_TRACE_xxx values).

Definition at line 482 of file sim_def.h.

#define SIM_TRACE_SPR_ARG (   mask)    (SIM_CONTROL_SET_TRACING | ((mask) << _SIM_CONTROL_OPERATOR_BITS))

Computes the value to write to SPR_SIM_CONTROL to set tracing flags.

Definition at line 293 of file sim_def.h.