Scheduler Editor
The Scheduler Editor provides an interface to help you set timing information on Synchronous Nodes, and change the initialization order of those nodes.
The scheduler always drives execution. Waveforms are created and represent the scheduling in time of the nodes OnTick
event in the graph. The represented timeline in the scheduler is based on a user-defined unit of time: seconds, milliseconds, microseconds, or nanoseconds. The scheduler also defines the order of execution and represents the sequence of events of your system.
Features
Clock source
The scheduler attaches to a clock source at runtime. This clock source is the time base used to schedule nodes. It can be a rate slower or faster than the frequencies set in the Scheduler Editor.
Frames
The scheduler takes care of scheduling tasks determined by the clock source by batching calls between the clock source updates, which SystemGraph calls a frame. Frequencies set on synchronous nodes average to the proper rate set in the editor. The scheduler mechanism manages the deterministic order of waveforms accordingly.
Prescaler
The Scheduler Editor also has a prescaler setting that acts as a divisor of frequencies for nodes in the scheduler. It's useful when creating digital twins and setting frequencies to real-world parameters, since emulation performance is dependent on the frequency of execution of nodes, it's preferable to divide the rate of execution to achieve real-time performance. In cases where the divider is bigger than 1
, the nodes have to handle execution in batch for every OnTick
, relative to the divider value. For example, if you have a counter running at 1 MHz
and apply a divider of 10
, your node would need to add 10
to the value of the counter for every OnTick
call.
When a prescaler value other than 1
is set, the frequencies shown in the scheduler represent the divided frequencies, which are displayed between parenthesis on each scheduler row. These values are the actual rate used at runtime.
You can select the clock source Scheduler Editor toolbar. You can also set the time unit displayed.
Scheduler Editor Row
Each row in the editor displays the following:
- The frequency of that node.
- The time offset of the node relative to other nodes.
To edit the configuration of a node, double-click the row name to open the configuration menu.
Change the timing configuration of a Synchronous node
To change the timing, double-click the row title to open the waveform toolbar. In this toolbar, you can do the following:
- Set the frequency of the node.
- Select the time offset to apply.
- Bind the frequency directly to the clock source.
Binding the frequency to the clock source will call the OnTick
callback of your node at the same frequency that the clock source uses. Even if the frequency changes in time, it's a 1:1 relationship with the clock source.
Change the callback order of a Synchronous node
To change the node order in the Scheduler Editor, use the up or down arrows. The node order determines which node initializes first. The Enable
callback is called in the order displayed in the scheduler. Asynchronous nodes don't have an order of initialization, so they're non-deterministic in their initialization order.