Model-Wide Attribute Constraints

AttributeConstraintFATAL / NonfatalCompatibility Check
Unconnected objectsThere must not be unconnected lines, input ports, or output ports in the model or subsystem. This helps prevent dead code and hidden ground blocks.NonfatalCheck for unconnected objects in the model
Function specificationsThe model cannot specify custom model entry function prototypes. The Configure arguments for Step function prototype setting in the Configure C Step Function Interface dialog box must be cleared.NonfatalCheck C Step Function Interface setting
Conditional input branch execution

When the configuration parameter Conditional input branch execution is selected:

  • The model must enable signal storage reuse and local block outputs.

  • The model must not use Reusable or Nonreusable subsystem block outputs as inputs to the Multiport Switch block.

NonfatalCheck conditional input branch execution setting
Unsupported blocksThere must not be blocks in the model that are not supported by Simulink® Code Inspector™.NonfatalCheck for unsupported blocks
Storage classes for workspace variables

The model cannot reference workspace variables that are not supported for either of these reasons:

  • Custom storage class Type is not set to Unstructured.

  • Custom storage class is reusable.

NonfatalCheck storage class for workspace variables
GetSet custom storage classes for workspace variables

For workspace variables that use a GetSet custom storage class:

  • The custom storage class must have a header file defined.

  • The custom storage class data type must not be bus or struct.

NonfatalCheck GetSet storage class for workspace variables
Usage of sample timesThe model cannot use continuous, asynchronous, explicit discrete partition, data driven, union, exported discrete, or variable sample times.FATALCheck for sample times in the model >Check sample times
Explicit partitionsThe model must not contain explicit partitions.FATALCheck for sample times in the model > Check for explicit partitions
Automatic insertion of Signal Conversion blocks on signals entering block inportsAutomatic insertion of a Signal Conversion block on a signal entering a block inport is not supported for code inspection. It creates a hidden Signal Conversion block, which is not supported for code inspection.NonfatalCheck for Signal Conversion blocks automatically inserted on signals entering block input ports > Verify no Signal Conversion blocks are automatically inserted on signals entering block inports
Fixed-point instrumentation and block reduction both selectedSimultaneous use of fixed-point instrumentation and block reduction is not supported for code inspection.NonfatalCheck for usage of fixed-point instrumentation > Verify usage of fixed-point instrumentation
Root Outport block sample timesRoot Outport blocks must not be constant. This constraint prevents the root outport assignment from being moved to the model initialize function, which would cause the model functions to fail validation.NonfatalCheck usage of root Outport blocks > Verify sample times
Root Output block bus passing methodA root Outport block that passes a bus to a parent model must pass the bus as a structure. Otherwise, Simulink software might insert a hidden Signal Conversion block in the parent model, which is not supported for code inspection. For each instance, the Outport block parameter Output as nonvirtual bus in parent model (BusOutputAsStruct) must be selected.NonfatalCheck usage of root Outport blocks > Verify root Outports pass buses to parent models as structures
Automatic virtual to nonvirtual bus conversionAutomatic conversion between virtual and nonvirtual buses is not supported for code inspection. It creates a hidden Signal Conversion block, which is not supported for code inspection.FATALCheck usage of buses > Check for automatic conversion between virtual to nonvirtual buses
Block operations on a busA non-virtual block must not operate on a virtual bus and a Bus Assignment block must not operate on a non-virtual bus. This constraint simplifies bus processing to promote traceability and readability of generated code.FATALCheck usage of buses > Verify that blocks in the model do not perform unsupported operations on a bus
Data type replacementReplacement names in a Data Type Replacement table must be of type Simulink.AliasType.NonfatalCheck data type replacement names
Sample times for model used as model reference targetModel used as model reference target must not have multiple sample times.NonfatalCheck for sample times in model used as model reference target
Commented-out blocksModel must not contain blocks that are commented out.NonfatalCheck model for commented out blocks
Instrumented signals connect to automatically inserted blocksModel must not contain instrumented signals that connect to automatically inserted blocks.NonfatalCheck model for instrumented signals that connect to automatically inserted blocks
Function names for noninlined subsystems with void-void function call interfacesIn a model, noninlined subsystems with void-void function call interfaces must use unique function names.FATALCheck model for void_void subsystems that use the same function name
Shared synthesized local data stores

You must not use signal objects in the model workspace that are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks.

NonfatalCheck for usage of synthesized local data stores
Reusable subsystems

Reusable subsystems with the same function interface must come from the same library blocks.

NonfatalCheck model for reusable subsystems that use the same function interfaces
Code Mapping settings

In the Code Mapping Editor, on the Data Defaults tab under Code Mappings-C, each model element category must use the Default storage class setting.

NonfatalCheck for unsupported Code Mapping settings
Code generation folder structure setting

In Simulink Preferences, on the General pane, the Code generation folder structure option must be set to Model Specific.

FATALCheck the code generation folder structure for the model
Graphical sorted orderThe compiled block list of a model must match the graphical block sorted order.NonfatalCheck model for compiled and graphical block sorted order
Code generation symbols settings for shared utilitiesFor inspection of shared utilities, Local temporary variables (Embedded Coder) must be set to default value $N$M and Shared utilities identifier format (Embedded Coder) must be set to default value $N$C.NonfatalCheck usage of shared utilities > Check code generation symbols settings for shared utils inspection
Standard math library setting for shared utilitiesFor inspection of shared utilities, Standard math library (Simulink Coder) must be set to C89/C90 (ANSI) or C99 (ISO).NonfatalCheck usage of shared utilities > Check standard math library settings for shared utils inspection
Code style settings for shared utilities

For inspection of shared utilities:

NonfatalCheck usage of shared utilities > Check code style settings for shared utils inspection
Model argumentsModel arguments must not have a storage class.NonfatalCheck model arguments for storage classes

Related Topics