MathWorks Automotive Advisory Board Checks

MathWorks Automotive Advisory Board Checks

MathWorks® Automotive Advisory Board (MAAB) checks facilitate designing and troubleshooting models from which code is generated for automotive applications.

The Model Advisor performs a checkout of the Simulink® Verification and Validation™ license when you run the MAAB checks.

See Also

Check font formatting

Check for difference in font and font sizes.

Description

With the exception of free text annotations within a model, text elements, such as block names, block annotations, and signal labels, must have the same font style and font size. Select a font style and font size that is legible and portable (convertible between platforms), such as Arial or Times New Roman 12 point.

Available with Simulink Verification and Validation.

Input Parameters

Font Name

Apply the specified font to all text elements. When you specify Common (default), the check identifies different fonts used in your model. Although you can specify other fonts, the fonts available from the drop-down list are Arial, Courier New, Georgia, Times New Roman, Arial Black, and Verdana.

Font Size

Apply the specified font size to all text elements. When you specify Common (default), the check identifies different font sizes used in your model. Although you can specify other font sizes, the font sizes available from the drop-down list are 6, 8, 9, 10, 12, 14, 16.

Font Style

Apply the specified font style to all text elements. When you specify Common (default), the check identifies different font styles used in your model. The font styles available from the drop-down list are normal, bold, italic, and bold italic.

Results and Recommended Actions

ConditionRecommended Action
The fonts or font sizes for text elements in the model are not consistent or portable.Specify values for the font parameters and click Modify all Fonts, or manually change the fonts and font sizes of text elements in the model such that they are consistent and portable.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

Action Results

Clicking Modify all Fonts changes the font and font size of all text elements in the model according to the values you specify in the input parameters.

For the input parameters, if you specify Common, clicking Modify all Fonts changes the font and font sizes of all text elements in the model to the most commonly used fonts, font sizes, or font styles.

See Also

MAAB guideline db_0043: Simulink font and font size

Check Transition orientations in flow charts

Check transition orientations in flow charts.

Description

The following rules apply to transitions in flow charts:

  • Draw transition conditions horizontally.

  • Draw transitions with a condition action vertically.

Loop constructs are exceptions to these rules.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The model includes a transition with a condition that is not drawn horizontally or a transition action that is not drawn vertically.Modify the model.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0132: Transitions in flow charts

Check for nondefault block attributes

Identify blocks that use nondefault block parameter values that are not displayed in the model diagram.

Description

Model diagrams should display block parameters that have values other than default values. One way of displaying this information is by using the Block Annotation tab in the Block Properties dialog box.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Block parameters that have values other than default values, and the values are not in the model display.In the Block Properties dialog, use the Block Annotation tab to add block parameter annotations.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

Tip

If you use the add_block function with 'built-in/blocktype' as a source block path name for Simulink built-in blocks, some default parameter values of some blocks are different from the defaults that you get if you added those blocks interactively using Simulink.

See Also

Check signal line labels

Check the labeling on signal lines.

Description

You should use a label to identify:

  • Signals originating from the following blocks (the block icon exception noted below applies to all blocks listed, except Inport, Bus Selector, Demux, and Selector):

    Bus Selector block (tool forces labeling)
    Chart block (Stateflow)
    Constant block
    Data Store Read block
    Demux block
    From block
    Inport block
    Selector block
    Subsystem block

      Block Icon Exception   If a signal label is visible in the display of the icon for the originating block, you do not have to display a label for the connected signal unless the signal label is required elsewhere due to a rule for signal destinations.

  • Signals connected to one of the following destination blocks (directly or indirectly with a basic block that performs an operation that is not transformative):

    Bus Creator block
    Chart block (Stateflow)
    Data Store Write block
    Goto block
    Mux block
    Outport block
    Subsystem block
  • Any signal of interest.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Signals coming from Bus Selector, Chart, Constant, Data Store Read, Demux, From, Inport, or Selector blocks are not labeled.Double-click the line that represents the signal. After the text cursor appears, enter a name and click anywhere outside the label to exit label editing mode.

Capabilities and Limitations

You can run this check on your library models.

See Also

Check for propagated signal labels

Check for propagated labels on signal lines.

Description

You should propagate a signal label from its source rather than enter the signal label explicitly (manually) if the signal originates from:

  • An Inport block in a nested subsystem. However, if the nested subsystem is a library subsystem, you can explicitly label the signal coming from the Inport block to accommodate reuse of the library block.

  • A basic block that performs a nontransformative operation.

  • A Subsystem or Stateflow Chart block. However, if the connection originates from the output of an instance of the library block, you can explicitly label the signal to accommodate reuse of the library block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The model includes signal labels that were entered explicitly, but should be propagated. Use the open angle bracket (<) character to mark signal labels that should be propagated and remove the labels that were entered explicitly.

Capabilities and Limitations

You can run this check on your library models.

See Also

Check default transition placement in Stateflow charts

Check default transition placement in Stateflow charts.

Description

In a Stateflow chart, you should connect the default transition at the top of the state and place the destination state of the default transition above other states in the hierarchy.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The default transition for a Stateflow chart is not connected at the top of the state.Move the default transition to the top of the Stateflow chart.
The destination state of a Stateflow chart's default transition is lower than other states in the same hierarchy.Adjust the position of the default transition's destination state such that the state is above other states in the same hierarchy.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

Check return value assignments of graphical functions in Stateflow charts

Identify graphical functions with multiple assignments of return values in Stateflow charts.

Description

The return value from a Stateflow graphical function must be set in only one place.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The return value from a Stateflow graphical function is assigned in multiple places.Modify the specified graphical function so that its return value is set in one place.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

Check entry formatting in State blocks in Stateflow charts

Identify missing line breaks between entry action (en), during action (du), and exit action (ex) entries in states. Identify missing line breaks after semicolons (;) in statements.

Description

Start a new line after the entry, during, and exit entries, and after the completion of a statement ";".

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
An entry (en) is not on a new line.Add a new line after the entry.
A during (du) is not on a new line. Add a new line after the during.
An exit (ex) is not on a new line.Add a new line after the exit.
Multiple statements found on one line.Add a new line after each statement.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0501: Format of entries in a State block

Check usage of return values from a graphical function in Stateflow charts

Identify calls to graphical functions in conditional expressions.

Description

Do not use the return value of a graphical function in a comparison operation.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Conditional expressions contain calls to graphical functions.Assign return values of graphical functions to intermediate variables. Use these intermediate variables in the specified conditional expressions.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

Check for pointers in Stateflow charts

Identify pointer operations on custom code variables.

Description

Pointers to custom code variables are not allowed.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Custom code variables use pointer operations.Modify the specified chart to remove the dependency on pointer operations.

Capabilities and Limitations

  • This check applies only to Stateflow charts that use C as the action language.

  • You can:

    • Run this check on your library models.

    • Exclude blocks and charts from this check.

See Also

MAAB guideline jm_0011: Pointers in Stateflow

Check for event broadcasts in Stateflow charts

Identify undirected event broadcasts that might cause recursion during simulation and generate inefficient code.

Description

Event broadcasts in Stateflow charts must be directed.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Event broadcasts are undirected.Rearchitect the diagram to use directed event broadcasting. Use the send syntax or qualified event names to direct the event to a particular state. Use multiple send statements to direct an event to more than one state.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

Check transition actions in Stateflow charts

Identify missing line breaks between transition actions.

Description

For readability, start each transition action on a new line.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Multiple transition actions are on a single line.Verify that each transition action begins on a new line.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

Check for MATLAB expressions in Stateflow charts

Identify Stateflow objects that use MATLAB expressions that are not suitable for code generation.

Description

Do not use MATLAB functions, instructions, and operators in Stateflow objects.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Stateflow objects use MATLAB expressions.Replace MATLAB expressions in Stateflow objects.

Capabilities and Limitations

  • This check applies only to Stateflow charts that use C as the action language.

  • You can:

    • Run this check on your library models.

    • Exclude blocks and charts from this check.

See Also

Check for indexing in blocks

Check that blocks use consistent vector indexing.

Description

Check that blocks use consistent vector indexing. When possible, use zero-based indexing to improve code efficiency.

Available with Simulink Verification and Validation.

The check verifies consistent indexing for the following objects:

ObjectIndexing
  • Assignment block

  • For Iterator block

  • Find block

  • Multiport Switch block

  • Selector block

  • Zero-based indexing ([0, 1, 2, ...])

  • One-based indexing ([1, 2, 3,...])

  • Stateflow charts with C action language

