|
void(* | reset )(void *Cpu, int ResetType) |
|
temu_CpuExitReason(* | run )(void *Cpu, uint64_t Cycles) |
|
temu_CpuExitReason(* | runUntil )(void *Cpu, uint64_t Cycles) |
|
temu_CpuExitReason(* | step )(void *Cpu, uint64_t Steps) |
|
temu_CpuExitReason(* | stepUntil )(void *Cpu, uint64_t Steps, uint64_t Cycles) |
|
void int | Trap |
|
void(* | enterIdleMode )(void *Obj) |
|
void temu_CpuExitReason | Reason |
|
uint64_t(* | getFreq )(void *Cpu) |
|
int64_t(* | getCycles )(void *Cpu) |
|
int64_t(* | getSteps )(void *Cpu) |
|
temu_CpuState(* | getState )(void *Cpu) |
|
void(* | setPc )(void *Cpu, uint64_t Pc) |
|
uint64_t(* | getPc )(void *Cpu) |
|
void(* | setGpr )(void *Cpu, int Reg, uint64_t Value) |
|
uint64_t(* | getGpr )(void *Cpu, unsigned Reg) |
|
void(* | setFpr32 )(void *Cpu, unsigned Reg, uint32_t Value) |
|
uint32_t(* | getFpr32 )(void *Cpu, unsigned Reg) |
|
void(* | setFpr64 )(void *Cpu, unsigned Reg, uint64_t Value) |
|
uint64_t(* | getFpr64 )(void *Cpu, unsigned Reg) |
|
void(* | setSpr )(void *Cpu, unsigned Reg, uint64_t Value) |
|
uint64_t(* | getSpr )(void *Cpu, unsigned Reg) |
|
int(* | getRegId )(void *Cpu, const char *RegName) |
|
const char *(* | getRegName )(void *Cpu, int RegId) |
|
uint32_t(* | assemble )(void *Cpu, const char *AsmStr) |
|
char *(* | disassemble )(void *Cpu, uint32_t Instr) |
|
void(* | enableTraps )(void *Cpu) |
|
void(* | disableTraps )(void *Cpu) |
|
void(* | invalidateAtc )(void *Obj, uint64_t Addr, uint64_t Pages, uint32_t Flags) |
|
uint64_t(* | translateAddress )(void *Cpu, uint64_t Va, uint32_t *Flags) |
|
temu_PowerState(* | getPowerState )(void *Cpu) |
|
void(* | setPowerState )(void *Cpu, temu_PowerState Ps) |
|
void(* | enableTrapEvents )(void *Cpu) |
|
void(* | disableTrapEvents )(void *Cpu) |
|
void(* | enableErrorModeEvents )(void *Cpu) |
|
void(* | disableErrorModeEvents )(void *Cpu) |
|
void *(* | getMachine )(void *Cpu) |
|
void(* | raiseTrapNoJmp )(void *Cpu, int Trap) |
|
const char *(* | getTrapName )(void *Cpu, int Trap) |
|
const temu_CpuInfo *(* | getCPUInfo )(void *Cpu) |
|
int(* | wakeUp )(void *Cpu) |
|
void(* | forceEarlyExit )(void *Cpu) |
|
void *(* | translateIRAddress )(void *Obj, uint64_t Va) |
|
void(* | enableModeSwitchEvents )(void *Obj) |
|
void(* | disableModeSwitchEvents )(void *Obj) |
|
void(* | enableProfiling )(void *Obj) |
|
void(* | disableProfiling )(void *Obj) |
|
void(* | flushProfileCaches )(void *Obj) |
|
int64_t(* | getIdleSteps )(void *Cpu) |
|
int64_t(* | getIdleCycles )(void *Cpu) |
|
void(* | enterHaltedMode )(void *Obj) |
|
void(* | forceSpecificExit )(void *Cpu, temu_CpuExitReason reason) |
|
void(* | purgeDirtyPages )(void *Obj) |
|
void(* | invalidateFetchAtc )(void *Obj) |
|
int(* | translateAddressWithRoot )(void *Cpu, uint64_t Va, uint32_t *Flags, uint64_t RootPointer, uint64_t *PA) |
|
temu_CpuExitReason(* | synchronizingRun )(void *Obj, uint64_t Cycles) |
|
temu_CpuExitReason(* | synchronizingRunUntil )(void *Obj, uint64_t Cycles) |
|
temu_CpuExitReason(* | synchronizingStep )(void *Obj, uint64_t Steps) |
|
temu_CpuExitReason(* | synchronizingStepUntil )(void *Obj, uint64_t Steps, uint64_t Cycles) |
|
Common CPU interface.
The CPU interface provides common functionality that all processors must implement. This includes the reset and run methods. But also different register access functions. The register access functions are functions, because registers may be banked and we want some type of common interface that can access the current registers. Note that the interface currently only support 32 bit processors.
- Warning
- Some functions will not return and execute longjmps to the emulation loop instead. These functions should NOT be called from any C++ code that needs destructors to be called on exit or from any events handlers.
\field reset The function executing a reset. It takes as parameter the reset type, which is 0 for a default cold reset.
\field run Run the main emulator loop for a given number of cycles.
\field runUntil Run the main emulator loop until its cycle counter reach the end cycles.
\field step Run the given number of steps. A step is one instruction, completed or not. E.g. a trapping instruction does not complete but is counted as a step.
\field stepUntil Step the emulator, but stop if the step exceeds a certain fixed time.
\field raiseTrap Raises a trap on the CPU. THIS FUNCTION DOES NOT RETURN!!!
- Warning
- The raiseTrap function will normally be constructed using longjmp, that implies that you should not call this from a model which must properly unwind the stack and call destructors on the way.
\field enterIdleMode Will call longjmp and enter idle mode immediately, this is useful for devices that activates power down mode.
- Warning
- This function does not return and destructors will not be called when the stack is unwound.
\field exitEmuCore Will call longjmp to exit the emulator core. This can be used in certain cases where the other exit functions do not suite well. One being that a reset is called from an MMIO write or read, or from a watchdog event. The reset can otherwise be called when the emulator is not running, so in a model you can call reset and then exitEmuCore.
\field getGpr Read the currently visible general purpose registers. For banked registers (e.g. SPARC reg windows), you should look at the arch specific interface instead.
\field getFpr32 Read the currently visible floating point registers.
\field setSpr Set special purpose registers. The indexes have been explicitly choosen to be equal to what is assumed by the GDB protocol, but re-based at zero.
\field getSpr Read special purpose registers. The indexes have been explicitly choosen to be equal to what is assumed by GDB but rebased at zero.
\field disassemble This function will disassemble an instruction. The function returns a heap-allocated string (allocated with malloc()). The caller is responsible for calling free() and managing the lifetime.
\field invalidateAtc Invalidates the ATC cache for the given address range. Flags can be set to control the invalidation. Bit 0: don't invalidate fetch. Bit 1: don't Invalidate read, bit 2: don't invalidate write, bit 3 don't invalidate user, bit 4 don't invalidate super.
\field translateAddress Does a table walk and translates the virtual address to physical page address. For MMU free systems, the function returns the Va masked with ~(page size-1). Otherwise, the return is the translated page address and in the case of failure -1.
\field raiseTrapNoJmp Raises a trap without longjmp to emulator core main loop. This can be used in e.g. timed event handlers and when the core isn't running.