Model-Based Development of Embedded Systems with MDA and xtuml Presentation at the MODPROD Workshop on Model-based Product Development at the University of Linköping, Sweden February 7, 2007 Erik Wedin erik.wedin@dynamics.saab.se Software Systems Architecture Specialist Saab Bofors Dynamics AB Linköping, Sweden 1
Contents Saab Presentation MDA and xtuml and its application at Saab Bofors Dynamics The benefits of MDA and xtuml Vision References Questions & Answers 2
Saab Saab is one of the world s leading high-technology companies, with its main operations focusing on defence, aviation and space. Employees 12,500 Turnover, MSEK 17,000 3
Saab Worldwide 4
Three Segments 17 Business Units Defence and security solutions Aeronautics 27 Percent of sales 2005 Systems and products 34 Percent of sales 2005 39 Percent of sales 2005 Saab Systems Saab Aerotech Combitech Saab Bofors Dynamics Saab Space Saab Avitronics Saab Barracuda Saab Aerosystems Saab Aerostructures Gripen International Saab Grintek Saab Communication Saab Surveillance Systems Saab Underwater Systems Saab Training Systems Saab Microwave Systems Saab Aircraft Leasing 5
Saab Bofors Dynamics A vital part of Saab s defence activities Certification to the following standards: ISO 9001+ ISO 14001 Tick IT + AQAP 2110 Employees Turnover Exports Backlog of orders Exports 1,404 SEK 3,200 million SEK 2,350 million SEK 8,600 million SEK 7,200 million 6
Complete Missiles Solutions Develops advanced missile systems for the Swedish Defence Forces and other national defence forces Participates in international projects 7
International Collaborations IRIS-T Meteor TAURUS NLAW ASRAD-R RBS15 8
Technical System Characteristics Embedded real-time systems but also planning systems and simulators Specially-designed hardware and computer platforms but also COTS Autonomous systems reliable, predictable Complex communications internally and externally Application functionality guidance, navigation and control; signal and image processing; data fusion complex mathematics, computationally demanding mission management telemetry supervision of missile systems in flight Hard real-time requirements missed deadline may result in loss of the system communication & execution Periodic mixed-frequency execution but also aperiodic Safety-critical usually solved in hardware, but not in the near future 9
Abstraction in System Development The Next Step Integrated Software/Electronics/System Development Executable & Translatable Specifications Specifications (Text, Pictures, Models, ) (Models) Manual Model Implementation Compiler Model Manual Compiler Implementation Compiler High-Level Language (Ada95, C, ) High-Level Language (VHDL, ) Synthesizer Assembler Assembly Code Netlist File Placer & Router Object Code Processor System Programmable Logic Device Programming File 10
xtuml/mda-based Software Development at SBD Simulator System Ada83/OOD-architecture 11 Missile System Master s Thesis: Ada Code Generation Transponder System Ada83/OOD-architecture Navigation System Thesis Work: VHDL Code Generation Blueprint Specifications/ UML Models and Manual Code Implementation, BridgePoint Executable Specifications/ xtuml Models and Automatic Code Generation, BridgePoint Ada83/OOD-architecture Ada95/OOD-architecture Missile System C/OOD-architecture Missile System Study: Executable UML Translation to Ada Study: Executable UML Translation to VHDL Master s Thesis: Implicit Bridging Missile System Navigation Demonstrator Ada83/OOD-architecture 2xMissile Systems Missile System Blueprint Specifications/ UML Models and Manual Code Implementation, Teamwork & BridgePoint Ada95/Ada MC mechanisms Ada95/Ada MC mechanisms Ada95/Ada MC Ada95/Ada MC Master s Thesis: Simulator Framework C++/MC2020 Distributed Real-Time System Code Generation from Executable UML Missile System SPARK/SPARK MC 91 92 93 94 95 96 97 98 99 00 01 02 03 04 05 06 07
Different Ways of Using UML Sketches informal capture of ideas and concepts, coding may proceed directly visualises a solution and enables communication among persons Blueprints specifies software structure near one-to-one mapping to code code frames may be generated code is then directly added in the model or in separate files if generated code is modified by hand model code need for round-trip i.e. generate model from code; only sensible if code and model has a near one-to-one relationship Executable models Executable specifications separates the application from the implementation, i.e. the platform-independent parts from the platform-specific parts the model does not necessarily have a one-to-one relationship with the code what the rest of the presentation is all about 12
Executable (and Translatable) UML xtuml Executable UML is a well-defined profile (subset) of UML 2.0, including precise Action Semantics Enables development of Software and Hardware platform-independent specifications of the problem Supports the OMG Model-Driven Architecture (MDA) initiative PIM Platform-Independent Model - models the solution of a problem PSM Platform-Specific Model - models the details of the implementation Separation of Subject Matters Abstraction & Reuse of models (not code) A Model Compiler weaves the models together, guided by marks into an implementation at design-time not at specification-time www.omg.org/mda Executable UML (xtuml) models Executable Specifications can be executed and simulated (platform-independently) without generating code can be translated to one/several implementation(s) onto one/several specific software/hardware platform(s) without changing the models 13
Core Executable and Translatable UML Diagrams UML Unified Modelling Language Diagram Type Component Package Class State machine Use case Activity Sequence Communication Composite structure Deployment Interaction Object Timing Usage Large-scale components and their interfaces Groupings of elements and dependencies between them Classes, attributes, associations and generalisations Behaviour over time in response of events Requirements in terms of interactions between a system an its users Parallel and sequential behaviours connected by data and control flows Synchronous/asynchronous interactions between objects Communications between objects (previously collaborations ) Internal structure, ports, collaborations and structured classes Deployment onto nodes in a specific implementation Overview of activities and interactions Selected instances of classes and values of attributes at run-time Timing in a variation of sequence/interaction diagrams BridgePoint Support To be supported 14
Core Executable and Translatable UML Diagrams Component (Domain) Diagram - Domains, Bridges Domain Package Diagram - Data Types, Functions, Subsystems, Class Diagram - Classes (Attributes, Derived Attributes, External Entities Operations), Associations Application Comm IO 15 Model Compiler/ Architecture Ada95 VHDL = Contains Action Language State Transition Table - Events, States, State Transitions E1 E2 E3 E4 S1 S2 IG IG CH S2 CH S1 IG S3 S3 IG IG S1 IG Procedure - Action Language xxxx xxxxx x xxxxxxx xxxxxxx xxxx xxxxx x xxxxxxx xxxx xxxx Action - Action Language Statement Class/Instance State Machine - Events, States, State Transitions
BridgePoint xtuml Modeling Perspective Eclipse 16
BridgePoint xtuml Verification Perspective 17
BridgePoint xtuml Build Perspective 18
xtuml Process 1. Requirements Gathering (Use Cases, Activity Diagrams & Sequence Diagrams) 5. Organise Control Interactions (Class Communication Diagram) Legend = PIM-Related Activities = Architecture-Related Activities = System Design Activities 3. Build Class Models (Class Diagram & Descriptions) 4. Build State Models (State Machines & Tables) 7. Build Procedure Models (Action Language) 2. Organise System (Component/Domain Diagram) 6. Execute Instance Interactions (Sequence Diagrams) 10. Translate Models (Marking & Bridging) 11. Integrate and Test 8. Specify Architecture 9. Build/Buy Model Compiler (Software Architecture) 19
Model Compilers Reusable software architectures In-house MCs are invaluable strategic assets Ada MC developed from scratch, based on OOD-architecture from previous projects used/reused in several projects tailored to specific project-needs VHDL MC architecture designed, not formalised in an MC yet SPARK Ada MC SPARK Ada=safe subset of Ada + augmented with annotations in comments generating code that can undergo formal verification to prove absence of run-time errors suitable both for high-performance and safety-critical systems in development, first prototype ready in March 2007 Commercial MCs MC2020 - C++ extended with implicit bridging MC3020 - ANSI C used on selected parts of a product, the Ada MC on the major parts Model Compiler Archetypes (Templates & Rules) xtuml Model Marks (Translation Control) Mechanisms (Class Components, Execution Control,...) xtuml Metamodel (predefined) Marking+ Architecture Metamodels 20
xtuml Model Builder & Model Verifier Bought Off-the-Shelf or Developed by the User, Depending on Specific Architectural Requirements Open Model Compilation Process xtuml Metamodel (predefined) Mapping Marking+ Architecture Metamodel xtuml Application Model(s) Other Design Fsdfsdfffffffffffffffffffffffffff Fsdfsdfffffffffffffffffffffffffff sdfddsd sdfddsd ERREREREDDFKMOMJIQOERN ERREREREDDFKMOMJIQOERN CWCNJIWNVIÅSERUVNÅ CWCNJIWNVIÅSERUVNÅ VRWEIVWNVWOIVÄNSDIRNVÄIRVNRÄINRVNTIWTV VRWEIVWNVWOIVÄNSDIRNVÄIRVNRÄINRVNTIWTV NFKMIWEUQIUECNCECNANCAC NFKMIWEUQIUECNCECNANCAC COCIRNANCIANC CNÄCN COCIRNANCIANC CNÄCN CNONCA<NRUCINU CNONCA<NRUCINU ACNECI<URCU<RC ACNECI<URCU<RC FSFSFFSVKSCNÄSV FSFSFFSVKSCNÄSV VEVN<NVOIVBAIRVNIOÄRNVÄVNWRUWR4584VAS VEVN<NVOIVBAIRVNIOÄRNVÄVNWRUWR4584VAS KCNNVBT7VAWNJJVB8WURVERVÖITVWRVIQVBB KCNNVBT7VAWNJJVB8WURVERVÖITVWRVIQVBB W7RVBÖBUBUAWEÖW57BVVBDFHVSHFHHHHHU W7RVBÖBUBUAWEÖW57BVVBDFHVSHFHHHHHU RYVBHNVHFVÖALSVV RYVBHNVHFVÖALSVV FVNÅV9V3VSC FVNÅV9V3VSC NVDSFSBVAÖSFDVÖWLUFVFÖWVAÖSKJDCVKWB NVDSFSBVAÖSFDVÖWLUFVFÖWVAÖSKJDCVKWB ERÖÖÖ ERÖÖÖ C SDFHVBSAYVBWEsd C SDFHVBSAYVBWEsd sd sd sddddddddddddddddddddddddddsswrwekrllköfks sddddddddddddddddddddddddddsswrwekrllköfks LFJSRVIOUYVBSFIVHBWIUERVBHILSHFVIWBVIF LFJSRVIOUYVBSFIVHBWIUERVBHILSHFVIWBVIF 21 Model Compiler Archetypes (Templates & Rules) xtuml Model Marks (Translation Control) Mechanisms (Class Components, Execution Control,...) Ada95 SPARK Ada C C++ Ada2005 VHDL SystemC Generation Database Doc Mapping Generator Build Info Source Code (Ada95, VHDL, ) Compiler/ Build Tools Manual/ Automatic Implementation Mapping Executable System Legend = PIM-Related Tools = Architecture-Related Tools = Implementation and Build-Related Tools/Activities xtuml Model Debugger
What has MDA and xtuml Delivered? Executable models/specifications (with an abstract and executable action language) Early validation of specifications execute the models while building them, without code generation Raised abstraction-level to a suitable level for each subject matter Reuse of applications across architectures and platforms capturing corporate knowledge of the company s applications without muddling them with implementation details Translation of executable models/specifications to implementations Possibility for repartitioning of functionality across a platform, e.g. between software and hardware Retargeting of functionality to new/modified platforms Reuse of architectural patterns across applications capturing corporate knowledge of the company s architectures and platforms Consistency between models, documentation and code Integration of systems, software and electronics engineering disciplines Raises the productivity Shortens the development time Gives cost effectiveness + competitive edge Increases product quality Increases flexibility in building systems (And it s a lot of fun too! ) 22
Vision: Platform-Independent Multi-System Translation System 1 Design Marking 1 System Specification System 2 Design Marking 2 Bridge Mapping 1 Realised Domain Domain xtuml Domain Model Realised Bridge Mappings2 Architecture Ada MC + Generator Ada/HDL MC Msl MC + Generator BP Build Tools GNAT Pro HDL Synthesis AdaMULTI AdaMULTI Implementation Application SW Application SW Application SW Software Platform GNAT Ada RTS SUN Solaris GH Ada RTS BSP GH Ada RTS BSP Hardware Platform SUN Sparc Workstation System 1 Same Functionality, Different Realisations Implementation System 2 Memory PowerPC PCI PowerPC FPGA Application FPGA Memory Network 23 Hardware
References Mellor/Scott/Uhl/Weise MDA Distilled Principles for Model Driven Architecture, 2004 overall principles of MDA Mellor/Balcer - Executable UML - A Foundation for Model-Driven Architecture, 2002 the official book about Executable UML Leon Starr - Executable UML, a case study, a hands-on example project Leon Starr - Executable UML - How to Build Class Models, 2001 book about Information Modelling with Executable UML www.omg.org/mda the official Object Management Group MDA home page SMUG2004 Conference Presentations Mentor Graphics www.mentor.com Erik Wedin, Saab Bofors Dynamics Evolving / Formalizing / Automating an Embedded Real-Time Software Architecture - The Leap from Hand-Coding to Automatic Code Translation with Retained Control over the Code Generation Process Anders Eriksson, Saab Bofors Dynamics Experiences from the First Step in Designing an Architecture Executing Executable UML Semantics in Programmable Logic Using VHDL 24
www.saabgroup.com 25