jingpu / Halide-HLS

HLS branch of Halide
Other
77 stars 22 forks source link

Various improvements and f4graph Zynq updates #30

Closed Kuree closed 6 years ago

Kuree commented 6 years ago

This pull request reflects recent changes in hwacc/cmabuffer used in ultrazynqbuilder, as well as new application needs from f4graph. Here is a list of detailed changes:

  1. Fixed unsharp and demosaic_flow applications on Zynq. That is, we can now compile and run without running into any error.
  2. Introduced a guess_name function in HLS codegen so that instead of using arg_%d, it's now using more human readable naming used in Halide code. This is extremely helpful because user now can specify the DMA channel loading order in the driver code automatically, given the pipeline_zynq buffer preparing sequence. If the code fails to guess the argument name, it will fall back to arg_%d.
    • We've rewrote hwacc driver code so that it reads information directly from device tree, instead of through parametrization (one driver to rule them all.)
  3. Top level Zynq Halide function calls now receives file descriptors, instead of using halide_zynq_init(). This is necessary since f4graph loads the kernel through dl, which cannot run halide_zynq_init().
  4. Introduced tap values in Zynq codegen. Taps are assumed to be 1 dimensional arrays pre-allocated in hls_target's register space. As a result, its height is always 1, as specified in buffer_to_stencil() in HalideRuntimeZynq. This will be handled by hwacc driver accordingly.
  5. Updated driver interface in Zynq codegen. We now uses different user space buffer and kernel buffer to prevent user space from overriding physical address. Zynq will use UBuffer instead of cma_buffert.
jingpu commented 6 years ago

Re 3., I think having a halide function taking a file descriptor might not be a good change, as no other device targets of halide use this kind of interface. If the goal is to use an existing fd instead of creating a new one in halide_zynq_init, you can probably add a new runtime function called halide_zynq_set_fd to override the fd in zynq.cpp.

Also, this PR includes a number of changes. It would be good to split it into a couple smaller PRs.

Kuree commented 6 years ago

Thanks for the suggestions. I will close this PR for now and splits them into multiple PRs.