■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
TargetLink Data Types Application Note September 2004
1
▲■
Simulink Scaling Parameters and
TargetLink
This application note is about Simulink data types and how they are
dealt with in the TargetLink environment. This includes fixed-point
settings introduced with Simulink 5 .
TargetLink’s General Approach
TargetLink’s approach to production code development is as follows:
■ The control strategy is designed either with Simulink with
subsequent conversion to TargetLink, or with TargetLink’s blockset
from scratch. In either case, the algorithm is simulated with
Simulink’s simulation engine using TargetLink blocks (MIL
simulation mode). All signals are computed in floating-point.
Scaling parameters are tagged to the TargetLink blocks. During
MIL simulations, the resulting ranges are compared to the actual
floating-point signal ranges (overflow detection).
■ Production code is generated according to the scaling parameters
and run on the host (SIL mode) or on a target EVB (PIL mode). This
allows fixed-point effects to be investigated directly.
Thus, fixed-point effects are not investigated using blocks and the
Simulink simulation engine, but using the production code itself.
There is no fixed-point arithmetic in MIL mode.
Simulink’s General Approach
Simulink’s approach to production code development is as follows:
■ The control strategy is designed with Simulink blocks. To allow the
generation of fixed-point code, integer data types are supported.
To scale signals, a Fixed-Point license is needed. When signals are
scaled, the associated blocks mimic fixed-point arithmetic. The
objective of mimicking fixed-point arithmetic is to predict how the
code to be generated will behave on ECU targets.
Comentarios a estos manuales