calyx icon indicating copy to clipboard operation
calyx copied to clipboard

[fud] Usage of "kernel" naming convention in the HLS flow

Open mortbopet opened this issue 4 years ago • 4 comments
trafficstars

In general, hardcoded top-level function/filenames are in general expected to be called main in various .tcl scripts. However, for the Vivado HLS flow, top-level functions and files are named kernel. This creates an inconvenience for flows which start at e.g. C level that may go through either the Vivado HLS flow, or (via Polygeist) through the Calyx flow, in that there has to be a manual intervention somewhere in there to rename the top-level function from "kernel" to "main".

A proposed fix is to rename "kernel" to "main" in

  • https://github.com/cucapra/calyx/blob/master/fud/synth/hls.tcl
  • https://github.com/cucapra/calyx/blob/master/fud/fud/stages/vivado/stage.py#L141.
  • https://github.com/cucapra/calyx/blob/master/fud/fud/stages/vivado/extract.py#L116

mortbopet avatar Sep 27 '21 13:09 mortbopet

Another possible option is providing a command-line parameter to the tcl script to specify the name of the top-level module. This can then be changed using fud's -s <stage> ... stuff during a command invocation. How hard would it be to do that?

rachitnigam avatar Sep 27 '21 13:09 rachitnigam

That would definitely also solve the problem. Adding to that, the top level module could be a global parameter, which will be used anywhere where we currently use main or kernel.

mortbopet avatar Sep 27 '21 13:09 mortbopet

Cool. If you'd like, open a PR. I'm currently working on some other things so it'll be a while before I can get to this.

rachitnigam avatar Sep 27 '21 14:09 rachitnigam

Seems like a good idea to me!

sampsyo avatar Sep 28 '21 20:09 sampsyo