4 Master Clock
The Master Clock is used to simulate hardware timing issues. In many cases, this is not needed for adequate emulation. When not needed, the master clock instance can simply return the same Time_Index at all times, and immediately Wake a component upon a Block request. In any case, components should block themselves when starting (or completing) an operation that takes a known amount of time. For instance, when a CPU executes an instruction, it should block for the amount of time that the instruction should take. Blocking is accomplished by calling the master clock's Block method. The component should cease doing any further (time-related) processing until it is woken.
TMaster_Clock has the following methods:
void Block( TComponent* Component, int64 Time_Delta )
This procedure registers a request for a component to receive a Wake signal at the specified time delta (in nanoseconds). If component is NULL, the next blocked component is unblocked.
TDebug_Interface* Debugger()
This method returns an instance of a debug interface for the clock. If the clock component doesn't support debugging, the method returns NULL.
void Initialize( TUI_Interface* )
Initializes the clock to time index 0 and sets the UI interface.
int64 Get_Time_Index()
This function returns the current simulated master clock (which is measured in nanoseconds) time index.
integer Serial_Number()
Returns the value passed at creation time (see Make_Instance).
boolean Support_Feature( integer ID )
Returns True if the clock supports the specified feature. This is reserved for future use.
integer Version()
Returns the version of the CEF specification that the object adheres to. This is the major.minor version times 10. For instance, a value of 20 indicates version 2.0.
The following methods are supported in clocks conforming to version 2.3, or later, of the specification.
void Set_Mode( int M )
Set clock mode. The value is one of the following.
Value |
Meaning |
0 |
Unblock components in order of time (Default) |
1 |
Immediately unblock calling components. |
2 |
Unblock components in order of time, but synchronize emulator time to real system time. |
int Get_Mode()
Get clock mode. The value is one of the following.
Value |
Meaning |
0 |
Unblock components in order of time (Default) |
1 |
Immediately unblock calling components. |
2 |
Unblock components in order of time, but synchronize emulator time to real system time. |
void Unblock()
Unblock all blocked components.