Main Content

Code Generation Advisor Checks

Available Checks for Code Generation Objectives

Code generation objectives checks facilitate designing and troubleshooting Simulink® models and subsystems that you want to use to generate code. For more information about code generation objectives, see Application Objectives Using Code Generation Advisor.

The Code Generation Advisor includes the following checks from Simulink, Simulink Coder™, and Embedded Coder® for each of the code generation objectives. Two checks unique to the Code Generation Advisor are included below the list.

CheckExecution efficiency
(all targets)
ROM efficiency
(ERT-based targets)
RAM efficiency
(ERT-based targets)
Safety precaution
(ERT-based targets)
Traceability
(ERT-based targets)
Debugging
(all targets)
MISRA C:2012 guidelines
(ERT-based targets)
Polyspace®
(ERT-based targets)
Check model configuration settings against code generation objectivesIncludedIncludedIncludedIncludedIncludedIncludedIncluded (see Note below)Included
Check for optimal bus virtualityIncludedIncludedIncludedN/AN/AN/AN/AN/A
Identify questionable blocks within the specified systemIncluded IncludedIncludedN/AN/AN/AN/AN/A
Check the hardware implementation (Embedded Coder)Included if Embedded Coder is availableIncluded if Embedded Coder is availableN/AN/AN/AN/AN/AN/A
Identify questionable software environment specifications (Embedded Coder)Included when Traceability is not a higher priority and Embedded Coder is availableIncluded when Traceability is not a higher priority and Embedded Coder is availableN/AN/AN/AN/AN/AN/A
Identify questionable code instrumentation (data I/O) (Embedded Coder)Included when Traceability or Debugging are not higher priorities and Embedded Coder is availableIncluded when Traceability or Debugging are not higher priorities and Embedded Coder is availableIncluded when Traceability or Debugging are not higher priorities and Embedded Coder is availableN/AN/AN/AN/AN/A
Identify questionable subsystem settings (Embedded Coder)N/AIncluded if Embedded Coder is availableIncluded if Embedded Coder is availableN/AN/AN/AN/AN/A
Identify blocks that generate expensive rounding code (Embedded Coder)Included if Embedded Coder is availableIncluded if Embedded Coder is availableN/AN/AN/AN/AN/AN/A
Identify questionable fixed-point operations (Embedded Coder)Included if Embedded Coder or Fixed-Point Designer™ is availableIncluded if Embedded Coder or Fixed-Point Designer is availableN/AN/AN/AN/AN/AN/A
Identify lookup table blocks that generate expensive out-of-range checking code (Embedded Coder)Included if Embedded Coder is availableIncluded if Embedded Coder is availableN/AN/AN/AN/AN/AN/A
Check output types of logic blocks (Embedded Coder)Included if Embedded Coder is availableN/AN/AN/AN/AN/AN/AN/A

Identify unconnected lines, input ports, and output ports

N/AN/AN/AIncludedN/AN/AN/AN/A
Check Data Store Memory blocks for multitasking, strong typing, and shadowing issuesN/AN/AN/AIncludedN/AN/AN/AN/A
Identify block output signals with continuous sample time and non-floating point data typeN/AN/AN/AIncludedN/AN/AN/AN/A
Check for blocks that have constraints on tunable parametersN/AN/AN/AIncludedN/AN/AN/AN/A
Check if read/write diagnostics are enabled for data store blocksN/AN/AN/AIncludedN/AN/AN/AN/A
Check structure parameter usage with bus signalsN/AN/AN/AIncludedN/AN/AN/AN/A
Check data store block sample times for modeling errorsN/AN/AN/AIncludedN/AN/AN/AN/A
Check for potential ordering issues involving data store accessN/AN/AN/AIncludedN/AN/AN/AN/A
Check for blocks not recommended for C/C++ production code deployment (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for blocks not recommended for MISRA C:2012 (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for unsupported block names (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check usage of Assignment blocks (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for bitwise operations on signed integers (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for recursive function calls (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for equality and inequality operations on floating-point values (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check for switch case expressions without a default case (Embedded Coder)N/AN/AN/AN/AN/AN/AIncluded if Embedded Coder is availableN/A
Check configuration parameters for generation of inefficient saturation code (Embedded Coder)Included if Embedded Coder is availableIncluded if Embedded Coder is availableN/AIncluded if Embedded Coder is availableN/AN/AN/AN/A

Note

When the Code Generation Advisor checks your model against the MISRA C:2012 guidelines objective, the tool does not consider all of the configuration parameter settings that are checked by the MISRA C:2012 guidelines checks in the Model Advisor. For a complete check of configuration parameter settings:

  1. Open the Model Advisor.

  2. Navigate to By Task > Modeling Guidelines for MISRA C:2012.

  3. Run the checks in the folder.

For more information on using the Model Advisor, see Check Your Model Using the Model Advisor.

See Also

Identify questionable blocks within the specified system

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

Description

The code generator creates code only for the blocks that it supports. Some blocks are not recommended for production code deployment.

Results and Recommended Actions

ConditionRecommended Action
A block is not supported by the code generator.Remove the specified block from the model or replace the block with the recommended block.
A block is not recommended for production code deployment.Remove the specified block from the model or replace the block with the recommended block.
Check for Gain blocks whose value equals 1.Replace Gain blocks with Signal Conversion blocks.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have a Simulink Check™ license.

See Also

Use Products and Blocks Supported for Code Generation

Model Advisor Exclusion Overview (Simulink Check)

Check model configuration settings against code generation objectives

Check the configuration parameter settings for the model against the code generation objectives.

Description

Each parameter in the Configuration Parameters dialog box might have different recommended settings for code generation based on your objectives. This check helps you identify the recommended setting for each parameter so that you can achieve optimized code based on your objective.

Results and Recommended Actions

ConditionRecommended Action
Parameters are set to values other than the value recommended for the specified objectives.

Set the parameters to the recommended values.

Note

A change to one parameter value can impact other parameters. Passing the check might take multiple iterations.

Action Results

Clicking Modify Parameters under Action in the check window changes the parameter values to the recommended values.

See Also