Timing Definition Language (TDL) Concepts, Code Generation and Tools

Similar documents
Modeling with the Timing Definition Language (TDL) Wolfgang Pree Professor Department of Computer Science Univ. Salzburg, Austria

Simulation of LET Models in Simulink and Ptolemy

Modeling with the Timing Definition Language (TDL)

Impact of Platform Abstractions on the Development Workflow

Extending a Time-Triggered System by Event-Triggered Activities

Model Based Development of Embedded Control Software

Transparent Distribution of TDL Modules

TDL Steps Beyond Giotto. A Case for Automated Software Construction

Giotto. Thomas A. Henzinger, Benjamin Horowitz, Christoph Kirsch. UC Berkeley

Schedule Integration for Time-Triggered Systems

Simulating Real-Time Software Components based on Logical Execution Time

Timing Definition Language (TDL) Specification 1.5

Giotto Domain. 5.1 Introduction. 5.2 Using Giotto. Edward Lee Christoph Kirsch

Portable Real-Time Code from PTIDES Models

Virtual Validation of Cyber Physical Systems

Task Sequencing for Optimizing the Computation Cycle in a Timed Computation Model

wait with priority An enhanced version of the wait operation accepts an optional priority argument:

Embedded Software Engineering

ARTIST-Relevant Research from Linköping

Programming Languages for Real-Time Systems. LS 12, TU Dortmund

Model Based Development of Embedded Control Software

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

Investigation of System Timing Concerns in Embedded Systems: Tool-based Analysis of AADL Models

RTMaps Embedded facilitating development and testing of complex HAD software on modern ADAS platforms

Scheduling Algorithm and Analysis

Guido Sandmann MathWorks GmbH. Michael Seibt Mentor Graphics GmbH ABSTRACT INTRODUCTION - WORKFLOW OVERVIEW

Engineering of Reliable Software Systems

Compositionality in system design: interfaces everywhere! UC Berkeley

Exam TI2720-C/TI2725-C Embedded Software

Verification of embedded control systems by simulation and program execution control

Future Directions. Edward A. Lee. Berkeley, CA May 12, A New Computational Platform: Ubiquitous Networked Embedded Systems. actuate.

Editor. Analyser XML. Scheduler. generator. Code Generator Code. Scheduler. Analyser. Simulator. Controller Synthesizer.

NET. A Hardware/Software Co-Design Approach for Ethernet Controllers to Support Time-triggered Trac in the Upcoming IEEE TSN Standards

Hybrid System Modeling: Operational Semantics Issues

Platform Based Design of Unmanned Aerial Vehicles

Exam Concurrent and Real-Time Programming

An Programming Language with Fixed-Logical Execution Time Semantics for Real-time Embedded Systems

CSE398: Network Systems Design

TIMES A Tool for Modelling and Implementation of Embedded Systems

Multi-threaded programming in Java

An Encapsulated Communication System for Integrated Architectures

Product Information Embedded Operating Systems

2. Introduction to Software for Embedded Systems

TDL Specification and Report

MASTER'S THESIS. Modeling and Simulation of Embedded Real-Time Software

Implementing Scheduling Algorithms. Real-Time and Embedded Systems (M) Lecture 9

Real Time & Embedded Systems. Final Exam - Review

REACT. REACT: Event-driven Asynchronous Concurrent Turing-complete

PragmaDev. change request. Emmanuel Gaudin. PragmaDev ITU-T SG17 change request Grimstad June 24,

Component-Based Design of Embedded Control Systems

CANape Option Bypassing

Integrated Design and Analysis Tools for Software Based Control Systems

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Model-based Development with. Contents. W. Pree, G. Stieglbauer and C. Kirsch

Hyperperiod Bus Scheduling and Optimizations for TDL Components

Design Specification of Cyber-Physical Systems: Towards a Domain-Specific Modeling Language based on Simulink, Eclipse Modeling Framework, and Giotto

COMPLEX EMBEDDED SYSTEMS

