-
Notifications
You must be signed in to change notification settings - Fork 613
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
PeekPokeTester doesn't work with StrongEnum #932
Comments
I haven't looked at this, but is converting to |
@seldridge That would have been a nice fix, but that produces the following error:
Also, using reflection to change the runtime type or get at the internal UInt field also doesn't work. I guess a workaround workaround would be to use a |
I think I can get a fix for this out in the next day or two. I'm not sure I understand what you mean by the enum's internal UInt field; enums aren't composed of other Chisel objects, although they do get translated to UInts when going from Chisel to FIRRTL. |
This is what I meant by "interal UInt", but I also don't have a great mental model of what happens during elaboration. Thanks for the fix! |
Actually, looking at this problem again, I'm unsure which of the possible solutions to implement. None of them seem ideal to me. The problem is that
I'm leaning towards either making enums inherit from |
Proposal 2 sounds reasonable if Regarding the other approaches, Proposal 1 would be simple to implement, but feels like it defeats the purpose of using a type system. Perhaps an explicit conversion to |
Building off Nick's comment - could we add a |
A conversion from @edwardcwang I considered that as well. As I understand it, we'd have to mix in the trait in |
@nhynes If you need enum testing support right away, then you can pull this branch: https://github.com/hngenc/chisel-testers/tree/add_enum_support. I haven't tested it extensively, but it seems to work for examples like |
Type of issue: bug report
Impact: API addition (no impact on existing code)
Development Phase: request
Chisel version:
3.2-SNAPSHOT
Error messages:
poke
:expect
:Internally, the StrongEnum
Value
items are assignedUInt
s, but there's no way of accessing these from the outside world.The text was updated successfully, but these errors were encountered: