Set Configuration Parameters for HDL Code Generation of Model Hierarchies
A model reference hierarchy must satisfy various HDL Coder™ requirements, as described in this topic. To be processed by the HDL Coder software, the model reference must also meet the Simulink® requirements and limitation listed in Set Configuration Parameters for Model Hierarchies, Define Model Reference Interfaces, and Signal Requirements and Limitations.
Configuration Parameter Requirements
A referenced model uses a configuration set in the same way a top model does. By default, every model in a hierarchy has its own configuration set, which it uses in the same way that it would if the model executed independently.
Because each model can have its own configuration set, configuration parameter values can be different in different models. Furthermore, some parameter values are intrinsically incompatible with model referencing. The response of the code generator to an inconsistent or unusable configuration parameter depends on the parameter:
If a parameter inconsistency has no significance, the code generator ignores or resolves the inconsistency without posting a warning.
If a nontrivial and possibly acceptable solution exists to an inconsistent parameter, the code generator resolves the conflict silently; resolves it with a warning; or generates an error.
If an acceptable resolution is not possible, the code generator produces an error. You must then change parameter values to eliminate the issue.
The following tables list configuration parameters that can cause problems if set in certain ways, or if set differently in a referenced model than in a parent model. Where possible, the code generator resolves violations of these requirements, but most cases require you to make changes to parameters in your models.
Configuration Requirements for Model Referencing with System Target Files
Dialog Box Pane | Option | Requirement |
---|---|---|
Solver | Start time | Some system target files require that the start time is zero. |
Enable zero-crossing detection for fixed-step simulation | For code generation, the setting must be the same for the parent and referenced models. | |
Math and Data Types | Application lifespan (days) | For code generation, the setting must be the same for the parent and referenced models. |
Hardware Implementation | All options | Values must be the same for top and referenced models. |
Code Generation | System target file | Must be the same for top and referenced models. |
Language | Must be the same for top and referenced models. | |
Generate code only | Must be the same for top and referenced models. | |
Optimization | Default parameter behavior | When a parent model has this parameter set to
Inlined , the parent model does not support referenced
models that set the parameter to Tunable . |
Identifiers | Maximum identifier length | Cannot be longer for a referenced model than for its parent model. |
Header guard prefix | Must be the same for top and referenced models. | |
Interface | Code replacement library | Must be the same for top and referenced models. |
ASAP2 interface | Can be |
The referenced model applies all the HDL Code Generation configuration parameters in the same way as the top model, ensuring consistent configuration across the entire model hierarchy.