Mixed Physical Implementation

ASCET knows two different ways of code generation: physical and implemented. During physical code generation, C data type, value range, formula, limit flags, memory section etc. are derived from the model type. During implemented code generation, this information is specified by the user in the implementation settings. For implemented code generation, the implementation settings must be complete, i.e. each element must have an entry. Therefore, the step from a model that runs successfully with physical code generation to an implemented model is quite big.

This is a problem in general, when a new function is developed and tested using physical code generation, and later implemented to the deployment on an ECU. It is a problem in particular for the physical EHOOKS bypass, where the ECU variables are already implemented: The conversion between the implemented ECU value and the real32 value of the implemented bypass function can lead to a loss of accuracy.

To ease this problem, ASCET offers the possibility to define a special component implementation, the mixed physical implementation. It is possible to define such an implementation for a project, or only for selected components in a project. You can then implement some elements in a component with mixed physical implementation, and leave others unimplemented. Implemented elements are generated as for implemented code generation. Unimplemented elements are generated as for physical code generation.

Unlike normal implementations, you can define only one mixed physical implementation per component/project. This implementation can neither be renamed nor copied nor selected as default implementation, but it can be deleted.

Code generation with mixed physical implementation requires the code generator Physical Experiment (targets PC, Prototyping and ASCET‑RP targets) or Object Based Controller Physical (ASCET‑SE targets). If you select a different code generator, the following happens:

The code for mixed physical implementation looks very similar to code from pure physical code generation, i.e. it is generated without implementation names in the C code. However, the COMPONENT.IMPLEMENTATION template, which is used in the Generation Information banner, contains the name of the mixed physical implementation (i.e., Mixed_Physical_Implementation), so that the use of the mixed physical implementation is documented. See also the example.

See also

Example: Mixed Physical Implementation

Specifying a Mixed Physical Implementation

Generating Code with Mixed Physical Implementation

Code Generation Rules

Implementations