Skip to Main Content Skip to Search
Product Documentation

IEC 61508 and ISO 26262 Checks

IEC 61508 and ISO 26262 Checks Overview

IEC 61508 and ISO 26262 checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with IEC 61508-3 or ISO 26262–6.

The Model Advisor performs a checkout of the Simulink Verification and Validation license when you run the IEC 61508 or ISO 26262 checks.

Tips

If your model uses model referencing, run the IEC 61508 or ISO 26262 checks on all referenced models before running them on the top-level model.

See Also

Display model metrics and complexity report

Display number of elements and name, level, and depth of subsystems for the model or subsystem.

Description

The IEC 61508 and ISO 26262 standards recommend the usage of size and complexity metrics to assess the software under development. This check provides metrics information for the model. The provided information can be used to inspect whether the size or complexity of the model or subsystem exceeds given limits. The check displays:

See

Results and Recommended Actions

ConditionRecommended Action
N/A This summary is provided for your information. No action is required.

See Also

Check for unconnected objects

Identify unconnected lines, input ports, and output ports in the model.

Description

Unconnected objects are likely to cause problems propagating signal attributes such as data, type, sample time, and dimensions.

Ports connected to Ground or Terminator blocks pass this check.

See

Results and Recommended Actions

ConditionRecommended Action
There are unconnected lines, input ports, or output ports in the model or subsystem.
  • Double-click an element in the list of unconnected items to locate the item in the model diagram.

  • Connect the objects identified in the results.

See Also

Working with Signals in the Simulink documentation

Check for fully defined interface

Identify root model Inport blocks that do not have fully defined attributes.

Description

Using root model Inport blocks that do not have fully define dimensions, sample time, or data type can lead to undesired simulation results. Simulink back-propagates dimensions, sample times, and data types from downstream blocks unless you explicitly assign these values.

See

Results and Recommended Actions

ConditionRecommended Action
The model has root-level Inport blocks that have undefined attributes, such as an inherited sample time, data type, or port dimension.Explicitly define root-level Inport block attributes identified in the results. Double-click an element from the list of underspecified items to locate the condition.

Tips

The following configurations pass this check:

See Also

Check for questionable constructs

Identify blocks not supported by code generation or not recommended for deployment.

Description

This check partially identifies model constructs that are not suited for code generation or not recommended for production code generation as identified in the Simulink Block Support tables for Simulink Coder and Embedded Coder. If you are using blocks with support notes for code generation, review the information and follow the given advice.

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains blocks that should not be used for code generation. Consider replacing the blocks listed in the results. Double-click an element from the list of questionable items to locate condition.
The model or subsystem contains blocks that should not be used for production code deployment. Consider replacing the blocks listed in the results. Double-click an element from the list of questionable items to locate condition.
The model or subsystem contains Gain blocks whose value equals 1. If you are using Gain blocks as buffers, consider replacing them with Signal Conversion blocks. Double-click an element from the list of questionable items to locate condition.

Limitation

This check might not identify all instances of noncompliance with the Simulink Coder and Embedded Coder Simulink Built-In Blocks That Support Code Generation tables.

See Also

Check usage of Stateflow constructs

Identify usage of Stateflow constructs that might impact safety.

Description

This check identifies instances of Stateflow software being used in a way that can impact an application's safety, including:

Results and Recommended Actions

ConditionRecommended Action
A Stateflow chart is not configured for strong data typing on boundaries between a Simulink model and the Stateflow chart. (See hisf_0009: Strong data typing (Simulink and Stateflow boundary) IEC 61508-3 Table A.3 (2) - Strongly typed programming language, ISO/DIS 26262-6, Table 1 (1c) - Enforcement of strong typing, and MISRA-C:2004, Rules 10.1, 10.2, 10.3, and 10.4)In the Chart properties dialog box, select Use Strong Data Typing with Simulink I/O for the Stateflow chart. When you select this check box, the Stateflow chart accepts input signals of any data type that Simulink models support, provided that the type of the input signal matches the type of the corresponding Stateflow input data object.
Signals have names that differ from those of their corresponding Stateflow ports. (See IEC 61508-3, Table A.3 (3)- Language subset and ISO/DIS 26262-6, Table 1 (1b) - Use of language subsets)
  • Check whether the ports are connected and, if not, fix the connections.

  • Change the names of the signals or the Stateflow ports so that the names match.

Local data is not defined in the Stateflow hierarchy at the chart level or below. (See IEC 61508-3, Table A.3 (3)- Language subset and ISO/DIS 26262-6, Table 1 (1b) - Use of language subsets)Define local data at the chart level or below.

