Verification, Validation, and Test with Model-Based Design

Similar documents
Automatic Code Generation Technology Adoption Lessons Learned from Commercial Vehicle Case Studies

From Design to Production

A Model-Based Reference Workflow for the Development of Safety-Related Software

Jay Abraham 1 MathWorks, Natick, MA, 01760

DRYING CONTROL LOGIC DEVELOPMENT USING MODEL BASED DESIGN

Model-Based Design for Safety-Critical and Mission-Critical Applications Bill Potter Technical Marketing April 17, 2008

Automating Best Practices to Improve Design Quality

Automating Best Practices to Improve Design Quality

Guidelines for deployment of MathWorks R2010a toolset within a DO-178B-compliant process

Verification, Validation and Test in Model Based Design Manohar Reddy

Model-Based Design for Safety Critical Automotive Applications

Simulator in the-loop Environment for Autocode Verification

Verification and Validation of High-Integrity Systems

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Model-Based Design for High Integrity Software Development Mike Anthony Senior Application Engineer The MathWorks, Inc.

Introduction to Control Systems Design

Automatización de Métodos y Procesos para Mejorar la Calidad del Diseño

Verification and Test with Model-Based Design

Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer

Testing Framework with Simulink Test

Production Code Generation Introduction and New Technologies

Testing, Validating, and Verifying with Model-Based Design Phil Rottier

Development and Deployment of ECU based Control Systems through MBD. Imperative role of Model based design in System Engineering

Simulink to Embedded Hardware Paul Peeling MathWorks

Verification and Validation of Models for Embedded Software Development Prashant Hegde MathWorks India Pvt. Ltd.

Using Model-Based Design in conformance with safety standards

Testing and Validation of Simulink Models with Reactis

Developing AUTOSAR Compliant Embedded Software Senior Application Engineer Sang-Ho Yoon

Entwicklung zuverlässiger Software-Systeme, Stuttgart 30.Juni 2011

Tools and Methods for Validation and Verification as requested by ISO26262

Increasing Design Confidence Model and Code Verification

By Jason Ghidella, PhD, and Pieter J. Mosterman, PhD. Left Elevator. actuator. hydraulic system 1 left outer. left inner

Ein Modell - viele Zielsysteme

Workflow for Control System Design and Implementation

SCADE. SCADE Suite Tailored for Critical Applications EMBEDDED SOFTWARE

Using Cost Effective Distributed HIL for Rapid Prototyping

ID 020C: Hardware-in-Loop: System Testing Without the System

Volvo Car Group Jonn Lantz Agile by Models

개발과정에서의 MATLAB 과 C 의연동 ( 영상처리분야 )

Designing and Analysing Power Electronics Systems Using Simscape and SimPowerSystems

Team-Based Collaboration in Simulink Chris Fillyaw Application Engineer Detroit, MI

Introducing Simulink Release 2012b for Control System Development Mark Walker MathWorks

Final Presentation AUTOCOGEQ GMV, 2017 Property of GMV All rights reserved UNCLASSIFIED INFORMATION

Increasing Embedded Software Confidence Model and Code Verification. Daniel Martins Application Engineer MathWorks

APPLICATION OF THE V-CYCLE DEVELOPMENT IN THE AEROSPACE INDUSTRY

Four Best Practices for Prototyping MATLAB and Simulink Algorithms on FPGAs by Stephan van Beek, Sudhir Sharma, and Sudeepa Prakash, MathWorks

GAIO. Solution. Corporate Profile / Product Catalog. Contact Information

Developing Measurement and Control Applications with the LabVIEW FPGA Pioneer System

WHITE PAPER. 10 Reasons to Use Static Analysis for Embedded Software Development

Architecture-driven development of Climate Control Software LMS Imagine.Lab Embedded Software Designer Siemens DF PL

AVS: A Test Suite for Automatically Generated Code

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

Advanced AC Motor Control S/W Development Sang-Ho Yoon Senior Application Engineer The MathWorks

FULL VIRTUALIZATION OF RENAULT'S ENGINE MANAGEMENT SOFTWARE APPLICATION TO SYSTEM DEVELOPMENT

Simulink 를이용한 효율적인레거시코드 검증방안

Implementation and Verification Daniel MARTINS Application Engineer MathWorks

Simulink for AUTOSAR: Best Practices