The AUTOSAR Timing Model --- Status and Challenges. Dr. Kai Richter Symtavision GmbH, Germany

Introduction to Distributed Systems

Impact of Runtime Architectures on Control System Stability

Resource management. Real-Time Systems. Resource management. Resource management

Real-time C Code Generation in Ptolemy II for the Giotto Model of Computation

TDL Specification and Report

A Deterministic Concurrent Language for Embedded Systems

Model-Based Design of Automotive RT Applications

Simulating a Multicore Scheduler of Real-Time Control Systems in Simulink

Chapter 13: I/O Systems

Embedded Software from Concurrent Component Models

The Future of the Ptolemy Project

Chapter 13: I/O Systems

Enhanced Ethernet Switching Technology. Time Applications. Rui Santos 17 / 04 / 2009

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

A Deterministic Concurrent Language for Embedded Systems

CLUSTERING HIVEMQ. Building highly available, horizontally scalable MQTT Broker Clusters

Design and Performance Evaluation of a New Spatial Reuse FireWire Protocol. Master s thesis defense by Vijay Chandramohan

A Deterministic Concurrent Language for Embedded Systems

Chapter 13: I/O Systems

Developing deterministic networking technology for railway applications using TTEthernet software-based end systems

Systems. Roland Kammerer. 10. November Institute of Computer Engineering Vienna University of Technology. Communication Protocols for Embedded

An Industry Definition of Business Architecture

SWE 760 Lecture 1: Introduction to Analysis & Design of Real-Time Embedded Systems

CHAPTER 6: PROCESS SYNCHRONIZATION

Embedded Software Programming

Principles of Real-Time Programming

Handling Challenges of Multi-Core Technology in Automotive Software Engineering

Implementing a distributed TDL-EMachine for the RTLinux Platform

Simulation of AADL models with software-in-the-loop execution

Model-based Analysis of Event-driven Distributed Real-time Embedded Systems

Cross-layer Analysis, Testing and Verification of Automotive Control Software

The Abstract Behavioral Specification Language

Time Triggered and Event Triggered; Off-line Scheduling

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Cycle and response times SIMATIC. S Cycle and response times. Preface. Documentation guide. Program processing 2. Cyclic program processing 3

Giotto Tutorial. Forward:

MICROSAR-OS. Embedded Real-time Multitasking Operating Systems

How useful is the UML profile SPT without Semantics? 1

Embedded System Design and Modeling EE382V, Fall 2008

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Transcription:

Timing Definition Language (TDL) Concepts, Code Generation and Tools Wolfgang Pree Embedded Software & Systems Research Center Department of Computer Sciences Univ. Salzburg

Overview Motivation Timing Definition Language (TDL) and TDL tools Communication schedule generation 2

embedded systems characteristics T.A. Henzinger, J. Sifakis (2006): embedded system := an engineering artifact involving computation that is subject to physical constraints# reaction to a physical environment (control theory)# execution on a physical platform (computer engineering) => the powerful separation of! computation (software)! from physicality (platform and environment), # #which has been one of the central ideas enabling the science of computing, does not work for embedded systems.# 3

Scientific challenge: appropriate abstractions Component C develop once deploy on any platform 3 dspace mabx... TT Ethernet (TT) ARM CAN... 4 FlexRay-based communication single node

Scientific challenge: appropriate abstractions Component C develop once compiler, automatic code generation 3 dspace mabx... TT Ethernet (TT) ARM CAN... 5 FlexRay-based communication single node

State-of-the-art: C-a C-b C-c 3 dspace mabx 2 DeComSys Renesas...... 6

Computing needs time (Edward Lee, UC Berkeley) define a computing model that explicitly considers time & concurrency# achieve a paradigm shift from platform-centric to platform-independent embedded software development# put time into programming languages find adequate abstractions for concurrency define component models that deliver software properties such as determinism and portability and that allow transparent distribution rethink the hardware/software split make memory management predictable regarding timing make network communication deterministic define a computational dynamic systems theory etc.# 7

