10-21-2020 11:11 PM
Hi all,
I was wondering how can I create an assertion for synthesis in HLS. So far I've been able to create them for csim, however it's ignored in synthesis.
I guess is based in the fact that you should run your csim prior synthesizing, but I would like to know if there is any option to imply these checks for synthesis as well. In my project, I generate the HLS IP Core based on scripting, and some internal numerical approximations are only valid for specific values of #defines in a header file. I would like to check if those have been changed without requiring a new long simulation.
This is how I'm implementing them so far for CSIM:
assert (INP_ROWS==1072 && INP_COLS==1928); // IMP_ROWS, INP_COLS are #defines in .h
Any ideas? If so, is there any way to throw an error message on them?
Thanks in advance!
PS: I'm, using Vivado HLS 2019.1.
10-25-2020 11:44 AM - edited 10-25-2020 11:48 AM
If you are only trying to validate constant values from a configuration header file, then yes... you may be in luck... using the preprocessor you can test the values of the defines, then use #error to abort the compilation/synthesis.
e.g.
#if INP_ROWS!=1072
#error "some message"
#endif
Hope that Helps
If so, Please mark as solution accepted. Kudos also welcomed.
10-25-2020 11:20 AM
In the synthesized hardware, you would not 'throw an error' per se... but if you want to generate some monitor/debug in the hardware itself, you could generate an 'output' that is triggered when a condition is true or false... giving you the ability to see what is happening on your synthesized hardware.
Hope that Helps
If so, Please mark as solution accepted. Kudos also welcomed.
10-25-2020 11:25 AM
10-25-2020 11:44 AM - edited 10-25-2020 11:48 AM
If you are only trying to validate constant values from a configuration header file, then yes... you may be in luck... using the preprocessor you can test the values of the defines, then use #error to abort the compilation/synthesis.
e.g.
#if INP_ROWS!=1072
#error "some message"
#endif
Hope that Helps
If so, Please mark as solution accepted. Kudos also welcomed.
10-25-2020 11:48 PM