-
Notifications
You must be signed in to change notification settings - Fork 78
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
Error comparing Mem reads #57
Comments
I was working on this -- the basic problem is that a _MemIndexed will be converted to a WireVector when it is combined with another WireVector or assigned to a WireVector ( as_wires() does the conversion ). But when two _MemIndexed are combined it does not know what to do. 3 options that I see:
|
Added a test but commented out for with """ for now. |
Option 2 is not possible. |
Neat. Does the same restriction hold for namedtuples? Those are implemented in the collections library and are not technically builtin. |
According to the docstring in the collections source code, they actually "subclass" tuple. |
Maybe that is why when I tried it acted all weird. Any thoughts on 1 or 3? |
actually In[10]: b = tuple([1,2]) Now I don't know what to believe |
I think that 3 is the better choice, and I think it won't be as hard as you anticipate. For ROMs, I just lifted the read related calls from memblock and put them into _MemReadBase. The hardest part about the whole thing was tracking down the few places where there was a call to isinstance(xxx, Memblock) where I wanted the code to apply to ROMs as well. |
works for me. Once you have ROMs committed I will work on that -- I think there is a good chance of conflicts if I don't wait. |
Issue has resurfaced where a from pyrtl import * |
This is not a critical fix, by the way; for now I can just pre-declare read-values as WireVectors and assign the result of the port. |
fixed (it could have showed up a couple of places, such as in a mux as well) 11577a8 |
Right now a read port returns a
_MemIndexed
. Normal operations are not defined on this class, so attempting to compare two reads returnspyrtl.core.PyrtlError: error, attempt to covert wirevector to compile-time boolean
, and attempting a logical operations returns an unsupported operand types error.The text was updated successfully, but these errors were encountered: