SlideShare a Scribd company logo
QGen: Simulink® static verification 
and code generation 
Presented by 
Matteo Bordin 
bordin@adacore.com
What is QGen? 
A qualifiable and customizable code generator from 
Simulink® and Stateflow® to SPARK and MISRA C 
A formal model verifier for runtime errors and functional properties 
An extendable framework to integrate heterogeneous models
Main features 1/2 
Support for a large subset of Simulink® 
Around 120 blocks, optional checks for MISRA Simulink® 
Stateflow® support expected in Spring 2015 
Code generation for SPARK and MISRA C 
Readable and traceable code, no performance penalty 
Ships with static model verifier 
Run-time errors (divisions by zero, overflows, …) 
Logical errors (dead execution paths) 
Functional properties (Simulink® assertions blocks)
Main features 2/2 
Off-the-shelf qualification material 
Including validation against Simulink® simulation 
DO-178C, EN 50128, ISO-26262 TCL3 
Highly tunable thanks to visible intermediate representation 
“Plug-and-play” transformations using Eclipse tools or XML manipulation 
Optimized code generation 
Generation of additional artifacts: Makefiles, docs, metrics, … 
Integrating with UML/SysML/AADL or in house DSLs
Product development history 1/2 
France and EU -funded collaborative R&D project 
From October 2011 to October 2015 
10M Euros total budget 
19 Partners 
Leader: Continental Automotive France
Product development history 2/2
How does QGen work? 1/2 
Simulink® model 
importer 
QGen intermediate representation (EMF metamodel) 
SPARK & MISRA C 
code generator 
model verifier
How does QGen work? 2/2 
Integrated in Matlab® (ideal for everyday use) 
From command line (does not require Matlab®, ideal for regression testing) 
qgenc MyModel.mdl [code-generation-options]
QGen and DO-178 
DO-330 (Tool Qualification Document) 
Precise identification of certification credit for code generator qualification 
Identification of credit w.r.t qualification strategy (TQL1 vs TQL5)
Using QGen - Verification 
Simulink® model 
QGen intermediate representation 
Verification 
Formalism 
importer 
model verifier 
Verification results 
round-trip 
Advanced 
+ 
traceability data 
*already qualified as part of a DO-178 Verification Tool / TQL5 
Verification 
Engine*
Using QGen - finding bugs 
No defensive modeling against division by zero
Using QGen - verifying functional properties 
ON OFF 
TRUE ERROR OK 
FALSE OK OK 
Brake OR 
Clutch 
Cruise Control 
The Cruise Control shall never be ON after 
the driver pushed the Brake or clutch pedal
Using QGen - verifying functional properties 
Formalization of safety property 
System implementation 
The Cruise Control shall never be ON after 
the driver pushed the Brake or clutch pedal
Using QGen - mixing proof & test 
Integration of legacy code via S-Function blocks 
How to prove the complete system (model + legacy code) is safe? 
How to extract model-relevant properties from legacy code? 
S-Functions written in C 
Difficult to automatically extract information 
Source code may not be available 
Rely on design-by-contact 
Wrap C code in automatically generated Ada stubs 
Decorate Ada stubs using pre/post conditions 
Rely on pre/post conditions for model verification 
Test C code against pre/post conditions
Using QGen - mixing proof & test 
S-Function written in C
Using QGen - mixing proof & test 
Availability of Static Analysis 
C S-Function Incomplete Model Static Analys 
C S-Function with Ada 2012 wrapper 
(design by contract) 
Static Analysis for Model 
Test for S-Function 
Ada S-Function 
Static Analysis on both Model 
and Source code 
Static Analysis holds for both 
C and Ada code generation!
Using QGen - Code Generation
Using QGen - Code Generation 
Standard code generation 
One file for every atomic subsystem 
Variables are global (in .adb/.c files) 
Full inlining, to increase performances 
A single file for the entire system 
All function calls are inlined 
Less memory consumption, less memory copy, more optimization 
Wrapping to reuse code with different I/O 
Corresponds to Simulink “generate reusable code” 
Pass persistent state and I/O as formal parameters 
Allows reusing the same code for multiple I/O data
QGen - an open and extensible framework 
Simulink Model 
Black Box 
Source Code 
Source Code 
Traditional Code Generators 
Simulink Model 
Access to intermediate representations 
Makefile 
generation 
Processor 
customization 
Modeling standard 
checking 
Additional 
verification 
Integration with UML 
Extract traceability 
data
Customizing QGen: use case 1 
A new processor is adopted, which provides intrinsic optimized functions 
Ex.: saturated sum 
How to reuse existing models? 
While benefitting from new processor functionalities? 
Relying on S-Functions requires changing them 
And potentially re-execute some verification activities! 
We rather change the code generator!
Customizing QGen: use case 1 
Exploit process-specific instructions 
… 
-- inlined code for saturated sum 
tmp := a + b; 
if tmp > Int16’Last then 
out := Int16’Last; 
elsif tmp < Int16’First then 
out := Int16’First; 
else 
out := tmp; 
end if; 
… 
… 
-- use processor-specific lib 
out := zaddwss (a, b); 
…
Customizing QGen: use case 1 
Intermediate 
representation 1 
Intermediate 
representation 2 
Intermediate 
representation 3 
Intermediate 
representation 4 
Intermediate 
representation 5 
Intermediate 
representation 6 
Source Code 
>> qgenc myModel.mdl —steps psgdxe 
>> python custom_saturate.py myModel_x.xmi 
>> qgenc myModel_x.xmi —language ada 
ECore-compliant 
XMI 
Python Script 
(150 SLOC)
Customizing QGen: use case 2 
Communication between control engineers and software architects 
Simulink models hide information relevant for software architecture 
Execution rates, data flow constraints, … 
How can this information be communicated to a software architect? 
Extraction of architectural concerns from Simulink model 
Extract AADL model out of Simulink 
Can be used to produce allocation models 
Can be used to execute real-time analysis
Customizing QGen: use case 2 
Intermediate 
representation 1 
ECore-compliant 
XMI 
Acceleo / ATL 
transformation 
>> qgen myModel.mdl —steps pe 
Extraction of real-time architectural constraints 
by generating an AADL model
QGen: roadmap 
2013 - 2014 
End of 2014 
February 2015 
Spring 2015 
Q4 2015 
evaluation by project P partners 
first selected customer pre-release 
QGen 1.0 available 
Stateflow® support 
full qualification material 
In the pipeline: static stack analysis, AUTOSAR, …
QGEN is the open, tunable and qualifiable 
model verifier and code generator 
for Simulink® and Stateflow® 
pre-release for selected customers: Q4 2014 
version 1.0: February 2015
QGen: Simulink® static verification 
and code generation 
Presented by 
Matteo Bordin 
bordin@adacore.com

