A TrueTime Extension for Instruction-level Timing and Multi-stack Support

This paper presents an extension to TrueTime, a widely used toolbox for co-simulation of networked real-time control systems in the block-oriented modeling and simulation environment MATLAB/Simulink. TrueTime provides an implementation of a real-time kernel as a Simulink block, which is able to execute a set of tasks and interrupt handlers under various scheduling schemes. By annotating the controller code with platform-specific timing information, it thereby allows to observe the temporal behavior and scheduling effects arising from the actual controller implementation in closed loop with the plant. This goes beyond traditional development approaches within the synchronous (reactive) block-diagram formalism of Simulink, which typically ignores execution times and jitter. However, TrueTime is said not to be suited for industrial (legacy) applications, mainly due to its structural requirements on the controller code. We propose an alternative execution mechanism that overcomes this limitation and fits with typical controller code as, for example, generated by the Simulink/Embedded Coder. Optionally, tasks may have individual execution stacks and may also execute as individual threads, even allowing for accelerated simulation on multi-core simulation hosts. Furthermore, this introduces support for instruction level timing and deeply branched function call graphs, without distorting the code structure. A case study demonstrates the applicability of our approach.

[1]  Sebastian Altmeyer,et al.  A Model-Driven Co-Design Framework for Fusing Control and Scheduling Viewpoints , 2018, Sensors.

[2]  Edsger W. Dijkstra,et al.  Letters to the editor: go to statement considered harmful , 1968, CACM.

[3]  Karl-Erik Årzén,et al.  Co-design of Control Systems and their real-time implementation - A Tool Survey , 2006 .

[4]  Alberto L. Sangiovanni-Vincentelli,et al.  Source-Level Timing Annotation and Simulation for a Heterogeneous Multiprocessor , 2008, 2008 Design, Automation and Test in Europe.

[5]  .. Farkas,et al.  SIMULATION OF NETWORKED CONTROL SYSTEMS USING TRUETIME , 2009 .

[6]  Marco Di Natale,et al.  TRES: a modular representation of schedulers, tasks, and messages to control simulations in simulink , 2015, SAC.

[7]  Marco Di Natale,et al.  A SimEvents Model for the Analysis of Scheduling and Memory Access Delays in Multicores , 2018, 2018 IEEE 13th International Symposium on Industrial Embedded Systems (SIES).

[8]  Giuseppe Massari,et al.  The Real-Time Linux Kernel , 2019, ACM Comput. Surv..

[9]  M. Abid,et al.  A SystemC/Simulink Co-Simulation Framework for Continuous/Discrete-Events Simulation , 2006, 2006 IEEE International Behavioral Modeling and Simulation Workshop.

[10]  Pieter J. Mosterman Model-Based Design of Embedded Systems , 2007, 2007 IEEE International Conference on Microelectronic Systems Education (MSE'07).

[11]  Andreas Naderlinger Simulating execution time variations in Matlab/Simulink , 2017, 2017 Winter Simulation Conference (WSC).

[12]  Edward A. Lee,et al.  Taming heterogeneity - the Ptolemy approach , 2003, Proc. IEEE.

[13]  David Broman,et al.  Co-Simulation , 2018, ACM Comput. Surv..

[14]  Craig Schaffert,et al.  Abstraction mechanisms in CLU , 1977 .

[15]  Hassan Mohammad,et al.  Poster Abstract: Towards Parallelizing Legacy Embedded Control Software Using the LET Programming Paradigm , 2016, 2016 IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS).

[16]  Joseph Y.-T. Leung,et al.  Handbook of Real-Time and Embedded Systems , 2007 .

[17]  Andreas Naderlinger,et al.  Simulating preemptive scheduling with timing-aware blocks in Simulink , 2017, Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017.

[18]  K.-E. Arzen,et al.  How does control timing affect performance? Analysis and simulation of timing using Jitterbug and TrueTime , 2003, IEEE Control Systems.

[19]  Karl-Erik Årzén,et al.  Jitterbug and TrueTime: Analysis Tools for Real-Time Control Systems , 2002 .

[20]  Pieter J. Mosterman,et al.  Real-Time Simulation Technologies: Principles, Methodologies, and Applications , 2012 .