Mixed Interface Types (Stream and Scalar) - Mixed Interface Types (Stream and Scalar) - 2026.1 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 English

When a kernel has both stream and non-stream inputs, automatic multiple-run behavior is limited by the non-stream input count.

void multiply_by_2(hls::stream<int> &in, hls::stream<int> &out, int scalar) {
    for (int i = 0; i < 8; i++) {
        int val = in.read();
        out.write(val * scalar);
    }
}
# 16 stream samples but only one scalar value
output = kernel.run(va.array(input_16_samples, dtype=va.int32),
                    va.array(5, dtype=va.int32))
# output: 8 values, not 16 -- the kernel only runs once

The kernel can run only one time because:

  • The scalar input provides one value, not two.
  • The kernel needs data for every input to run a second time.
  • The unused 8 stream samples are not lost. VFS buffers them for the next run().
# First call: 16 stream samples + 1 scalar -> 8 outputs, 8 samples buffered
out1 = kernel.run(va.array(input_16_samples, dtype=va.int32),
                  va.array(5, dtype=va.int32))

# Second call: 0 new samples + 1 scalar -> 8 outputs from buffered data
out2 = kernel.run(va.array([], dtype=va.int32),
                  va.array(3, dtype=va.int32))

To enable multiple runs in one call, do one of the following:

  • Provide enough data for every input (for example, two scalar values for two runs).
  • Use all-stream interfaces so VFS can iterate automatically.