Scaling

For the Scaling mapping flavor the following attributes are available:

External Type

Signal data type in the platform.

Scaling mapping flavor information

Scaling Mode

The scaling can be turned ON or OFF. You can deactivate the scaling for individual signals without loosing the scaling information. The semantics of the getTolerance() function considers that the Scaling_Mode can be OFF. In that case the tolerance is 0.0. This may affect the myvar.getTolerance() function in the assessment, the Signal Comparison assesslet if the LSB tolerance is configured, and the "= ~ =" operator. By default, the Scaling_Mode is set to OFF, so the tolerance retrieved from this scaling will be 0. When the Scaling_Mode is set to ON, the tolerance will be set to 0.5 * LSB.

After editing the scaling information, a new test frame needs to be generated.

Slope / Bias

The slope and bias calculation follows the formula:

This mapping flavor can define the LSB which can be used as tolerance in comparisons, see also Mapping Flavor - Simulink Object.

DT_Scale_Min / DT_Scale_Max

These attributes represent the minimum and maximum values based on the physical limits of the SUT value range. Scaling settings are taken automatically into account. DT_Scale_Min and DT_Scale_Max values can only be imported into the Scaling mapping flavor from an A2L file.

In Figure " Access the different minimum and maximum values in step lists", the A2L file content concerning headlight and light_intensity are as follows:

channel headlight:

The data type uint8 spans from 0 to 255. Since there is no scaling specified, the DT_Scale_Min is 0 and DT_Scale_Max is 255.

channel light_intensity:

The data type uint16 spans from 0 to 65535. Since there is a scaling specified, the DT_Scale_Min is 0, and the DT_Scale_Max is 2621.4.

DT_Scale_Max is calculated as follows: 65535 divided by 25. DT_Scale_Min is calculated as follows: 0 divided by 0. In a step list, you can access the different minimum and maximum values.

Example
Accessing values in a step list:
headlight:= dtmin smallest data type value, here: 0
headlight:=dtmax biggest data type value, here: 255
headlight->Min specified minimum value, here: 0
headlight->Max specified maximum value, here: 1
light_intensity -> DT_Scale_Min value of DT_Scale_Min, here: 0
light_intensity -> DT_Scale_Max value of DT_Scale_Max, here: 2621.4

Access the different minimum and maximum values in step lists

From scaling (checkbox in step list)

Some step types have this checkbox, for example, the Wait for value step or the Compare step. If that checkbox is selected, the tolerance is taken from the selected mapping of the execution platform, with 1 LSB = 1 quantization step. The rounding method assumed for this calculation is "nearest" (+/- 0.5 LSB).

If you have different platforms, with different mappings, you can choose which of those apply for the step list signal preview. Select the desired platform from the drop-down menu to represent the step list signal preview with that specific platform and mapping. If there is no mapping in the platform and you select the From scaling checkbox, the tolerance of 0 is taken.

Scaling attributes in earlier TPT versions

Earlier versions of TPT had a scaling section in the Declaration Editor. In case your test has this scaling information, TPT will create a new mapping - called Migration- with a Scaling mapping flavor for each named signal (channels, etc). You can see these Migration mappings in the Declaration Editor. Changes in the configuration of scaling-dependent steps are automatically made to retain the old test behavior. However you should adjust your platform configurations to retain semantically correct tests once the new migration mappings are available.

TPT will not create any migration mapping for struct data types that had this scaling information. A warning will show. The scaling information will be lost.