Standardkonforme Absicherung mit Model-Based Design

Flight Software Development and Validation Workflow Management System

Certified Automotive Software Tester Sample Exam Paper Syllabus Version 2.0

정형기법을활용한 AUTOSAR SWC 의구현확인및정적분석

Design of a Flexible Integration Interface for PIL Tests

Automated Continuous Verification & Validation for Automobile Software

LMS Virtual.Lab Noise and Vibration

SIMULATION ENVIRONMENT

Collaboration in Teams: Simulink Projects Demonstration

Applications of Program analysis in Model-Based Design

Simulink as Your Enterprise Simulation Platform

ISO compliant verification of functional requirements in the model-based software development process

Modeling HDL components for FPGAs in control applications

Real-Time Testing in a Modern, Agile Development Workflow

A Matlab/Simulink Simulation Approach for Early Field-Programmable Gate Array Hardware Evaluation

automatisiertensoftwaretests

Complex Signal Processing Verification under DO-254 Constraints by François Cerisier, AEDVICES Consulting

Virtual Hardware ECU How to Significantly Increase Your Testing Throughput!

LabVIEW FPGA in Hardware-in-the-Loop Simulation Applications

Fault-Injection testing and code coverage measurement using Virtual Prototypes on the context of the ISO standard

Don t Be the Developer Whose Rocket Crashes on Lift off LDRA Ltd

What s New in MATLAB and Simulink Prashant Rao Technical Manager MathWorks India

Creating Human Machine Interface (HMI) Based Tests within Model-Based Design

Introduction to C and HDL Code Generation from MATLAB

On-Target Rapid Prototyping: A Practical Approach for Bootstrapping Production ECU Software Development

ISO Compliant Automatic Requirements-Based Testing for TargetLink

Team-Based Collaboration in Simulink

Structural Coverage Analysis for Safety-Critical Code - Who Cares? 2015 LDRA Ltd 1

Simulink 모델과 C/C++ 코드에대한매스웍스의정형검증툴소개 The MathWorks, Inc. 1

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Reuse MATLAB Functions and Simulink Models in UVM Environments with Automatic SystemVerilog DPI Component Generation

Effective Verification Strategies for Distributed Body Control Applications based on Plant Modeling and Test Case Reuse

A number of optimizations are already in use by the majority of companies in industry, notably:

Real-Time Workshop Embedded Coder 4

Plant modeling: A First Step to Early Verification of Control Systems

Model-Based Design for Large High Integrity Systems: A Discussion Regarding Model Architecture

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Generating Industry Standards Production C Code Using Embedded Coder

ITM DEVELOPMENT (ITMD)

Integrating Mechanical Design and Multidomain Simulation with Simscape

World Electric Vehicle Journal Vol. 5 - ISSN WEVA Page EVS26 Los Angeles, California, May 6-9, 2012

Model-Based Design for effective HW/SW Co-Design Alexander Schreiber Senior Application Engineer MathWorks, Germany

An Integrated Test Framework to Reduce Embedded Software Lifecycle Costs

Transcription:

2008-01-2709 Verification, Validation, and Test with Model-Based Design Copyright 2008 The MathWorks, Inc Tom Erkkinen The MathWorks, Inc. Mirko Conrad The MathWorks, Inc. ABSTRACT Model-Based Design with automatic code generation has long been employed for rapid prototyping and is increasing being used for mass production deployment. With the focus on production usage, comes the need to implement a comprehensive V&V strategy involving models and resulting code. A main principal of Model-Based Design is that generated code should behave like the simulation model. It should also be possible to verify that the model or design was fully implemented in the code. As a result, the transformation of models into generated code must be done in a way that facilitates traceability between the model and code. Also automated tests should be performed to determine that the code executes properly in its final software and hardware environments. For example in a typical commercial vehicle application, the control algorithm and plant model are simulated together in a system simulation environment. Once the system model satisfies the requirements, the control model is checked to ensure that it has been fully exercised or covered. Once checked, code is then generated for production applications. The code is analyzed, tested, and compared to the original model results. Common model and code verification activities include software-in-the-loop (SIL), processor-in-the-loop (PIL), and hardware-in-the-loop (HIL) testing. In addition to functional results, it is important especially for highintegrity systems, that the model and code have been checked and assessed to known standards. This paper describes recent advances in verification, validation, and test technologies involving Model-Based Design with production code generation. INTRODUCTION TO MODEL-BASED DESIGN A model represents a dynamic system whose response at any time is a mathematical function based on its inputs, current state, and current time. Historically, system engineers have used block diagrams as shown in Figure 1 to create models and design algorithms within numerous engineering areas such as Feedback Control and Signal Processing. In recent years, graphical modeling environments consisting of block diagrams and state machines have been used to analyze, simulate, prototype, specify, and deploy software algorithms within a variety of embedded systems and applications. Model- Based Design refers to the use of models and modeling environments as the basis for embedded system development. Input + - Embedded System Plant Environment Figure 1: Feedback controller model. Output Systems developed using Model-Based Design include: Commercial vehicle electronics Power plant regulators Digital motor controllers Model-Based Design is used throughout the system development life cycle and provides design flows that include continuous verification and validation of requirements, designs, and implementations. This approach is important for formal software processes such as IEC 61508 [1] and for other projects seeking error prevention and early error detection. The main development activities that occur during Model-Based Design include: Modeling and simulation Rapid prototyping Production code generation and integration Verification and validation (V&V) occurs continuously during Model-Based Design and includes many

