#include <stdint.h>
Go to the source code of this file.
Typedefs | |
typedef void(* | temu_SparcAsrHandler )(void *Cpu, uint32_t Instr) |
Functions | |
uint64_t | temu_cpuGetFreq (void *Cpu) |
Get the clock frequency for the CPU. | |
void | temu_cpuSetPc (void *Cpu, uint64_t Pc) |
Set the program counter. | |
uint64_t | temu_cpuGetPc (void *Cpu) |
Get the program counter. | |
void | temu_cpuReset (void *Cpu, int ResetType) |
Reset the processor. | |
uint64_t | temu_cpuRun (void *Cpu, uint64_t Cycles) |
Run the processor for a number of cycles. | |
uint64_t | temu_cpuStep (void *Cpu, uint64_t Steps) |
Run the processor for a number of steps. | |
uint64_t | temu_cpuGetReg (void *Cpu, unsigned Reg) |
void | temu_cpuSetReg (void *Cpu, unsigned Reg, uint64_t Value) |
float | temu_cpuGetFpr32 (void *Cpu, unsigned Reg) |
uint32_t | temu_cpuGetFpr32Bits (void *Cpu, unsigned Reg) |
void | temu_cpuSetFpr32 (void *Cpu, unsigned Reg, float Value) |
void | temu_cpuSetFpr32Bits (void *Cpu, unsigned Reg, uint32_t Value) |
double | temu_cpuGetFpr64 (void *Cpu, unsigned Reg) |
uint64_t | temu_cpuGetFpr64Bits (void *Cpu, unsigned Reg) |
void | temu_cpuSetFpr64 (void *Cpu, unsigned Reg, double Value) |
void | temu_cpuSetFpr64Bits (void *Cpu, unsigned Reg, uint64_t Value) |
void | temu_cpuEnableTraps (void *Cpu) |
void | temu_cpuDisableTraps (void *Cpu) |
int | temu_sparcGetWindowCount (void *Cpu) |
uint32_t | temu_sparcGetWindowedReg (void *Cpu, int Window, unsigned Reg) |
void | temu_sparcSetWindowedReg (void *Cpu, int Window, unsigned Reg, uint32_t Value) |
void | temu_sparcSetY (void *Cpu, uint64_t Value) |
uint64_t | temu_sparcGetY (void *Cpu) |
void | temu_sparcSetAsr (void *Cpu, unsigned Reg, uint64_t Value) |
uint64_t | temu_sparcGetAsr (void *Cpu, unsigned Reg) |
void | temu_sparcSetAsrWriter (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler) |
void | temu_sparcSetAsrReader (void *Cpu, unsigned Asr, temu_SparcAsrHandler Handler) |
void | temu_sparcSetPsr (void *Cpu, uint32_t Value) |
uint32_t | temu_sparcGetPsr (void *Cpu) |
void | temu_sparcSetTbr (void *Cpu, uint32_t Value) |
uint32_t | temu_sparcGetTbr (void *Cpu) |
void | temu_sparcSetWim (void *Cpu, uint32_t Value) |
uint32_t | temu_sparcGetWim (void *Cpu) |
void | temu_sparcSetNPc (void *Cpu, uint32_t Value) |
uint32_t | temu_sparcGetNPc (void *Cpu) |
typedef void(* temu_SparcAsrHandler)(void *Cpu, uint32_t Instr) |
void temu_cpuDisableTraps | ( | void * | Cpu | ) |
void temu_cpuEnableTraps | ( | void * | Cpu | ) |
float temu_cpuGetFpr32 | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
uint32_t temu_cpuGetFpr32Bits | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
double temu_cpuGetFpr64 | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
uint64_t temu_cpuGetFpr64Bits | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
uint64_t temu_cpuGetFreq | ( | void * | Cpu | ) |
Get the clock frequency for the CPU.
Cpu | The CPU object |
uint64_t temu_cpuGetPc | ( | void * | Cpu | ) |
Get the program counter.
The program counter will be returned.
Cpu | The CPU object |
uint64_t temu_cpuGetReg | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
void temu_cpuReset | ( | void * | Cpu, | |
int | ResetType | |||
) |
Reset the processor.
Resetting the CPU will result in a reset cascade where all connected devices are also reset.
Cpu | The CPU object | |
ResetType | The type of reset, by convention 0 means cold reset, and 1 indicates a warm reset. |
uint64_t temu_cpuRun | ( | void * | Cpu, | |
uint64_t | Cycles | |||
) |
Run the processor for a number of cycles.
The function runs the processor for a number of cycles. If you wish to run the processor with another time unit, you can compute the cycles from the clock frequency of the emulated processor.
In case the processor halts or enters idle mode and there are no pending events the function will return early.
Cpu | The CPU object | |
Cycles | The number of cycles to run the processor for. |
void temu_cpuSetFpr32 | ( | void * | Cpu, | |
unsigned | Reg, | |||
float | Value | |||
) |
void temu_cpuSetFpr32Bits | ( | void * | Cpu, | |
unsigned | Reg, | |||
uint32_t | Value | |||
) |
void temu_cpuSetFpr64 | ( | void * | Cpu, | |
unsigned | Reg, | |||
double | Value | |||
) |
void temu_cpuSetFpr64Bits | ( | void * | Cpu, | |
unsigned | Reg, | |||
uint64_t | Value | |||
) |
void temu_cpuSetPc | ( | void * | Cpu, | |
uint64_t | Pc | |||
) |
Set the program counter.
The program counter will be set to the supplied value.
Cpu | The CPU object | |
Pc | The program counter. |
void temu_cpuSetReg | ( | void * | Cpu, | |
unsigned | Reg, | |||
uint64_t | Value | |||
) |
uint64_t temu_cpuStep | ( | void * | Cpu, | |
uint64_t | Steps | |||
) |
Run the processor for a number of steps.
This function is different from temu_cpuRun, which runs for a time. The steps here indicates instructions executed (including trapping instructions). This can be contrasted to the run function which may advance the cycle counter by more than one for an instruction (depending on the timing models).
The function may return early in case the processor halts its execution or has entered idle mode and there are no events pending.
Cpu | The CPU object | |
Steps | The number of steps to run the processor for. |
uint64_t temu_sparcGetAsr | ( | void * | Cpu, | |
unsigned | Reg | |||
) |
uint32_t temu_sparcGetNPc | ( | void * | Cpu | ) |
uint32_t temu_sparcGetPsr | ( | void * | Cpu | ) |
uint32_t temu_sparcGetTbr | ( | void * | Cpu | ) |
uint32_t temu_sparcGetWim | ( | void * | Cpu | ) |
int temu_sparcGetWindowCount | ( | void * | Cpu | ) |
uint32_t temu_sparcGetWindowedReg | ( | void * | Cpu, | |
int | Window, | |||
unsigned | Reg | |||
) |
uint64_t temu_sparcGetY | ( | void * | Cpu | ) |
void temu_sparcSetAsr | ( | void * | Cpu, | |
unsigned | Reg, | |||
uint64_t | Value | |||
) |
void temu_sparcSetAsrReader | ( | void * | Cpu, | |
unsigned | Asr, | |||
temu_SparcAsrHandler | Handler | |||
) |
void temu_sparcSetAsrWriter | ( | void * | Cpu, | |
unsigned | Asr, | |||
temu_SparcAsrHandler | Handler | |||
) |
void temu_sparcSetNPc | ( | void * | Cpu, | |
uint32_t | Value | |||
) |
void temu_sparcSetPsr | ( | void * | Cpu, | |
uint32_t | Value | |||
) |
void temu_sparcSetTbr | ( | void * | Cpu, | |
uint32_t | Value | |||
) |
void temu_sparcSetWim | ( | void * | Cpu, | |
uint32_t | Value | |||
) |
void temu_sparcSetWindowedReg | ( | void * | Cpu, | |
int | Window, | |||
unsigned | Reg, | |||
uint32_t | Value | |||
) |
void temu_sparcSetY | ( | void * | Cpu, | |
uint64_t | Value | |||
) |