680 likes | 1.11k Views
UML, Embedded Systems, and Application Frameworks. Shang-Wei Lin, Chun-Hsian Huang, and Pao-Ann Hsiung Embedded Systems Laboratory National Chung Cheng University Taiwan. Outline. UML and Embedded System Design UML Model-Driven Development Rhapsody Embedded System Application Framework
E N D
UML, Embedded Systems, and Application Frameworks Shang-Wei Lin, Chun-Hsian Huang, and Pao-Ann Hsiung Embedded Systems Laboratory National Chung Cheng University Taiwan
Outline • UML and Embedded System Design • UML Model-Driven Development • Rhapsody • Embedded System Application Framework • VERTAF
Outline • UML and Embedded System Design • UML Model-Driven Development • Rhapsody • Embedded System Application Framework • VERTAF
UML and Embedded System Design • Introduction • Embedded System • UML • Research Projects for Embedded Software
Introduction • Embedded systems are becoming more and more pervasive in our daily life • The functionalities of embedded systems are also becoming more and more complex • Correctness is difficult to verify
Unified Modeling Language • UML is a standardized general-purposemodeling language in the field of software engineering • A set of graphical notationsfor creating abstract models of concrete systems • Object-Oriented Analysis (OOA) • Object-Oriented Design (OOD)
UML (cont’d) • UML and object-oriented technology are quite suitable for modeling embedded software • However, the following have to be considered • Target architecture • Real-time characteristics
Research Projects for Embedded Software • MoBIES • HUGO • DESS • VERTAF
MoBIES • Model-Based Integration of Embedded Systems • Supported by USA DARPA • Consists of several subprojects
MoBIES (cont’d) • Subprojects • AIRES (Automatic Integration of Reusable Embedded Software) • Automatically generates a run-time model from a structural model through several metamodels • Software architecture • Platform • … • Time Weaver • Captures para-functional properties into models of different semantic dimensions • Event flow • Concurrency • …
HUGO • Developed by Germany’s Ludwig-Maximilians University • Model checking statecharts against collaborations • Code generation • Noscheduling
DESS • Developed by EUREKA-ITEA • Only provides guidelines for incorporating various kinds of tools into the design process • Neither real implementation of the concepts nor any toolset is provided by DESS
VERTAF • Developed by Embedded Systems Laboratory, National Chung Cheng University, Taiwan • An application framework that integrates • UML Modeling • Formal Software Synthesis • Scheduling • Code Generation • Formal Verification • Model Checking
Outline • UML and Embedded System Design • UML Model-Driven Development • Rhapsody • Embedded System Application Framework • VERTAF
Rhapsody • Introduction • Rhapsody for RTOS • Rhapsody Desktop • Target Platform • Rhapsody RTOS Adapter • Adapt Rhapsody to a New RTOS • OS Services for the Applications
Introduction • Include a graphic editor for each of the UML diagrams • Use case, sequence, collaboration, object model, component, state machine and activity diagrams • Not only capture the design of the system but also generate implementation code • C, C++, Java and Ada
Introduction (cont’d) • Provide Model-Driven Development (MDD) environment based on UML 2.1 • Systems and software development of real-time and embedded applications • Can use an iterative design approach • Software can be constantly executed and validated • Can rapidly target the platform independent application model to a real time embedded operating system
Rhapsody for RTOS • Can construct portable and technology independent systems via • Generation of application code from platform independent models • Object eXecution Framework (OXF) • Use of OS-specific adaptors for most commercial RTOSs
Platform-Independent Applications Platform-Independent Framework OS-Dependent Adapter RTOS Microprocessor Rhapsody for RTOS (cont’d) Source Code Compiler and Linker Model Entries Model-Entry Model Compiler Model Execution Model Tester Model Animation Target Platform Rhapsody Desktop
Rhapsody Desktop • Model-Entry • enter the PIM using standard UML diagrams • Model Compiler • generate the source for the selected language and compiler • Model Tester • simulate and monitor the execution of the PIM-generated application
Target Platform • PIM Framework • a real-time PIM framework provided by Rhapsody • OS-Dependent Adapter • a light-weight OS-specific adapter layer for handing interactions with the underlying RTOS
Platform-Independent Applications Platform-Independent Framework OS-Dependent Adapter OS Abstraction Layer RTOS Microprocessor Rhapsody RTOS Adapter Rhapsody RTOS Adapter Generated Application OXF (Object eXecution Framework) RTOS
Depend on Create Adapt Rhapsody to a New RTOS Rhapsody OXF Source Code OXF Libraries OS Abstraction Layer OS Environment Makefile Abstract OS Classes OS Environment Framework
Generated Source Codes Adapt Rhapsody to a New RTOS (cont’d) Application Load Module Development Properties Generated Makefile Rhapsody OXF Libraries
OS Services for the Applications • Tasking services • createOMOSThread(), createOMOSWrapperThread() • Synchronization services • OMOSMutex(), OMOSSemaphore() • Message queues • OMOSMessageQueue() • Communication port • OMOSConnectPort(), OMOSSocket() • Timer service • OMOSTimer()
Outline • Unified Modeling Language (UML) • UML Model-Driven Development • Rhapsody • Embedded System Application Framework • VERTAF
VERTAF • Background • Issues and Solutions • Framework Architecture • Framework Flow • Framework Phases • Application Examples
Background • Verifiable Embedded Real-Time Application Framework (VERTAF) • A long-termresearch project of Embedded Systems Lab, National Chung Cheng University, Taiwan • Collaboration among several universities in Taiwan
Background (cont’d) • Portions of work on this research project published already in several conferences and journals: • Scheduling: CODES’99, CODES’01, APSEC’01, CODES’02, APSEC’02, RTCSA’02, CODES’03, RTCSA’03, IEEE-TCE’04 • Verification: CODES’99, ECRTS’99, TACAS’99, COMPSAC’00, IEE-DCT’00, JSA’00, IEEE-TC’02 • Framework Architecture: RTAS’01, ISORC’02, IEEE-TSE’04, EUC’07, CLSS’07, JSPS’08
Issues and Solutions Based on user given specifications for real-time embedded software, can we automaticallydesign, verify, and generate code? Yes, under some constraints!
Issues and Solutions (cont’d) • How to specify real-time embedded software requirements? • UML models • Selected three types of models • Restricted as well as enhanced • Formal Semantics • For synthesis and verification • Specification Guidelines • For automatic analysis and design
Issues and Solutions (cont’d) • What kinds of models can be used for each design phase? • Specification: Formal UML models • Synthesis: Real-Time Petri Nets • Verification: Extended Timed Automata • Model Continuity Problems: • Semantics Equivalence Checking • UML vs. Real-Time Petri Nets • UML vs. Extended Timed Automata
Issues and Solutions (cont’d) • What is the Control-Flow? When to verify and when to synthesize? • Framework Approach • A semi-complete application • High-level architecture reuse • Inversion of control • Users fill in objects and functionalities, framework takes care of the software flow control • Proposed Flow • First, synthesize and then verify! • Smaller state-space
Issues and Solutions (cont’d) • How to formally synthesize and verify? • Synthesis • Scheduling to satisfy local deadlines, global deadlines, memory constraints, power constraints • Verification • Model Checking • Interface Verification • Assume-Guarantee Reasoning • Abstraction Techniques
Issues and Solutions (cont’d) • How to automatically generate code? • Code generation • Application • From formal UML models • Scheduler • From scheduled Petri Net models (derived from UML) • Code architecture • Multi-layered • Portable, Efficient
Formal Verification Scheduler Generation LQS Scheduling HW Architecture Mapping Automatic Code Generation Framework Architecture UML Real-Time Embedded Object Model Reusable Components
Framework Flow – Front End Modeling Verification Scheduling Scheduler Generation
Framework Flow – Back End Architecture Mapping Code Generation
Framework Phases • UML Modeling Phase • Scheduling Phase • Scheduler Generation Phase • Formal Verification Phase • Hardware Architecture Mapping Phase • Code Generation Phase
UML Modeling Phase Modeling
UML Modeling Phase (cont’d) • To specify requirements by a system model • Three diagrams chosen from UML: • Class Diagram with Deployments • Extended Sequence Diagrams • TimedStatecharts • Modifications for modeling real-time embedded software requirements • CD: Hardware deployments • SD: State marks, control extensions • SC: Timing control keywords, real-time constraints
Scheduling Phase Scheduling
Scheduling Phase (cont’d) • To ensure feasibility of a system • Low-Power Quasi-Dynamic Scheduling (LQS) • Generate Power-Aware Real-Time Petri Net models from UML sequence diagrams • Decompose into computations • Statically schedule each computation to satisfy • Time (local deadlines, global deadlines, periods) • Memory • Energy (I/O device, microprocessor) • Task precedence relationships
Scheduler Generation Phase Scheduler Generation
Scheduler Generation Phase (cont’d) • To ensure the generated application follows the scheduling result (static LQS schedules) • Scheduler • Generated from the scheduled task sequence • Two forms: • An extended timed automata (for verification) • Communications among the system ETA models • A piece of software code (for code generation) • Schedules and dispatches object tasks • Implementations: SST, TinyOS (sensor network)
Formal Verification Phase Verification
Formal Verification Phase (cont’d) • To ensure the functional correctness of the generated real-time embedded software • Model Checker: State Graph Manipulators (SGM) • System Model • A set of ETA translated from UML statecharts • A scheduler ETA generated by scheduling sequence diagrams • System Properties • TCTL formulas translated from UML/OCL specifications • Counterexample • A sequence diagram from ETA counterexample (computation run)
Hardware Architecture Mapping Phase Architecture Mapping
Hardware Architecture Mapping Phase (cont’d) • Reusable component models • Drivers, library modules, object files • Functional: state diagrams, … • For verification • Non-functional: response time, transfer rate, … • For scheduling • Portable generic interface for components • init(), reset(), read(), write()