activities. This article focus on two key activities: model checking and processor-in-the-loop testing. MODEL CHECKING An important group of model V&V activities comprise different static analyses and checking tools. Model advisors check a model for conditions and configuration settings that can result in inaccurate or slow simulation, problematic maintenance, or generation of inefficient production code. Reports are generated that list identified suboptimal conditions and settings. Advice is provided suggesting better modeling approaches and settings. There are several types of checks. Basic Model Checks: Automated model advice is provided using basic checks, requirements consistency checks, and industry model standard checks. Basic checks range from support for updating the model to be compatible with the current product release version, to identifying unconnected lines and ports, to checking the root model interfaces. To invoke the advisor, select the checks and then run them as shown in the left- and right-hand sides of Figure 2, respectively. Figure 3: Model advisor basic checks - results Requirements Consistency Checks: If the model is linked with requirements in third-party requirement management tools or databases, these checks identify inconsistent, missing, or changed requirements. Requirements consistency checks can also identify and repair requirements with missing documents and inconsistent requirements descriptions. See Figure 4. Figure 4: Requirements consistency checks Figure 2: Model advisor basic checks - invocation After performing the checks, results are displayed as shown in Figure 3. Hyperlinks are provided in the report, automating navigating to the dialog or menu where the setting can be adjusted based on the reported advice. The basic model checks should be performed and reported deviations considered before other quality assurance measures such as peer reviews or industry model standard checks are done. Modeling Standards Checks: Many projects use inhouse or industry specific software and modeling development standards. Model checks have already been developed for some industry standards including: DO-178B MAAB IEC 61508 DO-178B is an aerospace standard that will not be discussed here. MathWorks Automotive Advisory Board (MAAB) checks facilitate designing and troubleshooting models for automotive applications. A new version of MAAB was made available in 2007, MAAB v2.0.