A new line is missing from a state action after:

  • An entry (en), during (du), or exit (ex) statement

  • The semicolon (;) at the end of an assignment statement

(See IEC 61508-3, Table A.3 (3)- Language subset and ISO/DIS 26262-6, Table 1 (1b) - Use of language subsets)

Add missing new lines.
Stateflow charts have User specified state/transition execution order cleared. (See hisf_0002: User-specified state/transition execution order, IEC 61508-3, Table A.3 (3) - Language subset, and ISO/DIS 26262-6, Table 1 (1b) - Use of language subsets, Table 1 (1f) - Use of unambiguous graphical representation)For the specified charts, in the Chart Properties dialog box, select User specified state/transition execution order.
Any of the following debugging options are cleared:
  • Enable debugging/animation

  • Enable overflow detection (with debugging)

  • State Inconsistency

  • Transition Conflict

  • Data Range

  • Detect Cycles

(See hisf_0011: Stateflow debugging settings, IEC 61508-3, Table A.7 (2) - Simulation/modeling, and ISO/DIS 26262-6 Table 1 (1d) - Use of defensive implementation techniques)

Select the debugging options.

In the Configuration Parameters dialog box, select:

  • Simulation Target > General > Enable debugging/animation

  • Simulation Target > General > Enable overflow detection (with debugging)

In the Stateflow Debugging dialog box, select:

  • State Inconsistency

  • Transition Conflict

  • Data Range

  • Detect Cycles

The Stateflow chart contains a data object identifier defined in two or more scopes. (See hisl_0061: Unique identifiers for clarity, IEC 61508-3, Table A.3 (3) - Language subset, Table A.4 (5) - Design and coding standards, ISO/DIS 26262-6, Table 1 (1b) - Use of language subsets, Table 1 (1e) - Use of established design principles, Table 1 (1h) - Use of naming conventions and MISRA-C:2004, Rule 5.6)For the identified chart, do one of the following:
  • Create a unique data object identifier within each of the scopes.

  • Create a unique data object identifier within the chart, at the parent level.

See Also

See the following topics in the Stateflow documentation:

See Stateflow Chart Considerations in the Simulink documentation.

Check state machine type of Stateflow charts

Identify whether Stateflow charts are all Mealy or all Moore charts.

Description

Compares the state machine type of all Stateflow charts to the type that you specify in the input parameters.

See

Input Parameters

Common

Check whether charts use the same state machine type, and are all Mealy or all Moore charts.

Mealy

Check whether all charts are Mealy charts.

Moore

Check whether all charts are Moore charts.

Results and Recommended Actions

ConditionRecommended Action
The input parameter is set to Common and charts in the model use either of the following:
  • Classic state machine types.

  • Multiple state machine types.

For each chart, in the Chart Properties dialog box, specify State Machine Type to either Mealy or Moore. Use the same state machine type for all charts in the model.
The input parameter is set to Mealy and charts in the model use other state machine types.For each chart, in the Chart Properties dialog box, specify State Machine Type to Mealy.
The input parameter is set to Moore and charts in the model use other state machine types.For each chart, in the Chart Properties dialog box, specify State Machine Type to Moore.

See Also

Check for model objects that do not link to requirements

Check whether Simulink blocks and Stateflow objects link to a requirements document.

See

Description

This check verifies whether Simulink blocks and Stateflow objects link to a document containing engineering requirements for traceability.

Results and Recommended Actions

ConditionRecommended Action
Blocks do not link to a requirements document.Link to requirements document. See Links Between Models and Requirements.

Limitations

When you run this check, the Model Advisor does not follow library links or look under masks.

Tip

Run this check from the top model or subsystem that you want to check.

See Also

Requirements Traceability

Check for inconsistent vector indexing methods

Identify blocks with inconsistent indexing method.

Description

Using inconsistent block indexing methods can result in modeling errors. You should use a consistent vector indexing method for all blocks. This check identifies blocks with inconsistent indexing methods. The indexing methods are zero-based, one-based or user-specified.

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains blocks with inconsistent indexing methods. The indexing methods are zero-based, one-based or user-specified.Modify the model to use a single consistent indexing method.

See Also

Check usage of Math Operations blocks

Identify usage of Math Operation blocks that might impact safety.

Description

This check inspects the usage of:

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains an Absolute Value block that is operating on a Boolean or an unsigned input data type. This condition results in unreachable simulation pathways through the model and might result in unreachable code.