TDL in a nut shell 8

What is TDL? A high-level textual notation for defining the timing behavior of a real-time application. TDL covers all aspects that are required to model safety-critical software as found, for example, in cars, airplanes, Unmanned Aerial Vehicles (UAVs), automation systems seamless integration of time-triggered (synchronous) and eventtriggered (asynchronous) activities 9

TDL is conceptually based on Giotto Giotto project: 2000 2003, University of California, Berkeley TDL = Giotto concepts + Syntax + Component Architecture + Tool Chain + Extensions 10

TDL tools TDL:Compiler TDL:VisualCreator TDL:VisualDistributor TDL:VisualAnalyzer requires Java 1.5 or later optional integration with MATLAB /Simulink from The MathWorks TDL:Machine (alias E-Machine) platform-specific, typically in C 11

TDL tool chain functionality code.tdl TDL:Compiler TDL:Machine*.ecode * Simulink, OSEK, dspace, ARM, AES, INtime, RTLinux,... 12

TDL tool chain functionality code.tdl TDL:Compiler TDL:Machine*.ecode AST platform specific Platform plugin* platform specific * Simulink, OSEK, dspace, ARM, AES, INtime, RTLinux,... 13

TDL tool chain TDL:VisualCreator functionality code.tdl TDL:Compiler TDL:Machine.ecode AST platform specific Platform plugin* platform specific 14

TDL tool chain TDL:VisualCreator functionality code.tdl TDL:Compiler TDL:Machine.ecode AST platform specific Platform plugin* platform specific TDL:VisualDistributor 15

modeling and platform mapping TDL:VisualCreator Component C TDL:VisualDistributor... 16

run-time analysis TDL:Machine node1 TDL:VisualAnalyzer TDL:Machine node2 TDL:Machine node3 17

TDL programming model: multi-rate, multi-mode systems (I) 18

TDL programming model: multi-rate, multi-mode systems (II) LET-semantics 19

Logical Execution Time (LET) abstraction release Logical Execution Time (LET) terminate Logical task invocation time Physical start suspend resume stop stop (ET) (WCET) ET <= WCET <= LET results are internally available at stop (ET) results are externally visible at terminate spare time between stop and terminate 20

LET advantages observable (logical) timing is identical on all platforms allows for simulation allows for composition allows for distribution 21

Periodic execution in TDL modes Mode Start Mode Period Mode End Logical task t invocation 1 task t invocation 2 time Every mode has a fixed period. A task t has a frequency f within a mode. The mode period is filled with f task invocations. The LET of a task invocation is modeperiod / f. 22

TDL component model: modes, sensors and actuators form a unit, the TDL module 23

Motivation for TDL modules ECU1 Program1 ECU2 Program2 ECU3 Program3 e.g. modern cars have up to 80 electronic control units (ECUs = nodes) ECU consolidation is a topic run multiple programs on one ECU leads to TDL modules => TDL allows specification of mulit-rate, multi-mode, multi-program systems 24

TDL modules ECU Program1 Program2 Program3 ProgramX is called a module modules may be independent modules may also refer to each other modules can be used for multiple purposes 25

Example: Receiver imports from Sender module module Sender module Receiver 26

Example: Receiver imports from Sender module module Sender public module Receiver 27

Example: Receiver imports from Sender module private module Sender public module Receiver 28

