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.
Check | Execution 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 objectives | Included | Included | Included | Included | Included | Included | Included (see Note below) | Included |
Check for optimal bus virtuality | Included | Included | Included | N/A | N/A | N/A | N/A | N/A |
Identify questionable blocks within the specified system | Included | Included | Included | N/A | N/A | N/A | N/A | N/A |
Check the hardware implementation (Embedded Coder) | Included if Embedded Coder is available | Included if Embedded Coder is available | N/A | N/A | N/A | N/A | N/A | N/A |
Identify questionable software environment specifications (Embedded Coder) | Included when Traceability is not a higher priority and Embedded Coder is available | Included when Traceability is not a higher priority and Embedded Coder is available | N/A | N/A | N/A | N/A | N/A | N/A |
Identify questionable code instrumentation (data I/O) (Embedded Coder) | Included when Traceability or Debugging are not higher priorities and Embedded Coder is available | Included when Traceability or Debugging are not higher priorities and Embedded Coder is available | Included when Traceability or Debugging are not higher priorities and Embedded Coder is available | N/A | N/A | N/A | N/A | N/A |
Identify questionable subsystem settings (Embedded Coder) | N/A | Included if Embedded Coder is available | Included if Embedded Coder is available | N/A | N/A | N/A | N/A | N/A |
Identify blocks that generate expensive rounding code (Embedded Coder) | Included if Embedded Coder is available | Included if Embedded Coder is available | N/A | N/A | N/A | N/A | N/A | N/A |
Identify questionable fixed-point operations (Embedded Coder) | Included if Embedded Coder or Fixed-Point Designer™ is available | Included if Embedded Coder or Fixed-Point Designer is available | N/A | N/A | N/A | N/A | N/A | N/A |
Identify lookup table blocks that generate expensive out-of-range checking code (Embedded Coder) | Included if Embedded Coder is available | Included if Embedded Coder is available | N/A | N/A | N/A | N/A | N/A | N/A |
Check output types of logic blocks (Embedded Coder) | Included if Embedded Coder is available | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A | |
Check Data Store Memory blocks for multitasking, strong typing, and shadowing issues | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Identify block output signals with continuous sample time and non-floating point data type | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check for blocks that have constraints on tunable parameters | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check if read/write diagnostics are enabled for data store blocks | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check structure parameter usage with bus signals | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check data store block sample times for modeling errors | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check for potential ordering issues involving data store access | N/A | N/A | N/A | Included | N/A | N/A | N/A | N/A |
Check for blocks not recommended for C/C++ production code deployment (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for blocks not recommended for MISRA C:2012 (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for unsupported block names (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check usage of Assignment blocks (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for bitwise operations on signed integers (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for recursive function calls (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for equality and inequality operations on floating-point values (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check for switch case expressions without a default case (Embedded Coder) | N/A | N/A | N/A | N/A | N/A | N/A | Included if Embedded Coder is available | N/A |
Check configuration parameters for generation of inefficient saturation code (Embedded Coder) | Included if Embedded Coder is available | Included if Embedded Coder is available | N/A | Included if Embedded Coder is available | N/A | N/A | N/A | N/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:
Open the Model Advisor.
Navigate to By Task > Modeling Guidelines for MISRA C:2012.
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
Condition | Recommended 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
Condition | Recommended 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.