Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-12 ni.comThese transition diagrams, together with the diagrams in Chapter 4,Managing and Scheduling Applications, of the AutoCode User Guide,define the behavior of tasks under the Sim with Cdelay scheduler. Theyencompass all of the changes to the default scheduler outside the schedulerpipeline, and embody the new output posting, enable, and retriggeringpolicies. Together with the new pipeline configuration, these diagramsprovide you with enough information to completely implement the newscheduler.Implementing the Sim Cdelay AutoCode SchedulerThe new scheduler can largely be implemented as a new template. In thenew template, the large-scale layout of the scheduler is determined by thenew pipeline configuration, and the variable manipulations inside eachscheduler stage are determined by the STDs for the various task types.Implementation DetailsSome of the implementation details are as follows:• When a task attempts to write to a DataStore, the write must only beallowed to go through if no task of higher priority has written to thatsame location on the current scheduler cycle. In the default AutoCodescheduler, this is enforced by ordering the posting of outputs to postfrom least priority task first and the highest priority task last, therebyobviating the need for active checks. With the new scheduler, however,you have two separate output posting stages. As a result, it is necessaryto develop an active protection mechanism whereby the priority of awriter to a DataStore register is stored, and later used in a guard. Thiswill be discussed in depth in the DataStore Priority Problem section.• The output posting policy for all periodic tasks changes from ANC toATR in the transition to the new scheduler. Thereby, the periods ofperiodic tasks should be stored in the template parameterOUTPUTCOUNT_LI. In the default scheduler, this vector is zero exceptfor ATR triggered tasks. The timing requirements also can be obtainedfrom SCHEDULINGCOUNT_LI, as they are for the (ANC) periodic tasksin the default scheduler, but this is not good design.• Under the new scheduler, free-running periodic tasks have a blockedstate used only during start-up so they can be initialized to have timervalues of zero without causing meaningless outputs to be posted.Under the default scheduler, there is no blocked state for free-runningperiodic tasks; thus, the template parameter INITIALTASKSTATE_LSmust be altered.