FORC 3 ES. FMF October 10 th Contributors Forces 3: Pierre-Loïc Garoche, Thomas Loquen, Eric Noulard, Claire Pagetti, Clément Roos, Pierre Roux

Similar documents
System-level co-modeling AADL and Simulink specifications using Polychrony (and Syndex)

Simulink/Stateflow. June 2008

Clock-directed Modular Code-generation for Synchronous Data-flow Languages

An Introduction to Lustre

Programming Embedded Systems

Verifying a Lustre Compiler Part 2

The TASTE MBE development toolchain - update & case-studies

Towards an industrial use of FLUCTUAT on safety-critical avionics software

A Proposal for Verified Code Generation from Modelica

Industrial Verification Using the KIND Model Checker Lucas Wagner Jedidiah McClurg

This is an author-deposited version published in: Eprints ID: 10292

Gene-Auto development status and support

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

Modeling and Verification of Aircraft Stability Controller

Communication Patterns in Safety Critical Systems for ADAS & Autonomous Vehicles Thorsten Wilmer Tech AD Berlin, 5. March 2018

Automated Requirements-Based Testing

A Tabular Expression Toolbox for Matlab/Simulink

Modeling and Simulation for Heterogeneous systems

AUTOBEST: A microkernel-based system (not only) for automotive applications. Marc Bommert, Alexander Züpke, Robert Kaiser.

Static analysis of concurrent avionics software

Automating Best Practices to Improve Design Quality

Embedded software design with Polychrony

ExCuSe A Method for the Model-Based Safety Assessment of Simulink and Stateflow Models

Static Analysis of Embedded Systems

Synchronous Kahn Networks (ten years later)

From Design to Production

Predictable Timing of Cyber-Physical Systems Future Research Challenges

Synchronous Specification

Standardkonforme Absicherung mit Model-Based Design

SCADE. SCADE Suite Tailored for Critical Applications EMBEDDED SOFTWARE

Engineering of Reliable Software Systems

Automating Best Practices to Improve Design Quality

ANSYS SCADE 17.0 Solutions for ARINC 661-Compliant Systems

Approximate Computing with Runtime Code Generation on Resource-Constrained Embedded Devices

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

Using Model-Based Design in conformance with safety standards

Safety Assurance in Software Systems From Airplanes to Atoms

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

REDUCING CERTIFICATION GRANULARITY TO INCREASE ADAPTABILITY OF AVIONICS SOFTWARE

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

This project has received funding from the European Union s Horizon 2020 research and innovation programme under grant agreement No

Modular code generation from synchronous models:

INTEGRATING SYSTEM AND SOFTWARE ENGINEERING FOR CERTIFIABLE AVIONICS APPLICATIONS

Verification and Test with Model-Based Design

Institut Supérieur de l Aéronautique et de l Espace. TASTE Multi-core. ISAE / ONERA Jérôme Hugues / Claire Pagetti December 2016

On the Generation of Test Cases for Embedded Software in Avionics or Overview of CESAR

Testing. Lydie du Bousquet, Ioannis Parissis. TAROT Summer School July (TAROT 2009)

SCADE. SCADE 19.2 Solutions for ARINC 661 Compliant Systems. The ARINC 661 Standard EMBEDDED SOFTWARE

Memory optimisation in a first-order dataflow synchronous language

Using SCADE to Develop Mission-critical High-quality Radar Application Software

Safety Assessment ICAS 2010

AADL committee, Valencia October 2 nd, Pierre Dissaux (Ellidiss) Maxime Perrotin (ESA)

COMPLEX EMBEDDED SYSTEMS

Self-optimisation using runtime code generation for Wireless Sensor Networks

FPGAs in radiation-harsh environments

Analyse statique de programmes avioniques

SCADE S E M I N A R I N S O F T W A R E E N G I N E E R I N G P R E S E N T E R A V N E R B A R R

SCAlable & ReconfigurabLe Electronics platforms and Tools SCARLETT

Model-based Architectural Verification & Validation

S100 Series. Compact Smart Camera. High Performance: Dual Core Cortex-A9 processor and Xilinx FPGA. acquisition and preprocessing

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

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

