Saturate on Overflow - 2024.1 English

Vitis Model Composer User Guide (UG1483)

Document ID
UG1483
Release Date
2024-05-30
Version
2024.1 English

Saturate on Integer Overflow

Vitis Model Composer currently supports overflow detection of integer data values on signals. As previously indicated, the default overflow mechanism is to wrap on overflow. Specific blocks in the standard Simulink library of blocks and in the HLS library have an option to Saturate on integer overflow. This can be enabled on the Block Parameters dialog box. This parameter applies only if the output is an integer (int8, int16, int32, uint8, uint16, uint32). Refer to the Model Composer Block Library for information specific to a block.

Figure 1. Saturate on Integer Overflow

Saturate on integer overflow simply means that when the input value exceeds the range of values supported by the output, either too great or too small, the value simply sits at the max or min supported value. The value is saturated, and does not change.

Saturate on Fixed-Point Overflow

For fixed-point data types, as supported on the Data Conversion Block (DTC) for example, the overflow modes offer more control than the Saturate on integer overflow option, as shown in the following figure.

Figure 2. Fixed-Point Overflow

A description of the different fixed-point overflow modes is provided below, with a graph to illustrate the condition.

Table 1. Fixed-Point Overflow Modes
Mode Description Image
Saturation When the input value overflows the output data type, the output value reaches saturation at the min or max value, and does not change.
Saturation to Zero When the input value overflows the output data type, the output value reaches saturation at the min or max value, and returns to zero.
Symmetrical Saturation Like Saturation to Zero, except the min and max values are symmetrical, or equal in size though opposite in value.
Wrap around When the input value exceeds the output data type, the output value is wrapped from the maximum value to the minimum value, or from the minimum value to the maximum value, thus cycling through the range of permitted values.
Sign-Magnitude Wrap Around When the input value exceeds the output data type, the output value reaches the maximum value, and then begins decreasing to return to the minimum value. In an underflow situation, the minimum value is reached, and begins increasing to return to the maximum value.