-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Axi4Stream: userWidth tied to dataWidth #1252
Comments
The width of the TUSER (user) field can be any number of bits, according to the AMBA AXI 4 Stream specification. Thus there is no implicit correlation between the data width and the user width. Quoting the specification: The data width is typically specified in bytes; the specification requires this to be integer multiple of bytes. In case we only want to allow the recommendation, the user width is a multiple integer number of bits for each byte in the data width. Ideally though, we allow the number of user bits to be anything. |
Thanks a lot for the clarification @likewise, Would an additional Boolean like |
I'd be for allowing an arbitrary number of bits, I have seen a bunch of components that did not conform to the ARM recommendation. W.r.t. connecting: we could pre-pad with zeros in case the master is narrower then the slave, and create an error in case the master is too wide for the slave? (a user can then still manually resize if they know it's ok to throw bits away?) The only question: how to do the change w/o breaking older code? |
For user bits, I totally agree. And yes, we have the problem that the current components are not spec compliant, so we either break old code or keep being incompatible with the spec. I am not sure if there is a way to fix this. Maybe we can first change the implementation to deal with arbitrary user widths also, then change the API with new signatures? I think the spec has higher priority and our implementation is incompliant. (I have not used the SpinalHDL AXI Streaming components from the library for reasons like this.) (I would even consider to allow for an arbitrary number of bits in the data width. For me it makes perfect sense to stream 12-bit video or image samples across AXI Stream.) |
I've had the same problem, what time can update ! |
I think the reason why they recommend this is to allow width adapter to also "adapt" the user signal in the same way than they adapt the byte. So the user signal having data for each byte individualy. What is the purpose of the user signal in practice ?
AxiStream is realy realy realy much byte oriented, maybe instead of having an arbitrary number of data bits, the best would be to have an arbitrary parametrable bits per "byte", meaning "hoo one byte is now 12 bits". This would allow to keep all the "byte" related stuff consistant in for the bridges and adapters. |
One possible way is to define an alternative interface which accept BitCount but Int as parameter, so that there definition could be different and remains the old code works either. On other hand, the width itself is better to be defined as BitCount though. |
Or even more, we could have a user define Bundle for user data which could be placed at the wires that userWidth originaly specified. |
Hmm
So, maybe the best would just be to have an additional signal for the "per transaction" user data. That would make things very clear. |
I might be too late to add an opinion here… Would it make sense to add some kind of metadata to AXI Streams to signal how User data should be handled? This could be an a trait or something applied to an AXI Stream to indicate consumers should interact or adapt User data. I could come up with a working example if there’s any interest. |
Saying for instance "this range of user data is byte related" "this range of user data is transaction related" ? |
Yeah, something like that. I was thinking an AXI Stream's User data interactions could be grouped into two categories:
A stream could mix any Propagation and Association together: e.g., Transfer-level with an independent width. Components like the A resolution strategy would need to be specified for mismatched Association and Propagation types. I'm not sure how that would look. |
hmm |
I look a look at your attempt commit and I like where it's going. When you say "two signals" it looks like you meant "two parameters"? I'd just like to be able to query |
My attempt isn't good. |
I'm using a Vivado IP with AXI4Stream interface I have set up like this :
![image](https://private-user-images.githubusercontent.com/109208726/285851629-ea4c0311-378e-4304-b25f-af52afc472e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxMDM1MjMsIm5iZiI6MTcxOTEwMzIyMywicGF0aCI6Ii8xMDkyMDg3MjYvMjg1ODUxNjI5LWVhNGMwMzExLTM3OGUtNDMwNC1iMjVmLWFmNTJhZmM0NzJlNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyM1QwMDQwMjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMjBiMjkxOWJjZDJiM2ViNDRiMDM3NjYzYTRmM2Q1ZDc0NjJlNzQyNzdlY2Q3MjJkOWJjYWEzZWFlYjY2YzBmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.SWdBUmsY4CfbYgVl8u0MJjzFZlAm9pekIg9NI1rB7gs)
In my case my io is defined as :
I can currently ignore the user bits and keep them unconnected, so it's not a problem, but if I were to need to use them,
I have no way to build a config which matches the IP data and user width,
as Axi4StreamBundle defines here :
while the docstring mentions :
but in the end
user
's actual width ends up beingdataWidth*userWidth bits
the userbit adaptation also uses
dataWidth
here,it makes sense together if the
dataWidth*userWidth bits
size is actually needed,but I don't get why it's the case.
Is there an explicit
dataWidth
touserWidth
ratio requirement in the Axi4 specification,or it's some kind of refactor typo ?
I have made a minimal change here : oletf@6313695, which made sense to me,
I can PR if this change makes sense and I didn't miss any important part related to AXI4Stream specification.
The text was updated successfully, but these errors were encountered: