cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
322 stars 92 forks source link

[Backend] Add runtime support for Vivado HLS C simulation #102

Closed seanlatias closed 5 years ago

seanlatias commented 5 years ago

Now there is a new target for build function, which is vhls_csim. By using this target, we perform the C simulation using the generated HLS code.

Usage

The usage is exactly the same as running CPU simulation. Just change the target from llvm in the build function to vhls_csim.

Limitation

Note that this can only be used when Vivado HLS is installed because we need to include the related HLS headers. We DO NOT call the HLS tool for simulation. (Maybe this means we do not need a license?) The only thing we do in the backend is to run a simple g++ command.

Run Tests

To run the tests, use the following command.

py.test file --vhls=True

Change Log

  1. Fixed incorrect HLS codegen for fixed-point numbers.
  2. Fixed incorrect casting for fixed-point numbers in LLVM.
  3. Add a new CFLAG to Makefile.config where the users can set whether to compile HLS runtime or not.
  4. Enable testing for both with and without Vivado HLS.