#include <stdint.h>
#include "temu-c/Support/Attributes.h"
Go to the source code of this file.
◆ temu_ExecutionState
◆ temu_Object
◆ temu_TimeSource
◆ temu_ExecutionState
Enumerator |
---|
teES_Stopped | |
teES_Running | |
teES_Stepping | |
◆ 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()
Get the current execution status of TEMU
- Returns
- Current execution status
◆ temu_getScheduledProcessor()
Get processor in global scheduler
- Parameters
-
cpu | Processor number to get |
- Returns
- Processor pointer as a time source.
◆ temu_getScheduledProcessorCount()
TEMU_API unsigned temu_getScheduledProcessorCount |
( |
| ) |
|
Get the number of processors in the global scheduler.
- Returns
- Number of processors in global scheduler.
◆ temu_run()
Run the current scheduler forever
◆ temu_runForSteps()
TEMU_API void temu_runForSteps |
( |
int64_t |
steps | ) |
|
Run the current scheduler for a fixed number of steps
- Parameters
-
steps | Time in steps (in scheduler units). |
◆ temu_runForTime()
TEMU_API void temu_runForTime |
( |
double |
secs | ) |
|
Run the current scheduler for a fixed time
- Parameters
-
secs | Time in simulated seconds |
◆ temu_schedulerGetAccumulatedTime()
TEMU_API uint64_t temu_schedulerGetAccumulatedTime |
( |
| ) |
|
Experimental function to get the accumulated nanoseconds for the scheduler.
To enable sampling the Scheduler-object's measureTime
property must be set.
- Returns
- Accumulated nanoseconds of which temu_run* functions have run.
◆ temu_schedulerGetAffinity()
TEMU_API int64_t temu_schedulerGetAffinity |
( |
unsigned |
threadId | ) |
|
Experimental function to get the thread affinity for the scheduler.
- Parameters
-
threadId | Thread ID starting with 0 to the number of threads set for the scheduler. |
- Returns
- Affinity value, -1 implies not set. Other values indicate HOST CPUID.
◆ temu_schedulerGetSyncTime()
TEMU_API uint64_t temu_schedulerGetSyncTime |
( |
unsigned |
threadId | ) |
|
Experimental function to get the accumulated nanoseconds for the scheduler synchronization.
To enable sampling, the Scheduler-object's measureTime
property must be set.
- Returns
- Accumulated nanoseconds of which synchronisation code was run.
◆ temu_schedulerGetWaitTime()
TEMU_API uint64_t temu_schedulerGetWaitTime |
( |
unsigned |
threadId | ) |
|
Experimental function to get the accumulated nanoseconds for the scheduler barrier waits.
The wait time, includes both the actual barrier and the synchronization time.
So the true wait time is the wait - sync time.
To enable sampling, the Scheduler-object's measureTime
property must be set.
- Returns
- Accumulated nanoseconds of which the wait was run.
◆ temu_schedulerSetAffinity()
TEMU_API void temu_schedulerSetAffinity |
( |
unsigned |
threadId, |
|
|
int |
hostCore |
|
) |
| |
Experimental function to set thread affinity for the scheduler.
The function should be called before setting the number of threads, as threads automatically set the affinity if the hostCore is zero or above.
- Parameters
-
threadId | Thread ID starting with 0 to the number of threads set for the scheduler. |
hostCore | Host core id to bind thread to. Negative to not set affintity. |
◆ temu_serializeOnNotification()
TEMU_API void temu_serializeOnNotification |
( |
temu_Object * |
notificationSource, |
|
|
const char * |
notificationName, |
|
|
double |
seconds |
|
) |
| |
Serialize execution for some time when notification is triggered
- Parameters
-
notificationSource | Object emitting notification. |
notificationName | Name of notification to intercept. |
seconds | Number of seconds (simulated time, for which to serialize execution). |
◆ temu_step()
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
-
cpu | The processor to step |
steps | The number of steps or instructions to execute |
◆ temu_stop()
Stop the current scheduler
The function signals the scheduler to stop, and then waits until the scheduler is in the stopped state.