This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Code Generation of Software Tasks

A Simulink® model containing a Task Manager block simulates task execution. When a model gets deployed to an SoC hardware board, the SoC Blockset™ automatically creates and assigns the tasks to threads, links interrupts, messages, and system events to the generated code of the model.

Timer-Driven Tasks

An SoC Blockset model, when implemented onto hardware as generated and compiled code, uses an operating system (OS) timer to drive the base-rate time step of the model. All time based signals derive their time steps, known as sub-rates, from the base-rate time step of the model. A timer-driven task, created from the Task Manager block, uses a counter that increments at each base-rate timer step. When the counter reaches the integer multiple of the base-rate that defines the rate of the task, the task is triggered by posting to a semaphore associated with that task launches the thread.

Event-Driven Task

Each event-driven task created from the Task Manager block gets a unique semaphore. A unique event elsewhere in the system posts to that semaphore and puts the task thread into the running state. OS kernel handles the management of the task thread until it returns to the waiting state.

See Also

|

Related Topics