After that, go to the downloaded directory and make it.
$ make -j8
You can set your own CMake or LLVM version by setting the PATH in Makefile.config.
You can turn off the VHLS C simulation feature by setting USE_VIVADO_HLS to 0 in Makefile.config.
Components of HeteroCL
HeteroCL framework overview
HeteroCL is High-Level-Synthesis with style. How is that so? Previous HLS tools, for example, Vivado HLS, need us users to specify hardware customizations while describing the function, so that it could generate correct circuits from that description. HeteroCL does exactly the same job, but it decouples the hardware customization from algorithm specification, allowing a cleaner programming process.
Relation with TVM
HeteroCL is like an extension from TVM in the sense of compiler. TVM focuses on Tensor computations for CPU and GPU backends. Though TVM supports FPGA backend by using VTA, its tensor operations are pre-defined. On the other hand, HeteroCL offers additional features for FPGA programming that are more flexible and general. Such features include:
m = k = n = 16 dtype = hcl.Int() hcl_m1 = hcl.asarray(np.random.randint(10, size=(m, k)), dtype=hcl.Int()) hcl_m2 = hcl.asarray(np.random.randint(10, size=(m, k)), dtype=hcl.Int()) hcl_m3 = hcl.asarray(np.zeros((m, n)), dtype=dtype)
fg = gemm(m, n, k, dtype=hcl.Int(), target=target) fg(hcl_m1, hcl_m2, hcl_m3)
report = fg.report(target)
With above installation steps and Vivado Design Suite 2018.3 installed, I could not get HLS backend working. See the below error message:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[15:27:16] Generating harness files ... [15:27:16] Compiling the program ... Traceback (most recent calllast): File"hls_backend_example.py", line 36, in <module> fg(hcl_m1, hcl_m2, hcl_m3) File"/home/zhangniansong/.local/lib/python3.7/site-packages/heterocl-0.1-py3.7.egg/heterocl/tvm/_ffi/function.py", line 128, in __call__ return f(*args) File"/home/zhangniansong/.local/lib/python3.7/site-packages/heterocl-0.1-py3.7.egg/heterocl/tvm/_ffi/_ctypes/function.py", line 183, in __call__ ctypes.byref(ret_val), ctypes.byref(ret_tcode))) File"/home/zhangniansong/.local/lib/python3.7/site-packages/heterocl-0.1-py3.7.egg/heterocl/tvm/_ffi/base.py", line 66, in check_call raise TVMError(py_str(_LIB.TVMGetLastError())) heterocl.tvm._ffi.base.TVMError: TVMCall CFunc Error: Traceback (most recent calllast): File"/home/zhangniansong/.local/lib/python3.7/site-packages/heterocl-0.1-py3.7.egg/heterocl/tvm/_ffi/_ctypes/function.py", line 54, in cfun rv = local_pyfunc(*pyargs) File"/home/zhangniansong/.local/lib/python3.7/site-packages/heterocl-0.1-py3.7.egg/heterocl/tvm/runtime.py", line 153, in copy_and_compile withopen("project/run.tcl","r") as tcl_file: FileNotFoundError: [Errno 2] No such fileordirectory: 'project/run.tcl'
HeteroCL can’t find my Vivado HLS include files. So what we gotta do is to specify where the library files are located.