hlsclt
hlsclt copied to clipboard
Improve source file handling.
Currently source and test bench directories must be specified along with individual files. This seems like a duplicate requirement to users.
The tool also forces users into maintaining a separate source directory which they may not want.
This often means that relative paths to include files must be maintained in multiple source files.
A neater solution must exist so this issue is here to discuss the best way forward towards something that makes sense to the various users whilst not making the tool onerously complex.
See #15 for additional context for this issue.
@horvathp it would be great to have your input on this, based on your own user experience.
TBH I switched back to the HLS GUI after the recent updates. Mainly because of the new feature which, after every single successful csim run, automatically creates a new "solution" and backs up everything from the previous run. I personally cannot imagine why people would want to do this. Maybe it is only because others tend to write code that works perfectly out of the box :) I had a very different impression about the purpose of having multiple solutions in HLS (i.e., if things are almost settled, I can try different optimization strategies on the same code). Due to the "infinite recursion copy" feature/bug my automated workflow broke as well.
Regarding the directory structure:
-
the HLS GUI allows you to put every source and TB file into the same folder, even to the "project root". This causes an infinite recursion in hlsclt since the recent updates, things will be recursively backed up until the disk fills up.
-
the canonical hlsclt way seems to be having a src/ and a tb/ folder (or something along these lines). Unfortunately, path handling is not transparent. What do I mean by that? Suppose we have a project src/sample.h src/sample.cpp tb/sample_test.cpp in which sample_test.cpp almost surely needs to include sample.h. To do that, currently you have to write something like #include "../../../../src/sample.h" which is awkward (and incompatible with a HLS GUI project that would be created using the same directory structure), or you have to add to the cflags in hls_config.py "-I../../../../src" manually. If there is a better way, please let me know.
-
After that, if your testbench reads stuff from disk files (golden output for instance), you have to specify the file path again as "../../../../somehitng", which is awkward and, again, incompatible with the GUI flow, because in the GUI case, the testbench starts with your project root as the working directory, not something 4-5 levels below.
I'm not sure what sort of black magic the GUI (and/or the underlying Eclipse engine) does to masquerade this kind of awkward stuff so that your C testbench executable is fooled into thinking that it is running from the project root, but it is a highly desirable usability feature IMHO.