More Related Content

What's hot

NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 PipelinesNIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
Ching-Hwa Yu
 
Software Engineering - RS2
Software Engineering - RS2Software Engineering - RS2
Software Engineering - RS2
AtakanAral
 
Randomization and Constraints - Workshop at BMS College
Randomization and Constraints - Workshop at BMS CollegeRandomization and Constraints - Workshop at BMS College
Randomization and Constraints - Workshop at BMS College
Ramdas Mozhikunnath
 
JedaOverview
JedaOverviewJedaOverview
JedaOverview
JEDAmarketing
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocks
Nirav Desai
 
Testing 1, 2, 3, ...
Testing 1, 2, 3, ... Testing 1, 2, 3, ...
Testing 1, 2, 3, ...
Wouter Lagerweij
 
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
Sung Kim
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testing
mahmoud ramadan
 
H S
H SH S
CPU Verification
CPU VerificationCPU Verification
CPU Verification
Ramdas Mozhikunnath
 
Tutor1
Tutor1Tutor1
Tutor1
Hung Nguyen
 
Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away
Abhishek Bakshi
 
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Continuous performance: Load testing for developers with gatling @ JavaOne 2016Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Tim van Eijndhoven
 
The_Little_Jenkinsfile_That_Could
The_Little_Jenkinsfile_That_CouldThe_Little_Jenkinsfile_That_Could
The_Little_Jenkinsfile_That_Could
Shelley Lambert
 
Why system verilog ?
Why system verilog ? Why system verilog ?
Why system verilog ?
Dr.YNM
 
Basics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesBasics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow Devices
Arrow Devices
 
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward
 
Model Checking History
Model Checking History Model Checking History
Model Checking History
Anit Thapaliya
 
Bangalore march07
Bangalore march07Bangalore march07
Bangalore march07
Obsidian Software
 
Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2
Prachi Sasankar
 

What's hot (20)

NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 PipelinesNIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
 
Software Engineering - RS2
Software Engineering - RS2Software Engineering - RS2
Software Engineering - RS2
 
Randomization and Constraints - Workshop at BMS College
Randomization and Constraints - Workshop at BMS CollegeRandomization and Constraints - Workshop at BMS College
Randomization and Constraints - Workshop at BMS College
 
JedaOverview
JedaOverviewJedaOverview
JedaOverview
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocks
 
Testing 1, 2, 3, ...
Testing 1, 2, 3, ... Testing 1, 2, 3, ...
Testing 1, 2, 3, ...
 
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testing
 
H S
H SH S
H S
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
Tutor1
Tutor1Tutor1
Tutor1
 
Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away
 
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Continuous performance: Load testing for developers with gatling @ JavaOne 2016Continuous performance: Load testing for developers with gatling @ JavaOne 2016
Continuous performance: Load testing for developers with gatling @ JavaOne 2016
 
The_Little_Jenkinsfile_That_Could
The_Little_Jenkinsfile_That_CouldThe_Little_Jenkinsfile_That_Could
The_Little_Jenkinsfile_That_Could
 
Why system verilog ?
Why system verilog ? Why system verilog ?
Why system verilog ?
 
Basics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesBasics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow Devices
 
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
 
Model Checking History
Model Checking History Model Checking History
Model Checking History
 
Bangalore march07
Bangalore march07Bangalore march07
Bangalore march07
 
Ide and datatypes vb-net-u-ii-p2
Ide and datatypes  vb-net-u-ii-p2Ide and datatypes  vb-net-u-ii-p2
Ide and datatypes vb-net-u-ii-p2
 

Similar to QGen GNAT Industrial User Day

Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGen
AdaCore
 
Automated Requirements-Based Testing for Medical Device Software
Automated Requirements-Based Testing for Medical Device SoftwareAutomated Requirements-Based Testing for Medical Device Software
Automated Requirements-Based Testing for Medical Device Software
QA Systems
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262
QA Systems
 
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
Edge AI and Vision Alliance
 
Automated Low Level Requirements Testing for DO-178C
Automated Low Level Requirements Testing for DO-178CAutomated Low Level Requirements Testing for DO-178C
Automated Low Level Requirements Testing for DO-178C
QA Systems
 
Automated Requirements-Based Testing for Medical Device Software.ppsx
Automated Requirements-Based Testing for Medical Device Software.ppsxAutomated Requirements-Based Testing for Medical Device Software.ppsx
Automated Requirements-Based Testing for Medical Device Software.ppsx
QA Systems
 
PyData Berlin 2023 - Mythical ML Pipeline.pdf
PyData Berlin 2023 - Mythical ML Pipeline.pdfPyData Berlin 2023 - Mythical ML Pipeline.pdf
PyData Berlin 2023 - Mythical ML Pipeline.pdf
Jim Dowling
 
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery LabsIncquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
IncQuery Labs
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
jamieayre
 
Presentation Verification & Validation
Presentation Verification & ValidationPresentation Verification & Validation
Presentation Verification & Validation
Elmar Selbach
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
Soham Mondal
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Ukraine
 
Code Generation with MDA and xUML
Code Generation with MDA and xUMLCode Generation with MDA and xUML
Code Generation with MDA and xUML
Chris Raistrick
 
Project P Open Workshop
Project P Open WorkshopProject P Open Workshop
Project P Open Workshop
matteobordinadacore
 
Tools for Test-Driven Product Modeling
Tools for Test-Driven Product ModelingTools for Test-Driven Product Modeling
Tools for Test-Driven Product Modeling
Tim Geisler
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
AdaCore
 
Rhapsody Software
Rhapsody SoftwareRhapsody Software
Rhapsody Software
Bill Duncan
 
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
SQUADEX
 
Incremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical SystemsIncremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical Systems
Ákos Horváth
 
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
Docker, Inc.
 

Similar to QGen GNAT Industrial User Day (20)

Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGen
 
Automated Requirements-Based Testing for Medical Device Software
Automated Requirements-Based Testing for Medical Device SoftwareAutomated Requirements-Based Testing for Medical Device Software
Automated Requirements-Based Testing for Medical Device Software
 
Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262 Automated requirements based testing for ISO 26262
Automated requirements based testing for ISO 26262
 
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
“A Practical Guide to Getting the DNN Accuracy You Need and the Performance Y...
 
Automated Low Level Requirements Testing for DO-178C
Automated Low Level Requirements Testing for DO-178CAutomated Low Level Requirements Testing for DO-178C
Automated Low Level Requirements Testing for DO-178C
 
Automated Requirements-Based Testing for Medical Device Software.ppsx
Automated Requirements-Based Testing for Medical Device Software.ppsxAutomated Requirements-Based Testing for Medical Device Software.ppsx
Automated Requirements-Based Testing for Medical Device Software.ppsx
 
PyData Berlin 2023 - Mythical ML Pipeline.pdf
PyData Berlin 2023 - Mythical ML Pipeline.pdfPyData Berlin 2023 - Mythical ML Pipeline.pdf
PyData Berlin 2023 - Mythical ML Pipeline.pdf
 
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery LabsIncquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
Incquery Suite Models 2020 Conference by István Ráth, CEO of IncQuery Labs
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
 
Presentation Verification & Validation
Presentation Verification & ValidationPresentation Verification & Validation
Presentation Verification & Validation
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
Code Generation with MDA and xUML
Code Generation with MDA and xUMLCode Generation with MDA and xUML
Code Generation with MDA and xUML
 
Project P Open Workshop
Project P Open WorkshopProject P Open Workshop
Project P Open Workshop
 
Tools for Test-Driven Product Modeling
Tools for Test-Driven Product ModelingTools for Test-Driven Product Modeling
Tools for Test-Driven Product Modeling
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
 
Rhapsody Software
Rhapsody SoftwareRhapsody Software
Rhapsody Software
 
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
Tooling for Machine Learning: AWS Products, Open Source Tools, and DevOps Pra...
 
Incremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical SystemsIncremental Queries and Transformations for Engineering Critical Systems
Incremental Queries and Transformations for Engineering Critical Systems
 
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
 

Recently uploaded

E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 

Recently uploaded (20)

E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 

