Fixed-Point and Complex Types with Axis - Fixed-Point and Complex Types with Axis - 2026.1 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 English

Python:

import varray as va
import numpy as np

# hls::axis<ap_fixed<24, 12>>
in_vals = np.array([10.5, -20.25, 30.125], dtype=np.float64)
arr = va.array(in_vals, dtype=va.fi(1, 24, 12), axis=va.axis())
arr.tlast[-1] = 1

# hls::axis<float>
arr_f = va.array(np.array([1.5, 2.5, 3.5], dtype=np.float32),
                 dtype=va.float, axis=va.axis())
arr_f.tlast[-1] = 1

# hls::axis<std::complex<int>, 8, 4, 4> with sidechannels
in_data = np.array([1+2j, 3+4j, 5+6j], dtype=np.complex128)
ax = va.axis(w_user=8, w_id=4, w_dest=4)
arr_c = va.array(in_data, dtype=va.cint32, axis=ax)
arr_c.tuser[:] = 0xAB
arr_c.tid[:]   = 0x5
arr_c.tdest[:] = 0xC
arr_c.tlast[-1] = 1

MATLAB:

% hls::axis<ap_fixed<24, 12>>
in_vals = [10.5, -20.25, 30.125];
arr = varray.fi(in_vals, 1, 24, 12, axis=varray.axis());
arr.tlast(3) = 1;

% hls::axis<float>
arr_f = varray.float(single([1.5, 2.5, 3.5]), axis=varray.axis());
arr_f.tlast(3) = 1;

% hls::axis<std::complex<int>, 8, 4, 4> with sidechannels
ax = varray.axis(w_user=8, w_id=4, w_dest=4);
arr_c = varray.cint32(complex([1,3,5], [2,4,6]), axis=ax);
arr_c.tuser = repmat(hex2dec('AB'), 1, 3);
arr_c.tid   = repmat(5, 1, 3);
arr_c.tdest = repmat(hex2dec('C'), 1, 3);
arr_c.tlast(3) = 1;