TEMU  4.0
The Terma Emulator
Scheduler.h File Reference
#include <stdint.h>
Include dependency graph for Scheduler.h:

Go to the source code of this file.

Typedefs

typedef struct temu_TimeSource temu_TimeSource
 
typedef enum temu_ExecutionState temu_ExecutionState
 

Enumerations

enum  temu_ExecutionState { teES_Stopped, teES_Running, teES_Stepping }
 

Functions

void temu_runForSteps (int64_t steps)
 
void temu_runForTime (double secs)
 
void temu_run ()
 
void temu_step (temu_TimeSource *cpu, int steps)
 
void temu_stop ()
 
void temu_asyncStop ()
 
temu_ExecutionState temu_getExecutionState ()
 

Typedef Documentation

◆ temu_ExecutionState

◆ temu_TimeSource

Enumeration Type Documentation

◆ temu_ExecutionState

Enumerator
teES_Stopped 
teES_Running 
teES_Stepping 

Function Documentation

◆ temu_asyncStop()

void temu_asyncStop ( )

Stop the current scheduler

The function returns immediately, before the scheduler has stopped. The function is suitable for use in e.g. signal handlers.

◆ temu_getExecutionState()

temu_ExecutionState temu_getExecutionState ( )

Get the current execution status of TEMU

Returns
Current execution status

◆ temu_run()

void temu_run ( )

Run the current scheduler forever

◆ temu_runForSteps()

void temu_runForSteps ( int64_t  steps)

Run the current scheduler for a fixed number of steps

Parameters
stepsTime in steps

◆ temu_runForTime()

void temu_runForTime ( double  secs)

Run the current scheduler for a fixed time

Parameters
secsTime in simulated seconds

◆ temu_step()

void temu_step ( temu_TimeSource cpu,
int  steps 
)

Step a processor in the current scheduler

Note that, the other processors may run if the step exceeds the quanta. The step function currently runs processors in sequence, it is not running processors in parallel. This means that stepping is always deterministic.

Parameters
cpuThe processor to step
stepsThe number of steps or instructions to execute

◆ temu_stop()

void temu_stop ( )

Stop the current scheduler

The function signals the scheduler to stop, and then waits until the scheduler is in the stopped state.