Multi-tasking Implementation of Multi-rate Simulink Models in SIMulation Workbench

Background

Multirate Avionics Model

Many Simulink® models are comprised of one or more blocks or subsystems that run at different rates (sample times). For example, in a simulation of a fly-by-wire system, a GPS system may run at a rate much slower than the inertial navigation system. A Simulink® model with multiple sample times is referred to as a multi-rate Simulink model. Even though, code generation from Simulink supports single-tasking and multi-tasking modes of operation for a multi-rate model, Simulink-generated multi-tasking code stays single-threaded which limits its use of CPU resources on multi-core systems.

Until recently, commercial simulation tools could not take advantage of today's rapidly evolving multi-core processor technology and all real-time simulation tasks needed to execute on one processor core, resulting in performance limitations. Concurrent's SIMulation Workbench running on RedHawk Linux provides an ideal framework for developing and executing complex multi-rate hardware-in-the-loop and man-in-the-loop simulations on multi-core systems. The latest release of SIMulation Workbench adds multi-threading support for multi-rate, multi-tasking Simulink models. SIMulation Workbench automatically configures the different rates in a Simulink model to execute as separate threads (tasks) on the real-time host. SIMulation Workbench honors the task priorities set by Simulink with faster rates having higher priorities. Thus, on a multi-core system, different rates in the Simulink model execute as different threads and may execute concurrently on different cores in the system. With SIMulation Workbench's, RT Viewer Tool, users can not only visualize the models task execution time (MTET), but also change the CPU affinity of the different threads to achieve CPU load balancing during runtime

SIMulation Workbench maximizes run-time performance by allowing target tasks to be assigned to and shielded on any core in a multi-core system. SIMulation Workbench takes full advantage of RedHawk's ability to support today's large multi-core, multi-socket COTS platforms and provides the industry's best real-time performance. RedHawk provides a guaranteed real-time response of less than 15 microseconds on systems with 80 or more cores.

Configuring Multirate Models for Multitasking

  1. Open the "Configuration Parameters" pane for your model by selecting "Configuration Parameters" option in the "Simulation" menu.
  2. Change the "Tasking mode for periodic sample times" to "MultiTasking".