Zero-based indexing ([0, 1, 2, ...])
  • MATLAB Function block

  • Fcn block

  • MATLAB System blocks

  • Truth tables

  • State transition tables

  • Stateflow charts with MATLAB action language

  • MATLAB functions inside Stateflow charts

One-based indexing ([1, 2, 3,...])

Results and Recommended Actions

ConditionRecommended Action
Objects in your model use one-based indexing, but can be configured for zero-based indexing.Configure objects for zero-based indexing.
Objects in your model use inconsistent indexing.If possible, configure objects for zero-based indexing. If your model contains objects that cannot be configured for zero-based indexing, configure objects for one-based indexing.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

See MAAB guideline db_0112: Indexing

Check file names

Checks the names of all files residing in the same folder as the model

Description

A file name conforms to constraints.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The file name contains illegal characters. Rename the file. Allowed characters are a–z, A–Z, 0–9. and underscore (_).
The file name starts with a number.Rename the file.
The file name starts with an underscore ("_"). Rename the file.
The file name ends with an underscore ("_"). Rename the file.
The file extension contains one (or more) underscores. Change the file extension.
The file name has consecutive underscores. Rename the file.
The file name contains more than one dot ("."). Rename the file.

Capabilities and Limitations

You can run this check on your library models.

See Also

MAAB guideline ar_0001: Filenames

Check folder names

Checks model directory and subdirectory names for invalid characters.

Description

A directory name conforms to constraints.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The directory name contains illegal characters. Rename the directory. Allowed characters are a–z, A–Z, 0–9. and underscore (_).
The directory name starts with a number. Rename the directory.
The directory name starts with an underscore ("_"). Rename the directory.
The directory name ends with an underscore ("_").Rename the directory.
The directory name has consecutive underscores. Rename the directory.

Capabilities and Limitations

You can run this check on your library models.

See Also

MAAB guideline ar_0002: Directory names

Check for prohibited blocks in discrete controllers

Check for prohibited blocks in discrete controllers.

Description

You cannot include continuous blocks in controller models.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Continuous blocks — Derivative, Integrator, State-Space, Transfer Fcn, Transfer Delay, Variable Time Delay, Variable Transport Delay, and Zero-Pole — are not permitted in models representing discrete controllers.Replace continuous blocks with the equivalent blocks discretized in the s-domain by using the Discretizing library, as explained in Discretize Blocks from the Simulink Model in the Simulink documentation.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jm_0001: Prohibited Simulink standard blocks inside controllers

Check for prohibited sink blocks

Check for prohibited Simulink sink blocks.

Description

You must design controller models from discrete blocks. Sink blocks, such as the Scope block, are not allowed.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Sink blocks are not permitted in discrete controllers. Remove sink blocks from the model.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline hd_0001: Prohibited Simulink sinks

Check positioning and configuration of ports

Check whether the model contains ports with invalid position and configuration.

Description

In models, ports must comply with the following rules:

  • Place Inport blocks on the left side of the diagram. Move the Inport block right only to prevent signal crossings.

  • Place Outport blocks on the right side of the diagram. Move the Outport block left only to prevent signal crossings.

  • Avoid using duplicate Inport blocks at the subsystem level if possible.

  • Do not use duplicate Inport blocks at the root level.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Inport blocks are too far to the right and result in left-flowing signals. Move the specified Inport blocks to the left.
Outport blocks are too far to the left and result in right-flowing signals. Move the specified Output blocks to the right.
Ports do not have the default orientation. Modify the model diagram such that signal lines for output ports enter the side of the block and signal lines for input ports exit the right side of the block.
Ports are duplicate Inport blocks.
  • If the duplicate Inport blocks are in a subsystem, remove them where possible.

  • If the duplicate Inport blocks are at the root level, remove them.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0042: Port block in Simulink models

Available with Simulink Verification and Validation.

Check for matching port and signal names

Check for mismatches between names of ports and corresponding signals.

Description

Use matching names for ports and their corresponding signals.

Available with Simulink Verification and Validation.

Prerequisite

Prerequisite MAAB guidelines for this check are:

Results and Recommended Actions

ConditionRecommended Action
Ports have names that differ from their corresponding signals. Change the port name or the signal name to match the name for the signal.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jm_0010: Port block names in Simulink models

Check whether block names appear below blocks

Check whether block names appear below blocks.

Description

If shown, the name of the block should appear below the block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have names that do not appear below the blocks. Set the name of the block to appear below the blocks.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0142: Position of block names

