Accessing Fields (MATLAB) - Accessing Fields (MATLAB) - 2026.1 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 English

In MATLAB, sideband fields are read and written directly on the varray object using standard value semantics. Use indexed assignment to modify individual elements.

arr = varray.int32([10, 20, 30], axis=varray.axis());

% Read the full sideband array
arr.tlast           % [0 0 0]   (logical row vector)
arr.tkeep           % [15 15 15]

% Set tlast on a single element via indexed assignment.
% tlast accepts logical or numeric 0/1.
arr.tlast(3) = 1;
arr.tlast           % [0 0 1]

% Assign a full sideband array
arr.tlast = [0 0 1];                 % numeric 0/1 — auto-cast to logical
arr.tlast = logical([0 0 1]);        % native logical form
arr.tkeep = [3 3 3];

Note: In MATLAB, tlast is stored as logical, the value sideband fields (tuser, tid, tdest) are stored as int64, and the bitmask fields (tkeep, tstrb) are stored as uint64. Plain double literals and arrays are auto-cast on assignment, so the natural MATLAB form arr.tlast = [0 0 1] works as expected. You only need to write an explicit int64(...) / uint64(...) when a value exceeds 2^53 and cannot be represented exactly as a double: for example, a wide tkeep mask or a tuser carrying full 64-bit metadata:

arr.tkeep = uint64([intmax('uint64'), 0, 0]);   % value > 2^53 — build as uint64
arr.tuser = int64([intmax('int64'),  0, 0]);    % 64-bit sideband metadata