Python - Python - 2026.1 日本語 - UG1864

Vitis Functional Simulation (VFS) ユーザー ガイド (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 日本語

run_hls_simple.py:

"""Simple HLS VFS example: sum_of_four kernel (sums each block of 4 inputs)."""
from pathlib import Path
import vfs
import varray as va
import numpy as np

here = Path(__file__).resolve().parent
myfunc = vfs.hlsKernel(
    hls_function="sum_of_four",
    input_files=str(here / "kernels.cpp"),
)

din = va.array(np.arange(1, 9, dtype=np.int32))
dout = myfunc.run(din)

print("Input :", np.arange(1, 9))
print("Output:", np.asarray(dout))
assert np.all(np.asarray(dout) == np.array([10, 26]))

次のコマンドを使用して実行します。

cd hls_example
python run_hls_simple.py