Case 1: Synchronous Parameter - Case 1: Synchronous Parameter - 2026.2 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-11-11
Version
2026.2 English
class myGraph : public adf::graph {
public:
    adf::input_plio   In1;
    adf::output_plio  Out1;
    adf::kernel       kernel;
    adf::port<adf::input> scalar_port;

    myGraph() {
        kernel = adf::kernel::create(multiply_by_2_with_scalar);
        adf::connect< adf::stream >    (In1.out[0], kernel.in[0]);
        adf::connect< adf::stream >    (kernel.out[0], Out1.in[0]);
        adf::connect< adf::parameter > (scalar_port, kernel.in[1]);  // sync (no async())
    }
};
# 16 stream samples but only one scalar value
output = myGraph.run(va.array(input_16_samples, dtype=va.int32),
                     va.array(5, dtype=va.int32))
# output: 8 values, not 16

The kernel can run only one time for the following reasons:

  • 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 = myGraph.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 = myGraph.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 one scalar value per intended run (for example, va.array([5, 3], dtype=va.int32)).
  • Use all-stream interfaces so VFS can iterate automatically.