Check for mixing basic blocks and subsystems

Check for systems that mix primitive blocks and subsystems.

Description

You must design each level of a model with building blocks of the same type, for example, only subsystems or only primitive (basic) blocks. If you mask your subsystem and set MaskType to a non-empty string, the subsystem is seen as a basic block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
A level in the model includes both subsystem blocks and primitive blocks.

Move nonvirtual blocks into the subsystem.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0143: Similar block types on the model levels

Check for unconnected ports and signal lines

Check whether model has unconnected input ports, output ports, or signal lines.

Description

Unconnected inputs should be connected to ground blocks. Unconnected outputs should be connected to terminator blocks.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have unconnected inputs or outputs. Connect unconnected lines to blocks specified by the design or to Ground or Terminator blocks.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0081: Unconnected signals, block inputs and block outputs

Check position of Trigger and Enable blocks

Check the position of Trigger and Enable blocks.

Description

Locate blocks that define subsystems as conditional or iterative at the top of the subsystem diagram.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Trigger , Enable, and Action Port blocks are not centered in the upper third of the model diagram. Move the Trigger, Enable, and Action Port blocks to the upper third of the model diagram.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0146: Triggered, enabled, conditional Subsystems

Check usage of tunable parameters in blocks

Check whether tunable parameters specify expressions, data type conversions, or indexing operations.

Description

To make a parameter tunable, you must enter the basic block without the use of MATLAB calculations or scripting. For example, omit:

  • Expressions

  • Data type conversions

  • Selections of rows or columns

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have a tunable parameter that specifies an expression, data type conversion, or indexing operation. In each case, move the calculation outside of the block, for example, by performing the calculation with a series of Simulink blocks, or precompute the value as a new variable.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0110: Tunable parameters in basic blocks

Check Stateflow data objects with local scope

Check whether Stateflow data objects with local scope are defined at the chart level or below.

Description

You must define local data of a Stateflow block on the chart level or below in the object hierarchy. You cannot define local variables on the machine level; however, parameters and constants are allowed at the machine level.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Local data is not defined in the Stateflow hierarchy at the chart level or below. Define local data at the chart level or below.

Capabilities and Limitations

You can run this check on your library models.

See Also

MAAB guideline db_0125: Scope of internal signals and local auxiliary variables

Check for Strong Data Typing with Simulink I/O

Check whether labeled Stateflow and Simulink input and output signals are strongly typed.

Description

Strong data typing between Stateflow and Simulink input and output signals is required.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
A Stateflow chart does not use strong data typing with Simulink. Select the Use Strong Data Typing with Simulink I/O check box for the specified block.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0122: Stateflow and Simulink interface signals and parameters

Check usage of exclusive and default states in state machines

Check states in state machines.

Description

In state machines:

  • There must be at least two exclusive states.

  • A state cannot have only one substate.

  • The initial state of a hierarchical level with exclusive states is clearly defined by a default transition.

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline for this check is db_0149: Flow chart patterns for condition actions.

Results and Recommended Actions

ConditionRecommended Action
A system is underspecified.Validate that the intended design is represented in the Stateflow diagram.
Chart has only one exclusive (OR) state. Make the state a parallel state, or add another exclusive (OR) state.
Chart does not have a default state defined.Define a default state.
Chart has multiple default states defined. Define only one default state. Make the others nondefault.
State has only one exclusive (OR) substate. Make the state a parallel state, or add another exclusive (OR) state.
State does not have a default substate defined. Define a default substate.
State has multiple default substates defined. Define only one default substate, make the others nondefault.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline db_0137: States in state machines

Check Implement logic signals as Boolean data (vs. double)

Check the optimization parameter for Boolean data types.

Description

Optimization for Boolean data types is required

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline for this check is na_0002: Appropriate implementation of fundamental logical and numerical operations.

Results and Recommended Actions

ConditionRecommended Action
Configuration setting for Implement logic signals as boolean data (vs. double) is not set. Select the Implement logic signals as boolean data (vs. double) check box in the Configuration Parameters dialog box Optimization pane.

See Also

MAAB guideline jc_0011: Optimization parameters for Boolean data types

Check model diagnostic parameters

Check the model diagnostics configuration parameter settings.

Description

You should enable the following diagnostics:

