-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverting changes to unsigned variables causing Future SW CI crash #311
Conversation
@mlarson02 This is strange, since firmware-hls/project/env_hls.tcl Line 19 in f5c736c
The only thing I can figure is that the older version of GCC that HLS uses isn't smart enough to trace the template parameters that are set to zero to the for-loops where they are compared with unsigned integers. Anyway, you saw the compiler error in the CI that I was trying to work around when I originally made the loop counters unsigned. I guess you don't see this in the future SW emulation because you include the I think a better solution to both compiler errors is to just convert the template parameters in TrackBuilder.h to signed integers. I took the liberty of pushing this to your branch, while preserving your commit history so far. We'll see if the CI likes it, but let me know if this is acceptable to CMSSW. |
@aehart Thanks for pushing those changes. Yeah, I don't think suppressing the HLS warnings as we are currently doing should still be necessary, I'm not sure why that was included in the BuildFile but I think ideally we wouldn't require it. It seems using signed template parameters has resulted in the same error ( |
The fix f5c736c , which I expected to work, seems to fail when running Vivado SIM on the chain https://gitlab.cern.ch/cms-l1tk/firmware-hls/-/commit/2777aa061e6c550b71c3c82c7f9573bababee1b3 , with error https://gitlab.cern.ch/cms-l1tk/firmware-hls/-/jobs/34825473 in TrackBuilder.h at this line https://gitlab.cern.ch/cms-l1tk/firmware-hls/-/blob/2777aa061e6c550b71c3c82c7f9573bababee1b3/TrackletAlgorithm/TrackBuilder.h#L314 . Apparently since array diskStubWords was declared with indefinate array size, it doesn't like the range of index j being unknown at compile time. |
@mlarson02 @tomalin I think the reason the casting done in f5c736c and 51a8ec1 doesn't work is because HLS is somehow interpreting the bodies of loops before realizing the loops have zero iterations. This is very dumb, but it's my best guess as to why C-synthesis fails. I just pushed a commit that seems to allow C-synthesis in these cases. Basically, I just added explicit checks to the loop conditions that the relevant template parameters be greater than zero. This avoids casting, and bafflingly, HLS accepts this in my testing. Let's see if the CI likes this… |
@aehart Thanks for making these changes, the HLS CI and (when using this branch) Future SW CI are both passing. @tomalin Does this PR then look okay to be merged? |
Yes, though please add a comment to the code explaining the weird logic, otherwise someone is bound to "simplify" it back again in future. And please raise the silly compiler option issue with the SW group. |
I just added comments where necessary and created a thread with the SW group here https://cms-talk.web.cern.ch/t/problems-caused-by-werror-type-limits-compiler-flag/32918. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved when CI passes
Reverts changes made in PR #304 that changes various looped over variables in TrackBuilder.h to signed, causing
error: comparison is always false due to limited range of data type [-Werror=type-limits]
in future SW CI. Because this warning has been flagged as an error centrally in CMSSW, the only current fix for this is to revert these variables to not being unsigned.