Certification Authorities Software Team (CAST) Position Paper CAST-25

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

Off-line (Optimal) Multiprocessor Scheduling of Dependent Periodic Tasks

Fall 2014 SEI Research Review Verifying Evolving Software

SCADE. SCADE Architect System Requirements Analysis EMBEDDED SOFTWARE

An Eect Type System for Modular Distribution of Dataow Programs

HARDWARE GUIDE. Water Loop Controller C1000 Series. Specifications and Operational Guide

Automatic Architecture Hardening Using Safety Patterns

Verification and Validation of High-Integrity Systems

Verification, Validation, and Test with Model-Based Design

Turning proof assistants into programming assistants

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

Material: Weight: Bearing Life: Shaft Speed: Shaft Loads: Shock: Vibration: Bump:

Hardware Design of a Flight Control Computer System based on Multi-core Digital Signal Processor and Field Programmable Gate Array

FUNCTIONAL SAFETY FOR INDUSTRIAL AUTOMATION

Sensors & Transducers 2015 by IFSA Publishing, S. L.

Hiperface DSL Combined with Safety

M&S-based Triple Redundant FLCC Rapid Prototype Development

Visual tools to select a layout for an adapted living area

Basic Components of Digital Computer

Quality-of-Service Modeling and Analysis of Dependable Aplication Models

Test and Evaluation of Autonomous Systems in a Model Based Engineering Context

Esterel Studio Update

Modelling Security in UML/OCL for C2IS

Compositional Translation of Simulink Models into Synchronous BIP

Orccad, a Model Driven Architecture and Environment for Real-Time Control. Soraya Arias Florine Boudin Roger Pissard-Gibollet Daniel Simon

Compilation TP 0.0 : The target architecture: Digmips

PITOT / STATIC TESTER

Institut Supérieur de l Aéronautique et de l Espace Ocarina: update and future directions

FPGA for Software Engineers

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

Tsmart-BIPEX: An Integrated Graphical Design Toolkit for Software Systems

StackAnalyzer Proving the Absence of Stack Overflows

Model Checking of Aerospace Domain Models in an Industrial Context

Reconfiguration as a mean to enhance platform availability

Embedded Systems. 2. Software Development. Lothar Thiele. Computer Engineering and Networks Laboratory

From Analysis to Code Generation of Distributed Systems with a UML-Based Formal Environment Named TURTLE 2005

Taking the Right Turn with Safe and Modular Solutions for the Automotive Industry

Transcription:

FORC 3 ES Contributors Forces 3: Pierre-Loïc Garoche, Thomas Loquen, Eric Noulard, Claire Pagetti, Clément Roos, Pierre Roux FMF October 10 th 2017 1

Outline! Introduction 1. Project description 2. Example avion jaune! Safe code generation! Verification! Conclusion 2

Context " Certified embedded systems - Constraints on the development process / Verification objectives - Control-command application: safety critical system " Issues Safety At limited costs Technical means Automatisation Verification as early as possible in the process Formal verification (mathematical proof)

Application target " Targeted for civil aircrafts With certification constraints " Experimented on a UAV: «Avion jaune» 11kg (empty) 4m span 4h autonomy

Architecture Based in 3 micro-controllers ARM Cortex M3 (80MHz, Flash : 512Ko, internal RAM : 96Ko) 1 function #$ 1 micro-controller NAVIGATION : flight management PILOTE : commande SECOURS : hand over the manual pilot in case of problem 5

Objective of Forc 3 es " Formal development chain - Automated development - With verification at all stages - Dedicated to control-command systems - From control laws to embedded code " Global Optimisation - Bridging the gap between system and software - Carrying information to ease formal verification all along the way " Incrementality - Manage evolutions efficiently 6

