HLS half vs. float16 - HLS half vs. float16 - 2026.1 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 English

varray.half / varray.chalf mirror the Vitis HLS half C++ type. Use them when your HLS kernel declares ports as half or std::complex<half>. varray.float16 is generic IEEE 754 binary16 for kernels that take ap_fixed or similar storage types. The two go through different conversion paths and might differ by ±1 ULP on edge cases.

Arithmetic operators are not supported on half/chalf. Cast to double or single for math, then re-wrap with varray.half / varray.chalf.

h  = varray.half([1.5, 2.5, 3.5, -1.0]);
double(h)                                    % read back as double

ch = varray.chalf(complex([1.5, 2.5], [3.0, 4.0]));

half and chalf also accept an axis=varray.axis(...) argument for AXI4-Stream sideband signals. Refer to AXI4-Stream Sideband for more information.