TDL syntax by example module Sender { sensor boolean s1 uses gets1; actuator int a1 uses seta1; public task inc { output int o := 10; uses incimpl(o); } Sender (mode main) s1 inc [5ms] a1 start mode main [period=5ms] { task [freq=1] inc(); // LET = 5ms / 1 = 5ms actuator [freq=1] a1 := inc.o; // update every 5ms mode [freq=1] if exitmain(s1) then freeze; } } mode freeze [period=1000ms] {} 29

Module import module Receiver { } import Sender; task clienttask { input int i1; } mode main [period=10ms] { task [freq=1] clienttask(sender.inc.o); // LET = 10 ms } 20 ms Sender Receiver s1 inc [5ms] a1 clienttask [10ms] a1 30

LET-behavior (independent of component deployment) 5 ms Sender inc inc inc inc t communication of inc s output to clienttask Receiver clienttask clienttask 10 ms 31

Selected TDL constructs 32

TDL slot selection Mode Start Mode Period Mode End Logical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 time f = 6 33

TDL slot selection Mode Start Mode Period Mode End Logical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 task invoc. 1 task invoc. 2 time f = 6 task invocation 1 covers slots 1 2 task invocation 2 covers slots 4 5 34

TDL slot selection allows the specification of... an arbitrary repetition pattern the LET more explicitly gaps task invocation sequences optional task invocations 35

Physical layer / E-code blocks Mode Start Mode Period Mode End Logical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 task invoc. 1 task invoc. 2 time Physical E-code E-code E-code E-code block block block block E-Code block follows fixed pattern: 1. task terminations 2. actuator updates 3. mode switches 4. task releases 36

Adding asynchronous activities Mode Start Mode Period Mode End Logical Physical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 task invoc. 1 task invoc. 2 time E-code block E-code block E-code block E-code block Priority levels black: highest priority (E-code) 37

Adding asynchronous activities Mode Start Mode Period Mode End Logical Physical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 task invoc. 1 task invoc. 2 time E-code block E-code block E-code block E-code block Priority levels black: highest priority (E-code) red: lower priority (synchronous tasks) 38

Adding asynchronous activities Mode Start Mode Period Mode End Logical Physical slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 task invoc. 1 task invoc. 2 time E-code block E-code block E-code block E-code block Priority levels black: highest priority (E-code) red: lower priority (synchronous tasks) blue: lowest priority (asynchronous activities) 39

Asynchronous activities rationale event-driven background tasks may be long running not time critical could be implemented at platform level, but: platform-specific unsynchronized data-flow to/from E-machine support added totdl Goal: avoid complex synchronization constructs and the danger of deadlocks and priority inversions 40

Kinds of asynchronous activities task invocation similar to synchronous task invocations except for timing input ports are read just before physical execution output ports are visible just after physical execution data flow is synchronized with TDL:Machine actuator updates similar to synchronous actuator updates except for timing data flow is synchronized with TDL:Machine 41

Trigger Events hardware and software interrupts periodic asynchronous timers port updates Use a registry for later execution of the async activities. Parameter passing occurs at execution time. Registry functions as a priority queue. 42

Sample TDL module module GPS { import INS; public output INS.Vector pos; INS.Vector vel; long timestamp; public task receivegps { input long time; uses getgpsdata(time, pos, vel, timestamp); } asynchronous { [interrupt = igps, priority = 2] receivegps(ins.time); } } 43

Transparent distribution and automatic schedule generation 44

TDL module-to-node-assignment (example) Sender ECU1 FlexRay bus ECU2 Receiver 45

Transparent distribution of TDL components: Firstly, at runtime a set of TDL components behaves exactly the same, no matter if all components are executed on a single node or if they are distributed across multiple nodes. The logical timing is always preserved, only the physical timing, which is not observable from the outside, may be changed. Secondly, for the developer of a TDL component, it does not matter where the component itself and any imported component are executed. 46

sample physical execution times on ECU1/ECU2 5 ms Sender inc inc inc inc t ECU1 Receiver ECU2 clienttask 10 ms clienttask 47

Constraints for automatic schedule generation 5 ms communication window communication window Sender inc inc inc inc t ECU1 stop stop (WCET) (WCET) Receiver ECU2 clienttask 10 ms clienttask 48

Sample bus schedule Sender inc inc ECU1 FlexRay bus Receiver 5 ms clienttask communication window inc clienttask communication window inc t local buffer local buffer ECU2 10 ms 49

TDL:VisualDistributor maps TDL modules to nodes and generates communication schedule for distributed systems 50

Thank you for your attention! 51