Trends in avionic domain Control design level - Tools: Matlab / Simulink - High level requirements Implementation level - Coding of elementary blocks: Scade - Coding of multi-periodic assembly: home made language, manual coding, I/O (I2C, SPI, UART, USB,...) COTS hardware integration DDR3 Memory Controller 0,0 1,0 0,1 1,1 0,2 1,2 0,3 1,3 0,4 1,4 2,0 3,0 4,0 5,0 2,1 3,1 4,1 5,1 2,2 3,2 2,3 3,3 2,4 3,4 4,2 5,2 4,3 5,3 4,4 5,4 DDR3 Memory Controller - Automatic code generator - Manual code - Low level services - WCET assessment 0,5 1,5 2,5 3,5 4,5 5,5 4x GigaBit Ethernet 3x PCIe 2.0 7

Objective of the Forc3es Integrated Development Framework Control design level " " node voter (s1, s2, s3: real) returns (sensor: real); let verification : : : imported node syst ((s1, s2, s3: real) tel returns (sensor: real) wcet 5; node ex (i1 : rate(8,0); i2 : rate(20,0)) returns (01, 02); let ::: tel Steps: discrete models % choice of sampling periods performance properties % definition of simulation tests Integer properties% identification of invariants Tools: Matlab / Simulink Implementation level " Steps: Coding: automatic code generation - elementary blocks: Lustre - multi-periodic assembly: Prelude Verification - Performances : simulation with SchedMcore - Invariants analysis Integration level " Steps: Integration + test on the iron bird Integration on the real UAV

Outline! Introduction 1. Project description 2. Example avion jaune! Safe code generation! Verification! Conclusion 9

«Avion jaune» longitudinal control part " Nonlinear aircraft model (dynamic model + actuator) " Linearization around a flight point " Controller synthesis 10

«Avion jaune» longitudinal control part " control laws allowing speed control and altitude control 11

Performance properties " Altitude change request 12

Outline! Introduction! Safe code generation! Verification! Conclusion 13

Safe code generation " Principle: several tools & Simulink % synchronous languages: ONERA/NASA toolbox (CocoSim/ Sim2LustrePrelude) CocoSim & & Lustre % C: lustrec compiler (ONERA/ ENSEEIHT) Prelude%C: preludec compiler (ONERA/ LIFL) node voter (s1, s2, s3: real) Imported node syst ((s1, s2, s3: real) returns (sensor: real); returns (sensor: real) wcet 5; let node ex (i1 : rate(8,0); i2 : rate(20,0)) : : : tel lustrec returns (01, 02); let : : : tel preludec void voter_step(){ } void syst_step(){ }

1. Simulink $ synchronous language code generation " Principles: - Elementary blocks (gain, integrator, ) and mono-periodic assemblies % Lustre - Multi-periodic assemblies % Prelude " Software architecture language " With real-time primitives 1) Exploration of the Simulink architecture 2) Pretty-printing " ONERA/NASA toolbox (CocoSim) - Open source Matlab library - Input: Simulink - Outputs: Lustre / Prelude Lustre node voter (s1, s2, s3: real) returns (sensor: real); let - Advantages: optimized for and specific to ONERA/NASA controllers - Drawback: does not apply to any Simulink system : : : tel Imported node voter ((s1, s2, s3: real) returns (sensor: real) wcet 5; node ex (i1 : rate(8,0); i2 : rate(20,0)) returns (01, 02); let : : : tel Prelude

Translation tool: example UAV control design %file main.m % Data loading % UAV data include in AJ.mat load AJ T_env=1e-4; % UAV sample-time ('continuous' time) %load controller data controller_data; Fs=50; % Auto-pilot frequency [Hz] Ts=1/Fs; % Auto-pilot sample time [s] %name of the Simulink model simulink_model='bf_nl_discret'; %main routine; main node in Prelude, no comment cocosim(simulink_model, [], T_env, [], [],true, [],false); Results: synchronous language files bf_nl_discret_bloc.lus Lustre elementary nodes and mono-rate assembly bf_nl_discret_assemblage.plu Prelude assembly of multi-rate nodes

Simulink $ synchronous languages (main steps)

Simulink $ synchronous languages (main steps) Lustre node with state node example1_int1 (Sum_1_1 :real ) returns ( Int1_1_1 :real ) let Int1_1_1 = 0.200 -> (1.00 * 0.0100 * pre Sum_1_1) + pre Int1_1_1; tel origin_name: {'example1/int1'} name: {'example1/int1'} annotation: 1.5430e+03 type: { Integrator'} num_input: 1 num_output: 1 pre: {[1.5400e+03]} srcport: {[0]} post: {[1.5450e+03]} dstport: {[0]} rounding: 'Floor' prename: {{1x1 cell}} postname: {{1x1 cell}} sample_time: '0.01' srcport_size: 1 dstport_size: 1 inports_dt: {'double'} outports_dt: {'double'} inports_dim: [1 1] outports_dim: [1 1] conversion: {'double'} ismulti: 0 [...]

Simulink $ synchronous languages (main steps) Lustre node node example1_assemblage (I2_1_1, I1_1_1 :real) returns ( Y1_1 :real ) var Int1_1_1, K1_1_1, K2_1_1 :real ; let tel (Int1_1_1) = example1_int1( K1_1_1+K2_1_1) ; (K1_1_1) = 10*I1_1_1; (K2_1_1) = 0.1*I2_1_1; Y1_1 = Int1_1_1 ;

Simulink $ synchronous languages (main steps) Prelude node node example1_assemblage (Z_ref_1_1, Va_ref_1_1 :real rate (200,0)) returns ( q_1_1, gamma_1_1, Va_1_1, Vz_1_1, Z_1_1 :real ) var out1_1_1, out2_1_1:real ; let tel 20 (out1_1_1, out2_1_1) = control_laws(z_ref_1_1, Va_ref_1_1, (i1 fby (q_1_1, gamma_1_1, Va_1_1, Vz_1_1, Z_1_1))/^200, (i2 fby rpms) /^200) ; (q_1_1, gamma_1_1, Va_1_1, Vz_1_1, Z_1_1, rpms) = aircraft (out1_1_1 *^200, out2_1_1 *^200)

Related work " Many company internal code generators " GENE-AUTO & open-source code generation toolset (ITEA project) & & & input: Simulink, Stateflow or Scicos output: C or Ada; lustre (collaboration ONERA, IRIT, NASA) limits: - Matlab Simulink r2008b, no fancy blocks, no complex z-expressions, just unit delays - Translate from an output generated file (not directly playing with the internal Simulink representation) " Stavros Tripakis, Christos Sofronis, Paul Caspi, Adrian Curic. Translating discrete-time Simulink to Lustre. ACM Transaction Embedded Computing Systems 4(4): 779-818 (2005) 21

2. Lustre compiler (LustreC) " Output: C or Java " Open source implementation of Biernacki et al. [Dariusz Biernacki, Jean-Louis Colaço, Grégoire Hamon, and Marc Pouzet. Clock-directed modular code generation for synchronous data- flow languages. In Kriszti an Flautner and John Regehr, editors, LCTES, pages 121 130. ACM, 2008] " Collaboration with IRIT-ENSEEIHT (X. Thirioux) Available at cavale.enseeiht.fr/redmine/projects/lustrec " Compilation strategy " Same as Esterel Scade certified compiler " Less efficient than other compilation scheme but used in industry and certifiable " Provide traceability (and verification means)

3. Compilateur Prelude (Preludec) " Output: C " Open source implementation Collaboration with LIFL (J. Forget) and Airbus Defence and Space (D. Lesens) Available at https://svn.onera.fr/prelude " Compilation strategy Static communication buffers Shared memory or message passing 23

Outline! Introduction! Safe code generation! Verification! Conclusion 24

Verification activities 1 Property 1: " Performance analysis & simulation 2 Property 2: " Discrete properties verification & formal verification techniques verification node voter (s1, s2, s3: real) returns (sensor: real); let : : : tel Imported node voter (s1, s2, s3: real) returns (sensor: real) wcet 5; node ex (i1 : rate(8,0); i2 : rate(20,0)) returns (01, 02); let : : : tel 25

Property 1. Simulation at implementation level " SchedMcore open source ONERA tool http://sites.onera.fr/schedmcore/ " Objective " Simulation of the specification " Real-time constraints are assumed correct " Input " Lustre and Prelude programs (several assemblies can be encoded) " Results " Temporal simulations according to the scenario tests defined at control design level " if simulations are compliant, " high level properties are still satisfied " It simplifies the integration level

Implantation level: example UAV control design Define simulation parameters Complete the file bf_nl_discret_assemblage_include_sensors_actuators.c to select outputs to observe (actuators) and the value of inputs (sensors). Nominal flight point of the aircraft ' Airspeed Va=20m/s ' Altitude Z=100m. Requirements ' Airspeed =20m/s ' Altitude = 90m Use provided makefile to compile with Lustrec and Preludec. Results : binary loadable library libfilename.so (or generated C) usable by various tools : scheduling analysis tool functional simulator real-time executor target runtime (OS, supervisor, in-house runtime)

Simulation level: example UAV control design Simulation on 30s with a step time of 1e-4s lsmc_sim -l./libtest_bf_nl_discret_assemblage-noencoding.so -m 300000 Evolution of speed (left) and altitude (right)

Property 2: Automated Analysis framework for Simulink/Stateflow Motivation: CoCoSim: Automated Analysis and Compilation framework for Simulink/Stateflow 29

Safety properties analysis " Valid: model satisfies the specification " Invalid: model does not satisfy the specification " Counter-example: execution that violates the specification 30

Functioning 31

Functioning 32

Example 33

Example On SYS, Horn clause: (In1 >= In2 => Switch = In1) and (In1 < In2 => Switch = In2) and (Switch > 0 => abs = Switch) and (Switch < 0 => abs = -Switch) and (Out2 = Abs) and (Out1 = Switch) On SPEC, Horn clause: Req = ((In1 > In2) or (Out1 <= Out2)) On global: main and not Req => ERR Use of Z3 to query ERR 34

Example (real generated clause for SYS) (rule (=> (and (and (or (not (= (>= cocospec_3_pp_sys.in1_1_1 cocospec_3_pp_sys.in2_1_1) true)) (= cocospec_3_pp_sys.switch_1_1 cocospec_3_pp_sys.in1_1_1)) ) (or (not (= (>= cocospec_3_pp_sys.in1_1_1 cocospec_3_pp_sys.in2_1_1) false)) (= cocospec_3_pp_sys.switch_1_1 cocospec_3_pp_sys.in2_1_1)) (and (or (not (= (>= cocospec_3_pp_sys.switch_1_1 0) true)) ) (= cocospec_3_pp_sys.abs_1_1 cocospec_3_pp_sys.switch_1_1)) (or (not (= (>= cocospec_3_pp_sys.switch_1_1 0) false)) (= cocospec_3_pp_sys.abs_1_1 (- cocospec_3_pp_sys.switch_1_1))) (= cocospec_3_pp_sys.out2_2_1 cocospec_3_pp_sys.abs_1_1) (= cocospec_3_pp_sys.out1_1_1 cocospec_3_pp_sys.switch_1_1) ) (cocospec_3_pp_sys_fun cocospec_3_pp_sys.in1_1_1 cocospec_3_pp_sys.in2_1_1 cocospec_3_pp_sys.out1_1_1 cocospec_3_pp_sys.out2_2_1) )) 35

Outline! Introduction! Safe code generation! Verification! Conclusion 36

Conclusion and future work " Consolidation of ONERA/NASA toolbox " Execution on the iron bird and «avion jaune» 37

IronBird «avion jaune» " Iron Bird : une maquette à l échelle 3/8 du véritable Altimum (Société L avion jaune) Capteurs, actionneurs calculateur réel (sauf moteur) " Autoriser le développement rapide sur matériel réel et des essais en vol virtuel 38

IronBird HIL simulation Boucle fermée avec matériel réel (HIL) L environnement (JSBSim) et le modèle avion (ONERA) sont simulés et couplés à l IronBird La radio-commande, le calculateur bord et les servos moteur de l IronBird sont réels Visualisation «vol virtuel» avec FlightGear Logiciel de vol embarqué issu de la chaine de production ONERA pour FORCES3 39

Conclusion Thank you for your attention! 40