Algebraic loop
Minimize algebraic loop
Inf or NaN block output
Duplicate data store names
Unconnected block input ports
Unconnected block output ports
Unconnected line
Unspecified bus object at root Outport block
Mux blocks used to create bus signals
Element name mismatch
Invalid function-call connection

Diagnostics not listed in the Results and Recommended Actions section below can be set to any value.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Algebraic loop is set to none.Set Algebraic loop on the Diagnostics > Solver pane of the Configuration Parameters dialog box to error or warning. Otherwise, Simulink might attempt to automatically break the algebraic loops, which can impact the execution order of the blocks.
Minimize algebraic loop is set to none. Set Minimize algebraic loop on the Diagnostics > Solver pane of the Configuration Parameters dialog box to error or warning. Otherwise, Simulink might attempt to automatically break the algebraic loops for reference models and atomic subsystems, which can impact the execution order for those models or subsystems.
Inf or NaN block output is set to none, which can result in numerical exceptions in the generated code. Set Inf or NaN block output on the Diagnostics > Data Validity > Signals pane of the Configuration Parameters dialog box to error or warning.
Duplicate data store names is set to none, which can result in nonunique variable naming in the generated code. Set Duplicate data store names on the Diagnostics > Data Validity > Signals pane of the Configuration Parameters dialog box to error or warning.
Unconnected block input ports is set to none, which prevents code generation. Set Unconnected block input ports on the Diagnostics > Data Validity > Signals pane of the Configuration Parameters dialog box to error or warning.
Unconnected block output ports is set to none, which can lead to dead code. Set Unconnected block output ports on the Diagnostics > Data Validity > Signals pane of the Configuration Parameters dialog box to error or warning.
Unconnected line is set to none, which prevents code generation. Set Unconnected line on the Diagnostics > Connectivity > Signals pane of the Configuration Parameters dialog box to error or warning.
Unspecified bus object at root Outport block is set to none, which can lead to an unspecified interface if the model is referenced from another model. Set Unspecified bus object at root Outport block on the Diagnostics > Connectivity > Buses pane of the Configuration Parameters dialog box to error or warning.
Mux blocks used to create bus signals is set to none, which can lead to an unintended bus being created in the model. Set Mux blocks used to create bus signals on the Diagnostics > Connectivity > Buses pane of the Configuration Parameters dialog box to error or warning.
Element name mismatch is set to none, which can lead to an unintended interface in the generated code. Set Element name mismatch on the Diagnostics > Connectivity > Buses pane of the Configuration Parameters dialog box to error or warning.
Invalid function-call connection is set to none, which can lead to an error in the operation of the generated code. Set Invalid function-call connection on the Diagnostics > Connectivity > Function Calls pane of the Configuration Parameters dialog box to error or warning, since this condition can lead to an error in the operation of the generated code.

See Also

MAAB guideline jc_0021: Model diagnostic settings

Check the display attributes of block names

Check the display attributes of subsystem and block names.

Description

Subsystem and block names should be displayed when providing descriptive information. The names should not be displayed if the block function is known from its appearance.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Name is obvious. Hide name by clearing Diagram > Format > Show Block Name.
Name is not descriptive. Modify name to be more descriptive or hide name by clearing Diagram > Format > Show Block Name.
Name is not displayed. Display name by selecting Diagram > Format > Show Block Name.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0061: Display of block names

Check display for port blocks

Check the Icon display setting for Inport and Outport blocks.

Description

The Icon display setting is required.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The Icon display setting is not set. Set the Icon display to Port number for the specified Inport and Outport blocks.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0081: Icon display for Port block

Check subsystem names

Check whether subsystem block names include invalid characters.

Description

The names of all subsystem blocks are checked for invalid characters.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The subsystem name contains illegal characters. Rename the subsystem. Allowed characters include a–z, A–Z, 0–9, underscore (_), and period (.).
The subsystem name starts with a number. Rename the subsystem.
The subsystem name starts with an underscore ("_").Rename the subsystem.
The subsystem name ends with an underscore ("_"). Rename the subsystem.
The subsystem name has consecutive underscores. Rename the subsystem.
The subsystem name has blank spaces. Rename the subsystem.

Capabilities and Limitations

  • You can:

    • Run this check on your library models.

    • Exclude blocks and charts from this check.

  • The check does not report invalid characters in subsystem names for:

    • Virtual subsystems

    • Atomic subsystems with Function Packaging set to Inline

Tips

Use underscores to separate parts of a subsystem name instead of spaces.

See Also