MAAB checks include: Prohibited blocks inside controllers Port and signal name mismatches Unconnected signals IEC 61508 is a generic, application-independent standard for electrical / electronic / programmable electronic safety-related systems (E/E/PES) that is supposed to ease the development of sector-specific norms for E/E/PES. It is applied transitionally in the development of E/E/PES in those areas for which a domain-specific norm does not yet exist. IEC 61508-3 is concerned with the requirements for software development. IEC 61508 can be considered as a prescriptive standard, which provides detailed lists of techniques and measures with recommendations. IEC 61508 model checks analyze the model and report on items such as model usage, model metrics, and configuration management information as shown in Figure 5. of custom rule checks by engineers using Model-Based Design. PROCESSOR-IN-THE-LOOP TESTING Simulation of models is an early verification and validation (V&V) technique. Testing models via simulation is a more rigorous approach than the ad-hoc simulation runs used in early algorithm development. Model testing requires a systematic approach to test case creation and execution. Special blocks, such as signal builders and assertions, facilitate this type of rigorous test procedure. New capabilities for V&V on models now exist such as structural coverage analysis and test case generation. In-the-loop testing techniques allow one to reuse the model test cases and test environment for execution with the production application during various stages of integration. Software-in-the-loop (SIL) testing involves executing the production code for the controller within the modeling environment for non-real-time execution with the plant model and interaction with the user. The code executes on the same host platform that is used by the modeling environment. A code wrapper of the generated code provides the interface between the simulation and the generated code. See Figure 6. Figure 6: Software-in-the-loop testing. Figure 5: IEC 61508 checks - report Model Complexity Measurement allows one to measure the complexity of the entire model as well as the individual subsystems. Cyclomatic model complexity is a measure of the structural complexity of a model. It is calculated with the IEC 61508 checks and approximates the McCabe complexity measure for code generated from the model. Model complexity measurement helps to achieve a modular approach on the model level and especially to maintain an appropriate module size limit. Finally, if the built-in checks are not sufficient, a model advisor API is available that facilitates the development For hardware-in-the-loop (HIL) testing, the code is generated just for the plant model. It runs on a highly deterministic, real-time computer. Sophisticated signal conditioning and power electronics are needed to properly stimulate the ECU inputs (sensors) and receive the ECU outputs (actuator commands). Whereas rapid prototyping is often a development or design activity, HIL serves as a final lab test phase before final system integration and field tests commence. See Figure 7. Note that an on-target rapid prototyping and production code example using Model-Based Design based on case study by John Deere was presented at the SAE Commercial Vehicle conference in 2007 [2].

PIL testing can occur simultaneously with model testing or done separately. The tests can be interactive or done in batch mode via scripts. Batch processing is most convenient for repetitive, production tasks such as regressing testing. Plots comparing the model s functional (expected) results to the PIL (actual) results can be developed and analyzed. Integer or fixed-point results should be bitwise accurate. Floating point results will need to be assessed based on an acceptable margin of error, or epsilon. Differences in floating point results often occur between host and target platform due to factors such as variations in floating point math library implementation. Figure 7: Hardware-in-the-loop testing. Processor-in-the-loop (PIL) testing occurs after SIL but before HIL testing. As with SIL, PIL exercises the production code for the controller in non-real-time. However the code executes on the actual embedded processor or an instruction set simulator, using the embedded cross-compiler. Thus, it verifies the embedded object code functional behavior. With PIL, the model does a single calculation iteration. The inputs are calculated and passed to a PIL block. The PIL block serves as a conduit and passes the model inputs to the code running on the embedded microprocessor, or emulated processor if an instruction set simulator is used. Once the target processor receives the model inputs, it executes a single time step and computes the output data. The outputs are then passed back to model using the PIL block. The model then continues to simulate while the target processor waits for new inputs. See Figure 8 for a PIL example using an Instruction Set Simulator (ISS). One may execute PIL tests on multiple target platforms in order to assess an algorithm s robustness to variations in floating point implementations using various hardware, compiler, and even compiler version combinations. PIL is also useful for testing behavior that cannot be tested in a modeling environment. One example is the use of target optimized code. Some processors have special built-in instructions that are not ANSI or ISO-C compliant. These instructions may use special hardware on the processor that processes certain routines extremely fast, such as FFTs or IIRs used in signal processing applications. Some processors have built-in overflow protection for fixed-point calculations. When target optimized code is used within Model-Based Design, one cannot execute or test the final code within the host-based model simulation environment. With PIL, however, the optimized code can easily be tested using the modeling environment as the test harness. Figure 9 shows a PIL test occurring simultaneous with a model test and an output plot comparing the two results. Figure 8: Processor-in-the-loop testing. Figure 8: Processor-in-the-loop testing on the host

Figure 9: Processor-in-the-loop testing example

CONCLUSION Automatic code generation with Model-Based Design is an important technology that offers embedded system developers a number of advanced options for designing and deploying production software. Model-Based Design also provides a rich verification and validation environment for embedded systems. Recent techniques were described herein that support model checking and processor-in-the-loop tests. REFERENCES 1. IEC 61508-3:1998. International Standard IEC 61508 Functional safety of electrical/electronic/ programmable electronic safety-related systems Part 3: Software requirements. 1 st edition, 1998 2. Tom Erkkinen, The MathWorks, Scott Breiner, John Deere, Automatic Code Generation Technology Adoption Lessons Learned from Commercial Vehicle Case Studies, SAE CV 2007, 08AE-22, www.mathworks.com/mason/tag/proxy.html?dataid=9939&fileid=44540 2008 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.