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

[API][Backend] Debug Mode for VHLS Runtime #229

Closed chhzh123 closed 4 years ago

chhzh123 commented 4 years ago

This PR rebases the commit history of #228.

  1. Add a "debug" mode to VHLS runtime, which is used to inspect the generated host code and kernel code.
    target.config(compile="vivado_hls", mode="debug")
    code = hcl.build(s, target)
    print(code)
  2. Change APIs.
    • Remove argument in f.report().
    • Rename "tcl" argument in .config to "script". Users can pass in customized Tcl script via
      tcl = open("run.tcl","r").read()
      target.config(compile="vivado_hls", script=tcl)
    • Remove misleading "vivado" backend argument. Users should use target.config(compile="vivado_hls",mode="impl") instead of compile="vivado" to run the whole synthesis & implementation process.
  3. Fix HLS report output.
chhzh123 commented 4 years ago

@Hecmay Please have a check. Maybe you can find a better way to generate the VHLS code for the debug mode.

hecmay commented 4 years ago

Updated the description (copied from previous closed PR).

chhzh123 commented 4 years ago

Please wait. It seems there are some problems of the "csyn" mode. I'm still checking.

seanlatias commented 4 years ago

ok.

chhzh123 commented 4 years ago

It seems that my system was incorrectly upgraded, resulting in some program crashes, which has nothing to do with this PR. This PR has nothing to change, and you can merge then. Thanks. @seanlatias

seanlatias commented 4 years ago

It seems that my system was incorrectly upgraded, resulting in some program crashes, which has nothing to do with this PR. This PR has nothing to change, and you can merge then. Thanks. @seanlatias

Does your program update affect HeteroCL or the HLS runtime?

chhzh123 commented 4 years ago

No, it's the package upgrade of my Linux system. I think some underlying C/C++ libraries are changed. When some memcpy instructions are executed, it will lead to SegFault, which is not introduced in this PR, and I cannot reproduce the error on another machine.

seanlatias commented 4 years ago

Ok. Please take note of this in case we meet this again.