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
Hwtypes2 #515
Conversation
Question on the relationship between directed/undirected types. Right now, a directed type is not related to an undirected type, e.g. >>> isinstance(m.In(m.Bit)(), m.Bit)
False
>>> isinstance(m.In(m.Bit), m.BitKind)
True This works because we use instances of the meta class to check the type of the type, so the type of directed types are the same (they are instances of BitKind) However, now we are planning to use For this to work, we need
But that also means that a directed instance is an instance of an undirected instance
Which is a departure from the old behavior. I don't think this should affect existing code since usually in this case we were using the meta class relationship. The question is: is having an instance of an directed type also an instance of an undirected type a reasonable design? Otherwise we may have to revert to the |
I think the old way was broken, and the new way is better. That is, a directed type should be a subclass of an undirected type. |
Good to hear :), I discussed this offline with James H. and Raj and they both agree. |
I've added tests for the various typing relations, I'll merge this in tomorrow (alongside mantle/fault) unless there are any more objections. Peak/lassen/garnet will need to be updated |
Looks great. Thanks for adding all these tests. |
This code works with master
but got error with hwtypes2
looks like due to
--
|
Mantle branch: phanrahan/mantle#165
Fault branch: leonardt/fault#187
Migration guide is in
docs/magma_2_migration_guide.md
(we'll probably need to add to this)