MAAB guideline jc_0201: Usable characters for Subsystem names

Check port block names

Check whether Inport and Outport block names include invalid characters.

Description

The names of all Inport and Outport blocks are checked for invalid characters.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The block name contains illegal characters. Rename the block. Allowed characters include a–z, A–Z, 0–9, underscore (_), and period (.).
The block name starts with a number. Rename the block.
The block name starts with an underscore ("_"). Rename the block.
The block name ends with an underscore ("_"). Rename the block.
The block name has consecutive underscores. Rename the block.
The block name has blank spaces. Rename the block.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

Tips

Use underscores to separate parts of a block name instead of spaces.

See Also

MAAB guideline jc_0211: Usable characters for Inport blocks and Outport blocks

Check character usage in signal labels

Check whether signal line names include invalid characters.

Description

The names of all signal lines are checked for invalid characters.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The signal line name contains illegal characters. Rename the signal line. Allowed characters include a–z, A–Z, 0–9, underscore (_), and period (.).
The signal line name starts with a number. Rename the signal line.
The signal line name starts with an underscore ("_"). Rename the signal line.
The signal line name ends with an underscore ("_"). Rename the signal line.
The signal line name has consecutive underscores. Rename the signal line.
The signal line name has blank spaces. Rename the signal line.
The signal line name has control characters. Rename the signal line.

Capabilities and Limitations

You can run this check on your library models.

Tips

Use underscores to separate parts of a signal line name instead of spaces.

See Also

MAAB guideline jc_0221: Usable characters for signal line names

Check character usage in block names

Check whether block names include invalid characters.

Description

The block names are checked for invalid characters.

This guideline does not apply to subsystem blocks.

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline for this check is jc_0201: Usable characters for Subsystem names.

Results and Recommended Actions

ConditionRecommended Action
The block name contains illegal characters. Rename the block. Allowed characters include a–z, A–Z, 0–9, underscore (_), and period (.).
The block name starts with a number. Rename the block.
The block name has blank spaces. Rename the block.
The block name has double byte characters. Rename the block.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

Tips

Carriage returns are allowed in block names.

See Also

MAAB guideline jc_0231: Usable characters for block names

Check Trigger and Enable block names

Check Trigger and Enable block port names.

Description

Block port names should match the name of the signal triggering the subsystem.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Trigger block does not match the name of the signal to which it is connected. Match Trigger block names to the connecting signal.
Enable block does not match the name of the signal to which it is connected. Match Enable block names to the connecting signal.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0281: Naming of Trigger Port block and Enable Port block

Check for Simulink diagrams using nonstandard display attributes

Check model appearance setting attributes.

Description

Model appearance settings are required to conform to the guidelines when the model is released.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The toolbar is not visible. Select View > Toolbar.
Wide Nonscalar Lines is cleared. Select Display > Signals & Ports > Wide Nonscalar Lines.
Viewer Indicators is cleared. Select Display > Signals & Ports > Viewer Indicators.
Testpoint Indicators is cleared. Select Display > Signals & Ports > Testpoint & Logging Indicators.
Port Data Types is selected. Clear Display > Signals & Ports > Port Data Types.
Storage Class is selected. Clear Display > Signals & Ports > Storage Class.
Signal Dimensions is selected. Clear Display > Signals & Ports > Signal Dimensions.
Model Browser is selected. Clear View > Model Browser > Show Model Browser.
Sorted Execution Order is selected. Clear Display > Blocks > Sorted Execution Order.
Model Block Version is selected. Clear Display > Blocks > Block Version for Referenced Models.
Model Block I/O Mismatch is selected. Clear Display > Blocks > Block I/O Mismatch for Referenced Models.
Library Links is set to Disabled, User Defined or All. Select Display > Library Links > None.
Linearization Indicators is cleared. Select Display > Signals & Ports > Linearization Indicators.
Block backgrounds are not white. Blocks should have black foregrounds with white backgrounds. Click the specified block and select Format > Foreground Color > Black and Format > Background Color > White.
Diagrams do not have white backgrounds. Select Diagram > Format > Canvas Color > White.
Diagrams do not have zoom factor set to 100%. Select View > Zoom > Normal (100%).

Action Results

Clicking Modify updates the display attributes to conform to the guideline.

See Also

MAAB guideline na_0004: Simulink model appearance

Check MATLAB code for global variables

Check for global variables in MATLAB code.