For the identified block, do one of the following:

  • Change the input of the Absolute Value block to a signed input type.

  • Remove the Absolute Value block from the model.

The model or subsystem contains an Absolute Value block that is operating on a signed integer value, and the Saturate on integer overflow check box is not selected. For signed data types, the absolute value of the most negative value is problematic because it is not representable by the data type. This condition results in an overflow in the generated code.In the Block Parameters > Signal Attributes dialog box, select the Saturate on integer overflow check box.
The model or subsystem contains Gain blocks with a of value 1.If you are using Gain blocks as buffers, consider replacing them with Signal Conversion blocks.

Check usage of Signal Routing blocks

Identify usage of Signal Routing blocks that might impact safety.

Description

This check identifies model or subsystem Switch blocks that might generate code with inequality operations (~=) in expressions that contain a floating-point variable or constant.

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains a Switch block that might generate code with inequality operations (~=) in expressions where at least one side of the expression contains a floating-point variable or constant. The Switch block might cause floating-point inequality comparisons in the generated code.

For the identified block, do one of the following:

  • For the control input block, change the Data type parameter setting.

  • Change the Switch block Criteria for passing first input parameter setting. This might change the algorithm.

Check usage of Logic and Bit Operations blocks

Identify usage of Logical Operator and Bit Operations blocks that might impact safety.

Description

This check inspects the usage of:

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains a block computing a relational operator that is operating on different data types. The condition can lead to unpredictable results in the generated code. On the Block Parameters > Signal Attributes pane, set the Output data type to boolean for the specified blocks.
The model or subsystem contains a block computing a relational operator that uses the == or ~= operator to compare floating-point signals. The use of these operators on floating-point signals is unreliable and unpredictable because of floating-point precision issues. These operators can lead to unpredictable results in the generated code.

For the identified block, do one of the following:

  • Change the signal data type.

  • Rework the model to eliminate using == or ~= operators on floating-point signals.

The model or subsystem contains a Logical Operator block that has inputs or outputs that are not Boolean inputs or outputs. The block might result in floating-point equality or inequality comparisons in the generated code.
  • Modify the Logical Operator block so that the inputs and outputs are Boolean. On the Block Parameters > Signal Attributes pane, consider selecting Require all inputs to have the same data type and setting Output data type to boolean.

  • In the Configuration Parameters dialog box, on the Optimization pane, consider selecting the Implement logic signals as boolean data (vs. double).

See Also

Check usage of Ports and Subsystems blocks

Identify usage of Ports and Subsystems blocks that might impact safety.

Description

This check inspects the usage of:

See

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains a For Iterator block that has variable iterations. This condition can lead to unpredictable execution times or infinite loops in the generated code.For the identified For Iterator blocks, do one of the following:
  • Set the Iteration limit source parameter to internal.

  • If the Iteration limit source parameter must be external, use a Constant, Probe, or Width block as the source.

  • Clear the Set next i (iteration variable) externally check box.

  • Consider selecting the Show iteration variable check box and observe the iteration value during simulation.

The model or subsystem contains a While Iterator block that has unlimited iterations. This condition can lead to infinite loops in the generated code. For the identified While Iterator blocks:
  • Set the Maximum number of iterations (-1 for unlimited) parameter to a positive integer value.

  • Consider selecting the Show iteration number port check box and observe the iteration value during simulation.

The model or subsystem contains an If block with an If expression or Elseif expressions that might cause floating-point equality or inequality comparisons in generated code.Modify the expressions in the If block to avoid floating-point equality or inequality comparisons in generated code.
The model or subsystem contains an If block using Elseif expressions without an Else condition.In the If block Block Parameters dialog box, select Show else condition. Connect the resulting Else output port to an If Action Subsystem block.
The model or subsystem contains an If block with output ports that do not connect to If Action Subsystem blocks.Verify that output ports of the If block connect to If Action Subsystem blocks.
The model or subsystem contains an Switch Case block without a default case.In the Switch Case block Block Parameters dialog box, select Show default case. Connect the resulting default output port to a Switch Case Action Subsystem block.
The model or subsystem contains a Switch Case block with an output port that does not connect to a Switch Case Action Subsystem block.Verify that output ports of the Switch Case blocks connect to Switch Case Action Subsystem blocks.

See Also

Display configuration management data

Display model configuration and checksum information.

Description

This informer check displays the following information for the current model:

See

Results and Recommended Actions

ConditionRecommended Action
Could not retrieve model version and checksum information. This summary is provided for your information. No action is required.

See Also

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS