Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
www.mathworks.com
www.mathworks.com/sales_and_services
User community:
www.mathworks.com/matlabcentral
Technical support:
www.mathworks.com/support/contact_us
Phone:
508-647-7000
Revision History
March 2012
September 2012
March 2013
September 2013
March 2014
October 2014
March 2015
September 2015
Contents
1 Introduction ...................................................................................................................................... 1-1
1.1 Simulink Code Inspector Product Description ........................................................................ 1-2
2 Operational Requirements ................................................................................................................ 2-1
2.1 Code Inspector Report Operational Requirements .................................................................. 2-2
2.2 Code Inspection User Information ........................................................................................ 2-11
3 Installation ........................................................................................................................................ 3-1
4 Operational Environment ................................................................................................................. 4-1
vi
1 Introduction
This document comprises the Tool Operational Requirements (Reference DO-330 Section
10.3.1) for the following capabilities of the Simulink Code Inspector verification product:
This document is intended for use in the DO-330 tool qualification process for TQL-4 tools. The
applicant needs to:
Review the Tool Operational Requirements for applicability in the project or program
under consideration.
Configure the Tool Operational Requirements in the project or programs configuration
management system.
Complete the Tool Operational Requirements and make the document available for review.
For more information about the following products, see the MathWorks Documentation Center,
R2015b:
Simulink Code Inspector automatically compares generated code with its source model to
satisfy code-review objectives in DO-178 and other high-integrity standards. The code inspector
systematically examines blocks, state diagrams, parameters, and settings in a model to determine
whether they are structurally equivalent to operations, operators, and data in the generated code.
Simulink Code Inspector provides detailed model-to-code and code-to-model traceability
analysis. It generates structural equivalence and traceability reports that you can submit to
certification authorities to satisfy DO-178 software coding verification objectives.
Key Features
1-2
1-3
1-4
2 Operational Requirements
Code inspection automatically compares generated code with its source model to satisfy codereview objectives in DO-178C/DO-331 and other high-integrity standards. The code inspection
process builds an in-memory representation of the model that is independent of the code
generation process. The Simulink Code Inspector systematically examines blocks, parameters,
and settings in a model to determine whether they are structurally equivalent to operations,
operators, and data in the generated code, and generates reports that can be used to support
software certification.
2-2
Prior to code inspection, the Simulink Code Inspector provides compatibility checks to verify
model compatibility with code inspection. The model incompatibilities are either fatal or
nonfatal.
Code generated from models with fatal incompatibilities cannot be verified. The user
is notified with a message and code inspection terminates.
Code generated from models with nonfatal incompatibilities can be partially verified.
Although it might not be possible to fully verify the generated code, code inspection
continues.
The aspects of a Simulink model that are analyzed by code inspection include the following:
The following table lists the Simulink Code Inspector capabilities that are supported by the DO
Qualification Kit. The user is responsible for ensuring that the tool features they rely on to
eliminate, reduce or automate the process are sufficiently covered by Tool Operational
Requirements (reference DO-300 Section 6.2.1.aa).
2-3
Requirement
Example of
Detectable Condition
Limitations
None
INVSRCCODE
MDLFATAL
MDLNONFATAL
NONFATALCHOICE
None
None
Model Interface
MDLINTFUNCGEN
MDLINTDATAGEN
MDLINTFUNCSIG
MDLINTIOGEN
Block Behavior
2-4
Requirement ID
BLKCOMPS
Requirement
Example of
Detectable Condition
Limitations
Code for a Unit Delay block does not None for blocks supported
include code for updating its state
for inspection.*
variable.
Code includes two independent
addition operations that trace to the
same Sum block.
Simulink Code Inspector shall verify Stateflow does not generate a control
that the generated code execution
flow with more than 1 default
order and execution paths represent transition.
the execution order and execution
paths in the Stateflow Chart.
2-5
Requirement ID
Requirement
Example of
Detectable Condition
SFSTATES
SFTRANSITION
SFJUNCTION
SFDATA
SFEVENT
SFGRAPHFUNC
SFSLFUNC
SFTRUTHTABLE
Limitations
2-6
Requirement ID
Requirement
Example of
Detectable Condition
Limitations
MLFUNCFLOW
A statement in a user-defined
function inside a MATLAB function
block uses the second element in an
array. However, in the generated
code, the third element is used.
MLFUNCDATA
MLFUNCOPER
MLFUNUSER
BLKDATADEFUSE
BLKINPUT
2-7
Requirement ID
Requirement
Example of
Detectable Condition
Limitations
BLKINDEX
None
None
BLKEXEORDER
BLKMULTIRATE
None
SIGOBJGLOB
PARAMOBJAUTO
PARAMOBJTUNA
Code inspection is
supported for Simulink
global and other storage
classes with Custom
Storage Class types set to
Unstructured.
None
Code inspection is
supported for Simulink
global and other storage
classes with Custom
Storage Class types set to
Unstructured.
2-8
Requirement ID
Requirement
Example of
Detectable Condition
Limitations
PARAMINLINE
Local Variables
LCLVARUSED
SOLVERPANE
Simulink Code Inspector shall detect Model specifies a single sample time,
configuration parameter settings on but the generated code has multirate
the Solver Pane that are not
code.
compatible with code inspection.
DATAPANE
OPTPANE
DIAGPANE
HWPANE
See Configuration
Parameter Constraints in
the Simulink Code
Inspector Tool
Requirements, R2015b.
Configuration parameter
See Configuration
InitialState is set to , but the Parameter Constraints in
the Simulink Code
generated code has code for initial
Inspector Tool
state override.
Requirements, R2015b.
Configuration parameter
See Configuration
StateBitSets is set to off, but Parameter Constraints in
the generated code behaves as if this the Simulink Code
Inspector Tool
parameter is on.
Requirements, R2015b.
Configuration parameter
See Configuration
UnderspecifiedInitializat Parameter Constraints in
the Simulink Code
ionDetection is set to
Inspector Tool
Simplified, but the generated
code has code for Classic mode. Requirements, R2015b.
Configuration parameter
See Configuration
Parameter Constraints in
ProdBitPerShort is set to 16,
the Simulink Code
but the generated code uses 32.
Inspector Tool
Requirements, R2015b.
A referenced model has
None
ModelReferenceNumInstance
sAllowed set to Multi, but the
generated code for it has singleinstance code.
MODREFPANE
2-9
Requirement ID
Requirement
Example of
Detectable Condition
Limitations
CODEGENPANE
See Configuration
Parameter Constraints in
the Simulink Code
Inspector Tool
Requirements, R2015b.
2-10
For traceability between the operational requirements and tool requirements, see
qualkitdo_slci_tor_tr_trace.xlsx
To access these documents, on the MATLAB command line, type qualkitdo to open the
Artifacts Explorer. The documents are in Simulink Code Inspector.
2-11
2-12
3 Installation
To use the Simulink Code Inspector product, install the following MathWorks products:
MATLAB
Simulink
Simulink Code Inspector
To generate model code for inspection, install the following MathWorks products:
MATLAB Coder
Simulink Coder
Embedded Coder
Instructions for installing the products are available at the MathWorks Documentation Center,
R2015b:
Installation
3-2
4 Operational Environment
The DO Qualification Kit product supports the following operating environments for the
Simulink Code Inspector product:
Personal computer
One of the following operating systems:
Microsoft Windows
Linux1
MATLAB Software
Simulink Software
Simulink Code Inspector software