-
Notifications
You must be signed in to change notification settings - Fork 175
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
Breaking change in Record #533
Comments
Hm, I wonder what we should do here.
I think the second approach is better. |
I agree with whitequark, the second option is better at this point. We also need to enhance the Record test suite to catch stuff like this in the future. |
I also have downstream code for which the old behavior of |
Under no circumstances I will keep Your link doesn't work, so I can't offer you any alternative migration path. |
Ah sorry for the broken link, here is a working one. Recommendations are appreciated :). |
At a glance: isn't that yet another place where Interfaces would help? |
No, not really. The code tries to wrap a convenient interface around an Moreover, it gives you the ability to access the ports in a hierarchical way so that |
This is exactly the kind of problem interfaces are supposed to solve: being able to pass an AXI or a Wishbone bus around, and also integrate it into a bundle of buses, or a module interface.
I'm fine with this not being easy to do, because this is something I want to actively discourage. Elsewhere in nMigen and nMigen-SoC, I made sure that objects that override For wrapping PS7, I would suggest using a prefix or a suffix for all composite buses that puts them in a namespace different from individual ports. You could also use a prefix or a suffix only in case of a conflict, but that seems harder to use to me. |
I have exactly that (with an out of tree |
This is basically what I was trying to say without being rude. I understand why you did it (I used this sort of thing too in the past), it's just I think other approaches are preferable. |
Commit abbebf8 used __getattr__ to proxy Value methods called on Record. However, that did not proxy operators like __add__ because Python looks up the special operator methods directly on the class and does not run __getattr__ if they are missing. Instead of using __getattr__, explicitly enumerate and wrap every Value method that should be proxied. This also ensures backwards compatibility if more methods are added to Value later. Fixes #533.
abbebf8 introduced a breaking change in Record:
Some (all?) operators are not overloaded on it anymore because they are looked up on the class rather than on the instance so
__getattr__()
doesnt forward them.pre abbebf8:
post abbebf8:
The text was updated successfully, but these errors were encountered: