Rebuild
Option to conditionally, always, or never rebuild model reference targets
Model Configuration Pane: Model Referencing
Description
The Rebuild configuration parameter determines when to rebuild simulation and Simulink® Coder™ targets for referenced models before updating, simulating, or generating code from the model.
Models in a model hierarchy can have different rebuild settings. When you update, simulate, or generate code for a model, the rebuild setting for that model applies to all its referenced models.
Models that execute in normal mode do not generate simulation targets and are unaffected by the Rebuild settings.
Set Configuration Parameter for Referenced Model
In a model reference hierarchy, how you open the Configuration Parameters dialog box determines whether you edit the configuration parameter for the top model in the current model hierarchy or the current referenced model.
Top model in the current model hierarchy — In the Simulink Toolstrip, on the Modeling tab, click Model Settings.
Current referenced model — In the Simulink Toolstrip, on the Modeling tab, click the Model Settings button arrow. Then, in the Referenced Model section, select Model Settings.
Alternatively, open the referenced model as a top model. Then, in the Simulink Toolstrip, on the Modeling tab, click Model Settings.
Settings
If changes detected
(default) | Always
| If changes in known dependencies detected
| Never
Always
Always rebuild targets for referenced models. This setting requires the most processing time because it can trigger unnecessary builds. To make all model reference targets up to date, use this setting before you deploy a model.
If changes detected
Conditionally rebuild targets for referenced models when the software detects a change that could affect simulation results. To perform extensive change detection on dependencies of referenced models, use this setting.
If the software finds no changes in known dependencies, it computes the structural checksum of the model. The structural checksum detects changes that occur in user-created dependencies that are not specified using the Model dependencies configuration parameter. If the structural checksum has changed, the software rebuilds the model reference target.
If changes in known dependencies detected
Conditionally rebuild targets for referenced models when the software detects a change that could affect simulation results. To reduce the time required for change detection, use this setting.
If the software finds no changes in known or potential dependencies, it does not compute the structural checksum of the model and does not rebuild the model reference target. To avoid invalid simulation results, you must list all user-created dependencies in the Model dependencies parameter.
Never
Do not rebuild targets for referenced models. This setting requires the least processing time and, when available, uses Simulink cache files for faster simulations. To avoid rebuilds when developing a model, use this setting.
If model reference targets are out of date, the simulation may present invalid results. To have the software check for changes in known target dependencies and report if the model reference targets may be out of date, use the Never rebuild diagnostic parameter. To manually rebuild model reference targets, use the
slbuild
function.For information on using and sharing Simulink cache files, see Share Simulink Cache Files for Faster Simulation.
Examples
Tips
To improve rebuild detection speed and accuracy, use the Model dependencies configuration parameter to specify user-created dependencies.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution |
When you use the
|
Programmatic Use
Parameter:
UpdateModelReferenceTargets |
Value1
:
'Force' | 'IfOutOfDateOrStructuralChange' |
'IfOutOfDate' | 'AssumeUpToDate' |
Default:
'IfOutOfDateOrStructuralChange' |
Limitations
The Rebuild configuration parameter does not apply to a Model block when both of these conditions apply:
The block simulates in software-in-the-loop (SIL) or processor-in-the-loop (PIL) mode.
The Code interface block parameter is set to
Top model
.
In this case, the code regeneration behavior for the referenced model is what you observe for a standalone model. For more information, see Control Regeneration of Top Model Code (Embedded Coder).
More About
Version History
Introduced before R2006aSee Also
Blocks
Model Settings
Functions
1 This table maps the programmatic values to the equivalent interactive values of the Rebuild configuration parameter.
UpdateModelReferenceTargets
Value | Equivalent Rebuild Value |
---|---|
'Force' | Always |
'IfOutOfDateOrStructuralChange' | If changes detected |
'IfOutOfDate' | If changes in known dependencies
detected |
'AssumeUpToDate' | Never |