主要内容

Check for requirement granularity in a model

R2026b

mathworks.hism.hisl_0080

Since R2026b

Dependencies: Simulink® Check™ and Requirements Toolbox™

Usage: High-Integrity System Modeling

Guideline: hisl_0080: Establish requirement granularity in a model

Description

This check verifies the requirement granularity in Simulink, Stateflow®, and MATLAB® components.

It verifies that:

  • A component is limited to a configurable number of unique requirement links, as specified by the Maximum number of requirement links per component. The default limit is 5.

  • A component linked to a requirement is subject to the defined limits for child model elements or lines of code. The limits are:

    • Simulink — Up to 100 child elements, specified by Maximum number of child model elements per linked component (Simulink).

    • Stateflow — Up to 100 child elements, specified by Maximum number of child model elements per linked component (Stateflow).

    • MATLAB — Up to 200 lines of code, specified by Maximum number of lines of code per linked MATLAB function.

This check assumes that requirement links are attached to the components.

Elements under review: In this check, these elements are collectively referred to as components.

  • Simulink

    • Top-level block diagrams

    • Subsystems

    • MATLAB Function blocks

    • Area annotations

  • Stateflow

    • Charts

    • Superstates

    • Boxes

    • Simulink functions

    • Graphical functions

    • Simulink State

    • MATLAB functions

    • Truth Tables

  • MATLAB

    • Functions

  • Model Reference

    • Model Reference blocks

Check Parameters

Use the Model Advisor Configuration Editor to define the scope of the analysis by specifying the input parameters.

ParameterDescription
Check external .m files referenced in the model

Specify whether to run on externally referenced MATLAB files in the model.

on (default) | off

Follow links

Specify whether to include content of library-linked blocks in the analysis.

on (default) | off

Look under masks

Specify whether to include masked model elements in the analysis.

all (default) | none | graphical | functional

  • all — Check analysis includes all masked model elements.

  • none — Check analysis excludes masked model elements.

  • graphical — Check analysis includes only the graphical masked model elements.

  • functional — Check analysis includes only the functional masked model elements.

Maximum number of requirement links per component

Specify the maximum number of unique requirement links allowed for each component.

5 (default) | inf (disables the check) | positive integer value

Maximum number of child model elements per linked component (Simulink)

Specify the maximum number of child model elements allowed for each linked Simulink component.

100 (default) | inf (disables the check) | positive integer value

Maximum number of child model elements per linked component (Stateflow)

Specify the maximum number of child model elements allowed for each linked Stateflow component.

100 (default) | inf (disables the check) | positive integer value

Maximum number of lines of code per linked MATLAB function

Specify the maximum number of lines of code allowed for each linked MATLAB function.

200 (default) | inf (disables the check) | positive integer value

List of model elements exempt from requirement links

The model elements that can be exempted from requirement links. Add or remove blocks from the list by using the Add, Delete, and Add from buttons. By default, the list includes these blocks:

  • Ground

  • Terminator

  • Inport

  • Outport

  • InportShadow

  • Goto

  • From

  • Mux

  • Demux

  • CMBlock

  • DocBlock

  • System Requirements

Recommended Actions and Results

Review the violations that are flagged by the check and the recommended action for fixing the issue. After applying the changes, save the model and rerun the check analysis.

Modeling ConditionRecommended Action
Model component exceeds the maximum allowed number of requirement links.Decompose the component into smaller sub-components and redistribute requirement links for single responsibility.
Model component linked to a requirement exceeds the allowed number of child model elements.Decompose the component and associate child components with more granular child requirements.

Capabilities and Limitations

  • Runs on library models

  • Verifies only components that are linked to requirements

  • Does not verify the presence or placement of requirement links. To verify missing requirements, refer Check for components that are not linked to requirements.

  • Allows exclusions of blocks and charts

  • Analyzes both active and inactive variant choices

  • Does not require model compilation

Version History

Introduced in R2026b