Chapter 8
AutoCode Sim Cdelay Scheduler
8-2
ni.com
real-time hardware. It assumes the reader is familiar with the concepts of
AutoCode’s default scheduler. Refer to the
AutoCode User Guide
for more
information about the scheduler, task types, and output posting.
Task Posting Policies
The task characteristics that have the most impact on scheduler design are
task type
,
and output posting policy. For real-time applications, there are
two workable, mutually exclusive posting strategies a task can adopt:
•
ANC, or At Next Computation
•
ATR, or At Timing Requirement
A task, which is ANC, is invoked, starts its computation and, after the result
has been calculated, caches it without posting. The next time that task is
invoked, the cached result is posted before the computation starts. The
important point about ANC tasks is that enabling or triggering them can
generate an immediate output, even in real-time applications, without
waiting for a computational delay.
1
Conversely, when an ATR task is
invoked, it starts its computation, caches the result, and posts it exactly
t
minimum scheduler cycles after its invocation, where
t
is the timing
requirement.
Now that the posting policies are understood, the map from task types to
posting policies can be studied. For free-running periodic tasks, you do not
even need the concept of a posting policy, because the difference between
posting at the end of one cycle and posting at the beginning of the next
(before inputs are sampled and held) is meaningless. For triggered tasks,
the posting policy is necessary and sufficient to provide a description; ANT
triggered tasks are ANC, while ATR/SAF triggered tasks are ATR. For SAF
triggered tasks, the timing requirement is assumed to be the minimum
scheduler cycle. Finally, notice that from what is stated above the output
posting policy of enabled periodic tasks is not yet determined—it can be
either ANC or ATR.
With enabled tasks, there is also a notion of the enable policy, which
determines when the task is invoked rather than when it posts its outputs.
You can demand that enabled tasks are launched only on the global timeline
major cycle points for tasks of that rate, or allow such tasks to be
immediately launched on the first scheduler minor cycle that the enable is
known to be high.
1
Later in this chapter, this will be shown to lead to the ANC Chaining Problem.