QGen GNAT Industrial User Day

  • 1.
  • 2. QGen: Simulink® static verification and code generation Presented by Matteo Bordin bordin@adacore.com
  • 3. What is QGen? A qualifiable and customizable code generator from Simulink® and Stateflow® to SPARK and MISRA C A formal model verifier for runtime errors and functional properties An extendable framework to integrate heterogeneous models
  • 4. Main features 1/2 Support for a large subset of Simulink® Around 120 blocks, optional checks for MISRA Simulink® Stateflow® support expected in Spring 2015 Code generation for SPARK and MISRA C Readable and traceable code, no performance penalty Ships with static model verifier Run-time errors (divisions by zero, overflows, …) Logical errors (dead execution paths) Functional properties (Simulink® assertions blocks)
  • 5. Main features 2/2 Off-the-shelf qualification material Including validation against Simulink® simulation DO-178C, EN 50128, ISO-26262 TCL3 Highly tunable thanks to visible intermediate representation “Plug-and-play” transformations using Eclipse tools or XML manipulation Optimized code generation Generation of additional artifacts: Makefiles, docs, metrics, … Integrating with UML/SysML/AADL or in house DSLs
  • 6. Product development history 1/2 France and EU -funded collaborative R&D project From October 2011 to October 2015 10M Euros total budget 19 Partners Leader: Continental Automotive France
  • 8. How does QGen work? 1/2 Simulink® model importer QGen intermediate representation (EMF metamodel) SPARK & MISRA C code generator model verifier
  • 9. How does QGen work? 2/2 Integrated in Matlab® (ideal for everyday use) From command line (does not require Matlab®, ideal for regression testing) qgenc MyModel.mdl [code-generation-options]
  • 10. QGen and DO-178 DO-330 (Tool Qualification Document) Precise identification of certification credit for code generator qualification Identification of credit w.r.t qualification strategy (TQL1 vs TQL5)
  • 11. Using QGen - Verification Simulink® model QGen intermediate representation Verification Formalism importer model verifier Verification results round-trip Advanced + traceability data *already qualified as part of a DO-178 Verification Tool / TQL5 Verification Engine*
  • 12. Using QGen - finding bugs No defensive modeling against division by zero
  • 13.
  • 14. Using QGen - verifying functional properties ON OFF TRUE ERROR OK FALSE OK OK Brake OR Clutch Cruise Control The Cruise Control shall never be ON after the driver pushed the Brake or clutch pedal
  • 15. Using QGen - verifying functional properties Formalization of safety property System implementation The Cruise Control shall never be ON after the driver pushed the Brake or clutch pedal
  • 16.
  • 17. Using QGen - mixing proof & test Integration of legacy code via S-Function blocks How to prove the complete system (model + legacy code) is safe? How to extract model-relevant properties from legacy code? S-Functions written in C Difficult to automatically extract information Source code may not be available Rely on design-by-contact Wrap C code in automatically generated Ada stubs Decorate Ada stubs using pre/post conditions Rely on pre/post conditions for model verification Test C code against pre/post conditions
  • 18. Using QGen - mixing proof & test S-Function written in C
  • 19.
  • 20. Using QGen - mixing proof & test Availability of Static Analysis C S-Function Incomplete Model Static Analys C S-Function with Ada 2012 wrapper (design by contract) Static Analysis for Model Test for S-Function Ada S-Function Static Analysis on both Model and Source code Static Analysis holds for both C and Ada code generation!
  • 21. Using QGen - Code Generation
  • 22. Using QGen - Code Generation Standard code generation One file for every atomic subsystem Variables are global (in .adb/.c files) Full inlining, to increase performances A single file for the entire system All function calls are inlined Less memory consumption, less memory copy, more optimization Wrapping to reuse code with different I/O Corresponds to Simulink “generate reusable code” Pass persistent state and I/O as formal parameters Allows reusing the same code for multiple I/O data
  • 23.
  • 24. QGen - an open and extensible framework Simulink Model Black Box Source Code Source Code Traditional Code Generators Simulink Model Access to intermediate representations Makefile generation Processor customization Modeling standard checking Additional verification Integration with UML Extract traceability data
  • 25. Customizing QGen: use case 1 A new processor is adopted, which provides intrinsic optimized functions Ex.: saturated sum How to reuse existing models? While benefitting from new processor functionalities? Relying on S-Functions requires changing them And potentially re-execute some verification activities! We rather change the code generator!
  • 26. Customizing QGen: use case 1 Exploit process-specific instructions … -- inlined code for saturated sum tmp := a + b; if tmp > Int16’Last then out := Int16’Last; elsif tmp < Int16’First then out := Int16’First; else out := tmp; end if; … … -- use processor-specific lib out := zaddwss (a, b); …
  • 27. Customizing QGen: use case 1 Intermediate representation 1 Intermediate representation 2 Intermediate representation 3 Intermediate representation 4 Intermediate representation 5 Intermediate representation 6 Source Code >> qgenc myModel.mdl —steps psgdxe >> python custom_saturate.py myModel_x.xmi >> qgenc myModel_x.xmi —language ada ECore-compliant XMI Python Script (150 SLOC)
  • 28. Customizing QGen: use case 2 Communication between control engineers and software architects Simulink models hide information relevant for software architecture Execution rates, data flow constraints, … How can this information be communicated to a software architect? Extraction of architectural concerns from Simulink model Extract AADL model out of Simulink Can be used to produce allocation models Can be used to execute real-time analysis
  • 29. Customizing QGen: use case 2 Intermediate representation 1 ECore-compliant XMI Acceleo / ATL transformation >> qgen myModel.mdl —steps pe Extraction of real-time architectural constraints by generating an AADL model
  • 30. QGen: roadmap 2013 - 2014 End of 2014 February 2015 Spring 2015 Q4 2015 evaluation by project P partners first selected customer pre-release QGen 1.0 available Stateflow® support full qualification material In the pipeline: static stack analysis, AUTOSAR, …
  • 31. QGEN is the open, tunable and qualifiable model verifier and code generator for Simulink® and Stateflow® pre-release for selected customers: Q4 2014 version 1.0: February 2015
  • 32. QGen: Simulink® static verification and code generation Presented by Matteo Bordin bordin@adacore.com