Description

Verifies that global variables are not used in any of the following:

  • MATLAB code in MATLAB Function blocks

  • MATLAB functions defined in Stateflow charts

  • Called MATLAB functions

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Global variables are used in one or more of the following:
  • MATLAB code in MATLAB Function blocks

  • MATLAB functions defined in Stateflow charts

  • Called MATLAB functions

Replace global variables with signal lines, function arguments, or persistent data.

See Also

MAAB guideline na_0024: Global Variables

Check visibility of block port names

Check the visibility of port block names.

Description

An organization applying the MAAB guidelines must select one of the following alternatives to enforce:

  • The name of port blocks are not hidden.

  • The name of port blocks must be hidden.

Available with Simulink Verification and Validation.

Input Parameters

All Port names should be shown (Format/Show Name)

Select this check box if all ports should show the name, including subsystems.

Results and Recommended Actions

ConditionRecommended Action
Blocks do not show their name and the All Port names should be shown (Format/Show Name) check box is selected. Change the format of the specified blocks to show names according to the input requirement.
Blocks show their name and the All Port names should be shown (Format/Show Name) check box is cleared. Change the format of the specified blocks to hide names according to the input requirement.
Subsystem blocks do not show their port names. Set the subsystem parameter Show port labels to a value other than none.
Subsystem blocks show their port names. Set the subsystem parameter Show port labels to none.

Capabilities and Limitations

  • You can:

    • Run this check on your library models.

    • Exclude blocks and charts from this check.

  • This check does not look in masked subsystems.

See Also

MAAB guideline na_0005: Port block name visibility in Simulink models

Check orientation of Subsystem blocks

Check the orientation of subsystem blocks.

Description

Subsystem inputs must be located on the left side of the block, and outputs must be located on the right side of the block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Subsystem blocks are not using the right orientationRotate the subsystem so that inputs are on the left side of block and outputs are on the right side of the block.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0111: Direction of Subsystem

Check usage of Relational Operator blocks

Check the position of Constant blocks used in Relational Operator blocks.

Description

When the relational operator is used to compare a signal to a constant value, the constant input should be the second, lower input.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Relational Operator blocks have a Constant block on the first, upper input. Move the Constant block to the second, lower input.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check.

See Also

MAAB guideline jc_0131: Use of Relational Operator block

Check usage of Switch blocks

Check usage of Switch blocks.

Description

This check verifies that the Switch block's control input (the second input) is a Boolean value and that the block is configured to pass the first input when the control input is nonzero.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The Switch block's control input (second input) is not a Boolean value.Change the data type of the control input to Boolean.
The Switch block is not configured to pass the first input when the control input is nonzero. Set the block parameter Criteria for passing first input to u2 ~=0.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

Check usage of buses and Mux blocks

Check usage of buses and Mux blocks.

Description

This check verifies the usage of buses and Mux blocks.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The individual scalar input signals for a Mux block do not have common functionality, data types, dimensions, and units.Modify the scalar input signals such that the specifications match.
The output of a Mux block is not a vector.Change the output of the Mux block to a vector.
All inputs to a Mux block are not scalars.Make sure that all input signals to Mux blocks are scalars.
The input for a Bus Selector block is not a bus signal.Make sure that the input for all Bus Selector blocks is a bus signal.

See Also

Check for bitwise operations in Stateflow charts

Identify bitwise operators (&, |, and ^) in Stateflow charts. If you select Enable C-bit operations for a chart, only bitwise operators in expressions containing Boolean data types are reported. Otherwise, all bitwise operators are reported for the chart.

Description

Do not use bitwise operators in Stateflow charts, unless you enable bitwise operations.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Stateflow charts with Enable C-bit operations selected use bitwise operators (&, |, and ^) in expressions containing Boolean data types.Do not use Boolean data types in the specified expressions.
The Model Advisor could not determine the data types in expressions with bitwise operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.
Stateflow charts with Enable C-bit operations cleared use bitwise operators (&, |, and ^).To fix this issue, do either of the following:
  • Modify the expressions to replace bitwise operators.

  • If not using Boolean data types, consider enabling bitwise operations. In the Chart properties dialog box, select Enable C-bit operations.

Capabilities and Limitations

  • You can exclude blocks and charts from this check.

  • This check applies only to charts that use C as the action language.

See Also

Check for comparison operations in Stateflow charts

