主要内容

Model Advisor Checks for MISRA SLSF Modeling Standards

R2026b

The MISRA™ SLSF 2023 guidelines define best practices for modeling in Simulink® and Stateflow®. These guidelines help improve model correctness, readability, and long-term maintainability. They also promote a consistent modeling style across teams and reduce ambiguity in model behavior, especially for models intended for automatic code generation.

Model Advisor checks for MISRA SLSF 2023 focus on identifying modeling constructs, configuration settings, and structural patterns that affect determinism, clarity, and tool compatibility. The checks cover various modeling aspects, including model configuration, data typing, signal routing, block usage, execution order, and graphical layout in both Simulink and Stateflow.

The MISRA SLSF 2023 guidelines also include cross‑references to MathWorks Advisory Board (MAB) guidelines version 5.0.

To evaluate how well your model or subsystem aligns with MISRA based modeling practices for Simulink and Stateflow, open the Model Advisor and run the checks under By Task > MISRA Compliance > Modeling Standards for MISRA SLSF.

Running these checks requires Simulink, Stateflow, and Simulink Check™ licenses.

This table provides a cross-reference between MISRA SLSF 2023 rules and their corresponding MAB v5.0 checks. As of the R2026b release of Simulink Check, only those MISRA SLSF 2023 guidelines that have corresponding MAB v5.0 checks are supported.

MISRA SLSF Rule IDMISRA SLSF Rule NameModel Advisor ChecksCheck IDs
MISRA AC SLSF 002Data typesCheck output data type of operation blocksmathworks.jmaab.jc_0651
MISRA AC SLSF 004Diagnostic settingsCheck model diagnostic parametersmathworks.maab.jc_0021
MISRA AC SLSF 005Allowable Simulink blocksCheck for prohibited sink blocksmathworks.maab.hd_0001
MISRA AC SLSF 006Block parametersCheck usage of tunable parameters in blocksmathworks.maab.db_0110
MISRA AC SLSF 008Rounding and saturation in Simulink blocks
  • mathworks.jmaab.jc_0642

  • mathworks.jmaab.jc_0628

MISRA AC SLSF 010Arithmetic operation order
  • mathworks.jmaab.jc_0121

  • mathworks.jmaab.jc_0610

MISRA AC SLSF 012Switch blockCheck usage of Switch blocksmathworks.maab.jc_0141
MISRA AC SLSF 013Multiport switch blockCheck settings for data ports in Multiport Switch blocksmathworks.jmaab.jc_0630
MISRA AC SLSF 015Vector and matrix signalsCheck usage of vector and bus signalsmathworks.jmaab.na_0010
MISRA AC SLSF 016BusesCheck usage of vector and bus signalsmathworks.jmaab.na_0010
MISRA AC SLSF 017Unconnected blocks, signal lines and busesCheck for unconnected signal lines and blocksmathworks.jmaab.db_0081
MISRA AC SLSF 018Usage of From and Goto blocksCheck scope of From and Goto blocks mathworks.maab.na_0011
MISRA AC SLSF 020Text appearanceCheck model font settingsmathworks.jmaab.db_0043
MISRA AC SLSF 023Simulink block, subsystem, and library colorCheck for Simulink diagrams using nonstandard display attributesmathworks.maab.na_0004
MISRA AC SLSF 024Simulink block, subsystem, and library drop shadowCheck if blocks are shaded in the modelmathworks.jmaab.jc_0604
MISRA AC SLSF 026Simulink block, subsystem, and library naming
  • mathworks.maab.db_0140

  • mathworks.maab.db_0142

  • mathworks.maab.jc_0061

  • mathworks.jmaab.jc_0281

MISRA AC SLSF 027Signal and bus label usage
  • mathworks.jmaab.db_0097

  • mathworks.jmaab.jc_0009

  • mathworks.maab.na_0008

  • mathworks.maab.na_0009

MISRA AC SLSF 028Signal and bus label positioningCheck position of signal labelsmathworks.jmaab.db_0097
MISRA AC SLSF 029Signal and bus line positioningCheck position of signal labelsmathworks.jmaab.db_0097
MISRA AC SLSF 030Port locationCheck position of Inport and Outport blocksmathworks.jmaab.db_0042
MISRA AC SLSF 031Data flow and block orientationCheck signal flow in modelmathworks.maab.db_0141
MISRA AC SLSF 034Chart properties
  • mathworks.jmaab.na_0001

  • mathworks.jmaab.jc_0712

  • mathworks.jmaab.jc_0760

  • mathworks.jmaab.jc_0630

  • mathworks.jmaab.jc_0790

MISRA AC SLSF 036Stateflow/Simulink interface signals, parameters and namingCheck for names of Stateflow ports and associated signalsmathworks.maab.db_0123
MISRA AC SLSF 037Internal dataCheck definition of Stateflow datamathworks.jmaab.db_0125
MISRA AC SLSF 039StatesCheck for state in state machinesmathworks.jmaab.db_0137
MISRA AC SLSF 040Parallel statesCheck usage of parallel statesmathworks.jmaab.jc_0721
MISRA AC SLSF 042Default transitionsCheck default transition placement in Stateflow chartsmathworks.jmaab.jc_0531
MISRA AC SLSF 043Transitions
  • mathworks.jmaab.jc_0753

  • mathworks.jmaab.db_0132

  • mathworks.jmaab.jc_0773

MISRA AC SLSF 044State actionsCheck prohibited combination of state action and flow chartmathworks.jmaab.jc_0762
MISRA AC SLSF 045Condition actions, transition actions, and state actionsCheck condition actions and transition actions in Stateflowmathworks.jmaab.jc_0753
MISRA AC SLSF 048Stateflow coding
  • mathworks.jmaab.jc_0702

  • mathworks.maab.jm_0011

  • mathworks.jmaab.db_0127

MISRA AC SLSF 049Return values from graphical functionsCheck return value assignments in Stateflow graphical functionsmathworks.maab.jc_0511
MISRA AC SLSF 050Stateflow window and text appearance
  • mathworks.jmaab.db_0043

  • mathworks.jmaab.jc_0739

MISRA AC SLSF 051State chart and flow chart layoutCheck transitions in Stateflow Flow chartsmathworks.jmaab.db_0132
MISRA AC SLSF 052State labelling
  • mathworks.jmaab.jc_0730

  • mathworks.jmaab.jc_0732

MISRA AC SLSF 053Transition positioning
  • mathworks.jmaab.db_0129

  • mathworks.jmaab.jc_0775

MISRA AC SLSF 054Transition labelling
  • mathworks.jmaab.jc_0770

  • mathworks.jmaab.jc_0752

MISRA AC SLSF 055State action formattingCheck order of state action typesmathworks.jmaab.jc_0733