Super Block Properties
Learn about atomicity, input and output data types and sizes, and input time dependency for code generation.
Several factors can affect how code is generated for a Super Block:
- Atomicity. If the Super Block is tagged Atomic, then the generated code is in general much simpler: if the Super Block has an input activation port, then it will be considered as the unique source of activation (in addition to always-activation if the Super Block includes always active blocks); and if it does not have an input activation port, then it inherits its activation as the union of the activations of its regular input signals. Not declaring a Super Block Atomic considers all possible combinations of the way the block can be activated, but in most code generation applications, the Atomic option is the appropriate choice. Note that tagging the Super Block Atomic changes its behavior also during simulation, so the choice can be validated by simulation before the actual code generation.
- Input and output port data types and sizes. The Super Block input and output block ports parameters can be used to set the data types and sizes of the corresponding signals. This information, which is only used for code generation, may have to be provided to allow the compiler to properly type the model signals. This additional information for code generation may be required because unlike the compilation of the full model for simulation, the compilation of the Super Block is done separately, without information about the environment. The typing constraints within the Super Block then may not impose enough constraints to uniquely determine the input/output signal types and sizes.
- Input time dependency. As for data types and sizes, the activation property of the signals entering the Super Block may need to be specified. In particular, if an input signal is always active, then the Time dependency parameter of the corresponding input port must be set.
The latter two points above concern information that user may need to provide to define the environment of the Super Block. So, it is important that it be consistent with the actual environment in the complete model used for simulation.