CLA Task Manager
Create and manage task executions in Control Law Accelerator (CLA) model
SoC Blockset Support Package for Texas Instruments C2000 Processors
The CLA Task Manager block simulates the execution of software tasks as they would be expected to behave on a CLA processor. Using this block, you can add and remove event-driven tasks from your model. Tasks can be represented as function-call subsystems contained inside a single Model block. The CLA Task Manager block executes individual tasks based on their parameters. Task parameters include duration, trigger, and priority
The CLA Task Manager block cannot be used in a referenced model. For more information on referenced models, see the Model block.
The CLA Task Manager block provides three methods to specify the duration of a task in simulation:
A probability model of task duration defined in the block mask.
A data file recording of either a previous task simulation or from a task on an SoC device.
Input ports, which you can connect to more dynamic models of task duration.
A model containing a CLA Task Manager blocks does not support simulation stepping. For more information on simulation stepping, see Simulation Stepper.
— Function-call from Task1
A function-call signal that can trigger event-driven tasks. The CLA Model block represents these tasks as function-call subsystems.
To show the function-call port from an event-driven subsystem contained in a Function-Call Subsystem block on the Model block, include an Inport in the processor Model block connected to the function-call trigger port of the subsystem. In the Inport, select Block Parameters > Signal Attributes > Output function call.
Task1 port must be connected to a function-call port on
a Model block.
To create or remove a control signal port for a task, add or remove the task from the CLA Task Manager block by clicking the Add or Delete buttons in the block dialog mask.
— Message event notification
A message port that triggers the associated event-driven task. The
Task1Event port receives the message from a SW Trigger
CPU<->CLA, PWM Interface,
or ADC Interface
block. For more information on messages, see Messages.
To show a
port, set the
Type parameter of
— Task duration
A positive-value signal that specifies the execution duration of a task at the present time. For more information on specifying task duration, see Task Duration.
To enable this port, set the Specify task duration via
Enable task simulation — Option to enable simulation of task duration
on (default) |
Enable or disable the simulation of task duration. If you clear this parameter, tasks simulate using a function-call generator. Event-driven tasks inherit their period from the fundamental sampling time of the model. Timer-driven tasks inherit their period from the block dialog mask.
List of tasks — List of tasks
List of the tasks generated by the CLA Task Manager block. Each task has a set of parameters listed in the Main and Simulation tabs of the block dialog mask.
Add — Option to add task
Add a task to the CLA Task Manager block. During deployment, the generated code encapsulates each task as an interrupt. The Main parameters for each task define the properties of its interrupt. During simulation, the task uses a combination of the Main and Simulation parameters for that task.
Delete — Option to delete existing task
Remove a task from the Task Manager.
To enable this parameter, specify at least two tasks.
Name — Name of task
Task1 (default) | character vector
Unique name of the task. The task name must contain only alphanumeric characters and underscores.
Priority — Priority of task in scheduler
10 (default) | integer in the range [1, 99]
Specify the scheduler's priority for the event-driven task as an integer in the range [1, 99]. Higher-priority tasks can preempt lower-priority tasks. The hardware attributes limit the task priority range. For more information on task priority, see Task Priority and Preemption.
To enable this parameter, set
Specify task duration via — Source of task execution time
Dialog (default) |
Input port |
Record task execution statistics
Specify the source of timing information for task execution as one of these options.
Dialog— Use a normally-distributed probabilistic model with Mean, Deviation, Min, and Max defined in the block dialog mask.
Input port— The block input port dynamically defines the execution duration.
Record task execution statistics— Use a normally-distributed probabilistic model with mean and deviation defined in the file specified by File name.
For more information on configuring task duration, see Task Duration.
Add — Option to add distribution
Adds a distribution to the set of normal distributions that generates an execution duration. For more information on configuring task duration, see Task Duration.
Only a maximum five distributions can be assigned to a single task.
Delete — Option to remove distribution
Remove a distribution from the set of normal distributions.
Percent — Likelihood of distribution
100 (default) | positive scalar
Specify the likelihood of each normal distribution. The Percent weighted sum of normal distributions determines the task duration likelihood. For more information on configuring task duration, see Task Duration.
The sum of Percent for all the distributions in a single task must equal 100.
Mean — Mean task duration in simulation
1e-06 (default) | positive scalar
Specify the mean task duration during simulation of the task. The simulated task duration uses a normal distribution with specified Mean and SD parameter values as a first-order approximation of the task behavior. For more information on configuring task duration, see Task Duration.
SD — Standard deviation of task duration in simulation
0 (default) | positive scalar
Specify the standard deviation task duration during simulation of the task. The simulated task duration uses a normal distribution with specified Mean and SD as a first-order approximation of the task behavior. For more information on configuring task duration, see Task Duration.
Min — Lower limit of task duration
1e-06 (default) | positive scalar
Lower limit of a task duration distribution. For more information on configuring task duration, see Task Duration.
Max — Upper limit of task duration
1e-06 (default) | positive scalar
Upper limit of a task duration distribution. For more information on configuring task duration, see Task Duration.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
The tasks in the CLA Task Manager block execute as interrupts in the generated code. The task parameters in the CLA Task Manager block specify the priority of the interrupt.