Control Regeneration of Top Model Code
When you rebuild a model, by default, the build process performs checks to determine whether changes to the model or relevant settings require regeneration of the top model code. The model build regenerates top model code if any of the following conditions is true:
The structural checksum of the model has changed.
The top-model-only checksum has changed. The top-model-only checksum provides information about top model parameters, such as application lifespan, maximum stack size, make command, verbose and
.rtwfile debug settings, and
Any of the following TLC debugging configuration parameters is selected:
Start TLC debugger when generating code (
Start TLC coverage when generating code (
Enable TLC assertion (
Profile TLC (
Whether the top model code is regenerated, the build process calls the build process
hooks and reruns the makefile. The hooks include the
the post code generation command. This process recompiles and links the external
System target file authors can perform actions related to code regeneration in the
the build process calls. These actions include forcing or reacting to code regeneration.
For more information, see Control Code Regeneration Using STF_make_rtw_hook.m.
Regeneration of Top Model Code
If the checks determine that top model code generation is required, the build process fully regenerates and compiles the model code. An example check is whether previously generated code is not current due to a model update.
The build process omits regeneration of the top model code when the checks indicate both:
The top model generated code is current for the model.
Model settings do not require full regeneration.
This omission can significantly reduce model build times.
With an Embedded Coder® license, if you modify a code generation template (CGT) file then rebuild your model, the code generation process does not force a top model build. In this case, see Force Regeneration of Top Model Code.
Force Regeneration of Top Model Code
If you want to control or override the default top model build behavior, use one of the following command-line options:
To ignore the checksum and force regeneration of the top model code:
To clean the model build area enough to trigger regeneration of the top model code at the next build (
You can force regeneration of the top model code by deleting the
slprj folder or the generated model code folder from the
Code generation folder .