Closed hecmay closed 3 years ago
@seanlatias do we want to put AutoSA & SODA integration together with this extern IP PR?
Yes, it's better to separate them into different PRs.
The formatting is kind of problematic. I used doc/.clang-format
and my clang-format is exactly the same version as installed on our server. @seanlatias
root@5b589a0f46e2:/usr/src/heterocl# clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
Can you first finish the TBA in the description?
@seanlatias I think this is ready for review.
The PR introduces the HLS IP integration feature. Here is an example of integrating a vector-add IP function into heterocl program. The IP function will be included into HLS program as a individual Stage. Programmers should be responsible for the correctness of the provided IP cores.
HLS IP definiton
In this example, the function definition of the vector-add kernel is defined in
vadd.cpp
. The input operands (i.e.op1, op2
) can either be HCL tensors or real values. We recommend the programmers to write down the IP's behavior specification using HCL's APIs inside the Stage body, so that programmers can verify the IP's correctness by comparing the result of CPU simulation and hardware simulation.If the IP's behavior is too complex,
hlib.register_tensors
can be used to register the input operand tensors in the IP. But in this case, the programmers would not be able to verify the correct using CPU simulation.Call extern IP in HCL program
The IP function call be called inside HCL program after it is registered using
@hlib.register_extern_ip
. You can link an IP function's input and output to other HCL modules usings.to()
primitive. The IR passes will automatically check access pattern and throw out warning for any potential deadlocks.