Identify comparison operations with different data types in Stateflow objects.

Description

Comparisons should be made between variables of the same data types.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Comparison operations with different data types were found.Revisit the specified operations to avoid comparison operations with different data types.
The Model Advisor could not determine the data types in expressions with comparison operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline na_0013: Comparison operation in Stateflow

Check for unary minus operations on unsigned integers in Stateflow charts

Identify unary minus operations applied to unsigned integers in Stateflow objects.

Description

Do not perform unary minus operations on unsigned integers in Stateflow objects.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Unary minus operations are applied to unsigned integers in Stateflow objects.Modify the specified objects to remove dependency on unary minus operations.
The Model Advisor could not determine the data types in expressions with unary minus operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline jc_0451: Use of unary minus on unsigned integers in Stateflow

Check for equality operations between floating-point expressions in Stateflow charts

Identify equal to operations (==) in expressions where at least one side of the expression is a floating-point variable or constant.

Description

Do not use equal to operations with floating-point data types. You can use equal to operations with integer data types.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Expressions use equal to operations (==) where at least one side of the expression is a floating-point variable or constant.Modify the specified expressions to avoid equal to operations between floating-point expressions. If an equal to operation is required, a margin of error should be defined and used in the operation.
The Model Advisor could not determine the data types in expressions with equality operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow

Check input and output settings of MATLAB Function blocks

Identify MATLAB Function blocks that have inputs, outputs or parameters with inherited complexity or data type properties.

Description

The check identifies MATLAB Function blocks with inherited complexity or data type properties. A results table provides links to MATLAB Function blocks that do not pass the check, along with conditions triggering the warning.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
MATLAB Function blocks have inherited interfaces.

Explicitly define complexity and data type properties for inports, outports, and parameters of MATLAB Function block identified in the results.

If applicable, using the MATLAB Function Block Editor, make the following modifications in the Ports and Data Manager:

  • Change Complexity from Inherited to On or Off.

  • Change Type from Inherit: Same as Simulink to an explicit type.

  • Change Size from —1 (Inherited) to an explicit size.

In the results table, Compiled Value provides suggestions for the actual values after the model compiles. If a MATLAB Function block is defined within a library, explicitly define the interface in the library rather than in the referencing model. If your model has multiple instances of MATLAB Function blocks defined in a library block, and the instances have different interface properties, consider using multiple library blocks.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline na_0034: MATLAB Function block input/output settings

Check MATLAB Function block metrics

Display complexity and code metrics for MATLAB Function blocks and external MATLAB functions. Report metric violations.

Description

This check provides complexity and code metrics for MATLAB Function blocks and external MATLAB functions. The check additionally reports metric violations.

A results table provides links to MATLAB Function blocks and external MATLAB functions that violate the complexity input parameters.

Available with Simulink Verification and Validation.

Input Parameters

Maximum effective lines of code per function

Provide the maximum effective lines of code per function. Effective lines do not include empty lines, comment lines, or lines with a function end keyword.

Minimum density of comments

Provide minimum density of comments. Density is ratio of comment lines to total lines of code.

Maximum cyclomatic complexity per function

Provide maximum cyclomatic complexity per function. Cyclomatic complexity is the number of linearly independent paths through the source code.

Results and Recommended Actions

ConditionRecommended Action
MATLAB Function blocks or external MATLAB functions violate the complexity input parameters.For the MATLAB Function block or external MATLAB function:
  • If effective lines of code is too high, further divide the MATLAB function.

  • If comment density is too low, add comment lines.

  • If cyclomatic complexity per function is too high, further divide the MATLAB function.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

Check for mismatches between names of Stateflow ports and associated signals

Check for mismatches between Stateflow ports and associated signal names.

Description

The name of Stateflow input and output should be the same as the corresponding signal.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Signals have names that differ from those of their corresponding Stateflow ports. Change the names of either the signals or the Stateflow ports.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline db_0123: Stateflow port names

Check scope of From and Goto blocks

Check the scope of From and Goto blocks.

Description

You can use global scope for controlling flow. However, From and Goto blocks must use local scope for signal flows.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
From and Goto blocks are not configured with local scope.
  • Make sure the ports are connected

  • Change the scope of the specified blocks to local.

Capabilities and Limitations

You can exclude blocks and charts from this check.

See Also

MAAB guideline na_0011: Scope of Goto and From blocks

Was this topic helpful?