Model-Based Development of Embedded Real-Time Systems Raj Rajkumar with Dionisio de Niz Real-Time and Multimedia Systems Laboratory Carnegie Mellon University raj@ece.cmu.edu http://www.ece.cmu.edu/~raj
Scope of Interest Tolerate Faults Timeliness Reliability Throughput Data elements per second Guarantee End-to-end response time
Project Objective Timing constraints UML models State machines Schedulability & QoS analysis Hybrid Systems Verification Reachability analysis Validation QoS/Resource requirements Control laws RT Toolset Analysis RT-Java RT-CORBA Run-Time Plumbing Linux/RK Code Generation TimeWiz Embedded Target Run-Time Environment Measurements Multi-View Modeling + Analyses + Targeting Freedom + Reusable Embedded Software Components
Capability Summary Radar Filter Track Display Functional Coding Only Time Weaver Radar Filter Track Display allocation Add/delete Inter- Comm or allocation Radar Filter Track Display Add/remove Inter-or Comm Radar Filter Track Display Add/remove threads, modify timing params
Time Weaver Abstractions Logical View Radar Filter Post- Report First-Level Time Weaver Representation Component Design- and runtime entity Port Radar Filter Post- Report Coupler Coupler Coupler Couples represents interactions among components; design-time entity Typed Events are properties sent to/from couplers at design time
Embedded Systems Composition Embedded System = Thread Thread Software + Hardware
Embedded System Embedded Software Different Para-Functional Properties = radar scan Thread Thread track Software + Hardware Thread Thread radar radar scan track scan track Thread Thread Thread track Thread Throughput (trajectories / s) Reliability
pthread_create() Embedded Software Heterogeneous Platforms CreateThread() TCP/IP Sockets Thread Thread Thread Thread CANBus FlexRay New Thread() Thread Thread Thread
Recent Focus Software Reuse Through Software Components Complexity Reduction Automatic Verification of Para-Functional Properties Synthesis
Traditional Radar Radar Scan Filter Tracker Display Periodic Thread Program main() { } default pthread_create() timer_create()
Traditional Pipeline Radar Radar Scan Filter Tracker Display Periodic Thread Aperiodic Thread Aperiodic Thread Aperiodic Thread Program Program Program Program create_client_stub() get_clt_stub.invoke() create_server_stub() srv_stub(){tracker( ) }
Inter-component relationships decomposition Data dependency Deployment Synchronization (Replica management)
Coupler Inter-component relationships decomposition Data dependency Synchronization (Replica mgmt) Deployment Coupler manipulate port elements to construct relationship
Independent Semantic Dimensions Functional Fault-Tolerance Deployment Semantic separation Projections to other dimensions
Inter-dimensional projections Deployment Functional or or Network
Software Model Directed Graph Activation Port t Internal activation, e.g. periodic t c1 c2 o1 e1 e2 o1 i1 c3 i2 o1 o2 e3 e4 i1 i1 c4 c5 f f Completion Port End of execution State Manager Event valve: controls passage of events i1 i2 pa1ss1 pa3ss3 a1 m1 a2 m2 a3 m3 ss2 ss4 pa2 pa4 o1 o2 Application Agent Event processing code C Protocol Agent Inter-component communication customization State Manager Stack Sequence of state managers event flow A B
Basic Coupling Event Communication Protocol agents interconnected Synchronization State Managers = event valves Open/close based on synch protocol Aggregation Deploy together event flow Related properties Periodic execution 10ms
Typed channel Composite Component Composite Coupling Data Coupling composites Typed channel merging Composite Component Radar Scan Filter Tracker Display
Composite Coupling Encapsulation Radar Scan Filter Tracker Display
Composite Coupling Deployment Radar Scan Filter Tracker Display or Network or Define communication mechanism: Change protocol agent in port group
Composite Coupling Synchronization Radar Scan Filter Tracker Tracker Display Roles Replica Synch Replication Merging
Composite Coupling Timing Properties Radar Scan Filter Tracker Display 1X 2X Period = 100 ms
Embedded System Dimensions Functional Event flow Timing Deployment Fault-Tolerance Modality Concurrency
Modality Defines variations to the system structure at different stages of its lifetime Switch to mode 2 Mode Driver Mode Switch A Switch to mode 1 C Avionics: takeoff, cruise, landing Mode Switch B D Hierarchy of modes A Mode Driver A C Switch to mode 1 B D Switch to mode 2 Mode Driver E G F H
Concurrency Structures for concurrent execution Pipeline Synchronization of concurrent activities Radar Scan Stage 1 Filter Tracker Display Stage 2 Stage 3 Pipeline
Automatic Software Model for Verification Generation of response chain and hardware model Integration with real-time analysis tools for automatic analysis (TimeWiz )
Code Generation Components can have multiple implementations C, C++, Real-Time Java, Matlab, XML, Target Multiple Platforms RT-CORBA, RMI,
Optimization Automatic selection of optimal communication mechanism Synthesis Deployment Hardware Sizing
ApplicationAgent (from couplers) periodseconds : long = 0 periodnanos : long = 0 dispatchstatechanged() run () Tool Integration Rational Rose UML Interface (from couplers) syncwrite() syncread() syncrw() Time Weaver monitor interfaze : sensorinterface sensor interfaze : sensorinterface sensorinterface value : int = 0 XML Repository Target TimeWiz RT-Java/CORBA Windows/Linux-RK
Event Flow Modality Example Timing Deployment
Case Studies Avionics Application Modeling (~400 components) Software Radio Modeling Data Flow Throughput increase Automotive Testbed Code generation for ARM 7 + µcos-ii Working on: MPC555 + OSEKWorks
Related Work Software Architecture Meta-H Component-based, Timing Analysis No separate views AIRES Hierarchical SM, control driver + functions Timing Analysis Ptolemy II Hierarchy of model of computation Simulation AOP
Concluding Remarks Para-functional requirements first-class entities Couplers para-functional decomposition abstraction Multiple separate dimensions Automatic verification Code generation Tool integration