[Elementwise RTL] Adding elementwise RTL support for INT and UINT inputs#1570
Open
[Elementwise RTL] Adding elementwise RTL support for INT and UINT inputs#1570
Conversation
…HLS elementwise is present
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR transforms the
eltwisefunit into a more generaleltwiseRTL unit.It generalises the original
(float, float) -> floatunit to allow for the following additional cases:(float, int) -> (float)(int, float) -> (float)(int, int) -> int(float, uint) -> (float)(uint, float) -> (float)(uint, uint) -> uintMixed
uintandintprecision is currently not premitted. Widths of operands must also match.For the
(float, int) -> (float)and(int, float) -> (float)cases the new unit is able to acceptintinputs by converting them tofloatand using the originaleltwiseflogic. This is similar for theuintcases.For the
(int,int) -> intand(uint, uint) -> uintcases it leverages a newbinopimodule that performs binary operations on integer inputs. For multiplication this explicitly instantiates a DSP58 in a similar fashion to thebinopfmodule, however, this is not the case for theADD,SUB, andSBRoperations. In the multiplication case the bitwidth is restricted to what a single DSP unit permits, in this case<= 24 bitsforintand<= 23 bitsforuint.The
eltwisemodule contains a single toplevel entity that is parameterised with the types and widths.Each input is independently typed via A_FLOAT / B_FLOAT (1 =
float, 0 =int | uint). When an input is integer, A_WIDTH / B_WIDTH set the bit width and A_SIGNED / B_SIGNED select signed (int) vs unsigned (uint) interpretation. Float inputs are always 32 bits; the width/signed parameters are ignored for them. No other floating point formats are currently supported.