-
Notifications
You must be signed in to change notification settings - Fork 52
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
Tight packing #47
Tight packing #47
Conversation
* Initial try at WidthCalculator for DataPack More template magic could make this nicer. * Fix: Was using wrong type * Small cleanup * Specializations improved,ap_int & ap_ufixed added * Catch update, test cases added for Xilinx types * Bit width was too small for test value * Prevent segfaults by explicit type usage Function resolution seems to not work as intended for some reason... * Fix: Replace reinterpret_cast for xilinx types * Comment finished * TypeHandler made struct, moved to namespace * Removed C-style type conversions * Typo fixed in DataPack.h Co-authored-by: definelicht <johannes@musicmedia.dk> * Code review: Pass ap_uint by refernce, not value Co-authored-by: definelicht <johannes@musicmedia.dk> Co-authored-by: definelicht <johannes@musicmedia.dk>
@derpda This is what I was talking about, just adding a kernel that can is run through HLS to make sure that it synthesizes correctly. |
I see, that was simpler than I thought... Thank you! In other news, my code now works with the new tight DataPack! I don't quite understand what went wrong, but changing a part (seemingly) unrelated to the DataPack changes made it work again. Should we add more tests to this regardless? |
It's okay like this unless you found something that could cause the issue in your code that we should check for |
I do see the expected (in my case significant) decreases in BRAM and URAM usage, and the code works so that's great. |
It must have something to do with the |
You can provide the exact minimal example where you see this happening |
Could you provide the code so we can take a look at what's going on? |
Sorry, it was a holiday weekend over here! Either way, you can find the (fairly) minimal example I was tinkering with here: |
Of course, no worries. In the diff I get, the tightly packed version seems to use less LUTs, FFs, and BRAM, and does not change the DSP usage (left is master, right is tight-packing): To me this looks exactly like what I'd expect. What was your concern? |
By the way, check out the new |
Well, like I said I had trouble reproducing the issue. HLS compilation and linking is kind of an opaque process, so it's hard to say why it caused the increased usage in my code. |
And thank you for the tip about |
Support for lower-than-1-byte types to be tightly packed in
DataPack
implemented by @derpda.