| Contents | Index |

| On this page… |
|---|
Code Generation: SIL and PIL Verification Tab Overview |
Create SIL block and configure word size portability, code coverage for SIL testing, and code execution profiling
This tab appears only if you specify an ERT–based system target file.
Numerical Equivalence Checking
Specify whether to allow portability across host and target processors that support different word sizes.
You can enable portable word sizes to support SIL testing of your generated code. For a SIL simulation, select SIL in the Create block field, or use top-model or Model block SIL simulation mode.
Default: off
Generates conditional processing macros that support compilation of generated code on a processor that supports a different word size than the target processor on which production code is intended to run (for example, a 32-bit host and a 16-bit target. This allows you to use the same generated code for both software-in-the-loop (SIL) testing on the host platform and production deployment on the target platform.
Does not generate portable code.
When you use this parameter, you should set Emulation hardware on the Hardware Implementation pane to None.
| Parameter: PortableWordSizes |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | Off |
| Safety precaution | No impact |
Generate a SIL or PIL block
Default: None
No SIL or PIL block generated.
Create a SIL block with an S-function to represent the model or subsystem. The coder generates an inlined C or C++ MEX S-function wrapper that calls existing handwritten code or code previously generated by the code generation software from within the Simulink product. S-function wrappers provide a standard interface between the Simulink product and externally written code, allowing you to integrate your code into a model with minimal modification.
When you select this option, the software:
Generates the S-function wrapper file model_sf.c (or .cpp) and places it in the build directory.
Builds the MEX-file model_sf.mexext and places it in your working directory.
Creates and opens an untitled model with a SIL block containing the S-function.
Create a PIL block that contains cross-compiled object code for a target processor or equivalent instruction set simulator. When you select this option, the software creates and opens an untitled model with a PIL block. With this block, you can verify the behavior of object code generated from subsystem or top-model components.
Use Target Connectivity API to control the way code compiles and executes in the target environment.
| Parameter: CreateSILPILBlock |
| Type: string |
| Value: 'None' | 'SIL' | 'PIL' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify a code coverage tool
Default: None
No code coverage tool specified
Specifies the BullseyeCoverage™ tool from Bullseye Testing Technology™
Specifies the LDRA Testbed® tool from LDRA Software Technology
You cannot specify this parameter if Create block is either SIL or PIL.
If you do not specify a tool, Configure Coverage appears dimmed. If you specify a tool, click Configure Coverage to open the Code Coverage Settings dialog box.
Specify whether to collect execution time profiles for tasks in generated code
Default: off
Collect measurements of execution times. Data obtained from instrumentation probes added to SIL or PIL test harness.
No measurement of execution times
When you use this parameter, you must also specify a workspace variable. The software uses this variable to collect execution time measurements.
| Parameter: CodeExecutionProfiling |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to collect execution times for functions inside generated code
Default: off
Collect execution times for functions. Data obtained from instrumentation probes placed inside code generated from atomic subsystems and model reference hierarchies.
No execution times collected for functions inside generated code
To use this parameter, you must also select the Measure task execution time check box and specify a workspace variable.
| Parameter: CodeProfilingInstrumentation |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | Off |
| Safety precaution | Off |
Specify workspace variable that collects measurements and allows viewing and analysis of execution profiles
Default: executionProfile
When you run simulation, software generates specified workspace variable as an rtw.pil.ExecutionProfile object. To view and analyse execution profiles, use methods from the rtw.pil.ExecutionProfile and rtw.pil.ExecutionProfileSection classes.
You can only specify this parameter if you select the Measure task execution time check box. Otherwise the field appears dimmed.
| Parameter: CodeExecutionProfileVariable |
| Type: string |
| Value: any valid string |
| Default: none |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Any valid string |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to save all code profiling measurement and analysis data to base workspace
Default: Summary data only
Save only code profiling summary data to a rtw.pil.ExecutionProfile in the base workspace. Use this option to limit the amount of data that the software saves to base workspace. For example, if you are concerned that your computer may not have enough memory to store all time measurements for a long simulation. The software calculates metrics for the code execution report as the simulation proceeds, without saving raw data to memory. To view these metrics, use the rtw.pil.ExecutionProfile report method.
Save all code profiling measurement and analysis data to a rtw.pil.ExecutionProfile object in the base workspace. In addition to viewing the code execution report, this option allows you to analyze data using rtw.pil.ExecutionProfile and rtw.pil.ExecutionProfileSection methods.
You can only specify this parameter if you select the Measure task execution time check box. Otherwise the field appears dimmed.
| Parameter: CodeProfilingSaveOptions |
| Type: string |
| Value: 'SummaryOnly' | 'AllData' |
| Default: 'SummaryOnly' |
![]() | Configuration Parameters | Code Generation Pane: Code Style | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |