Code Generation

by Lukas T.

What do you need to consider for code Generation, speaking of platforms.

code generation support of each block to be used should be checked

  • Execution Environment Components: You need to understand the execution environment components of the platform, such as the operating system, hardware architecture, and memory model. This information is essential to ensure that the generated code can run on the platform correctly.

  • Calculation cycle: The calculation cycle of the platform refers to the time required to execute a specific set of calculations. You need to understand the calculation cycle of the platform to optimize the generated code for speed and efficiency. If the step size is not correctly set to the clock cycle of the plattform it can lead to “overrun” certain calculations. (especially when step size is too small)

  • Sample time propagation: Sample time propagation refers to the process of propagating (übertragung) the sample time of one block to the rest of the blocks in a model. You need to ensure that the sample time propagation is correctly implemented in the generated code to avoid synchronization errors.

  • Data propagation: You also need to consider the data propagation (übertragung) within the model, especially when generating code for distributed systems. The generated code should ensure that data is propagated correctly between different components of the system.

  • Data types: The data types used in the model need to be compatible with the data types supported by the platform. You need to ensure that the generated code uses the appropriate data types to avoid compatibility issues.

  • Algebraic loops: Algebraic loops occur when a block's output depends on its input and its own output. The code generator does not produce code that solves algebraic loops


Lukas T.


Last changed