Chapter 8
AutoCode Sim Cdelay Scheduler
8-14
ni.com
for tsk <- low_prio_tsk..high_prio_tsk do {
/* loop from low to high priority */
if tsk.ready_to_post_outputs()
if tsk.prio() > reg_prio /* higher priorities are larger */
write_register(tsk.output()); /*write to datastore register*/
In the generated code, the priorities of all DataStore registers in Alpha are
stored in a single, file-scoped array called
DSTORE_GUARD
, which is
optimized away if Alpha is empty.
Using the Sim Cdelay Scheduler
With the new template in place, the choice of scheduler can be made easily
at AutoCode run time by use of a new command-line option. Given a
current version of AutoCode and the new template, using it without any
new command options generates code with the default scheduler algorithm.
Using it with a
-sched 1
option, however, switches in the new scheduler.
Issuing the command:
% autostar -l c -sched 1 trig_model.rtf
should, for example, generate code in
trig_model.c
employing the new
scheduler. Under the Sim with Cdelay scheduler, the model of Figure 8-1,
behaves as shown in Figure 8-8. The latency of the triggered and enabled
SuperBlocks has been reduced to a single scheduler tick.