You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm extending ChiselEnum for some features.
An inner class in the ChiselEnum is bad for extending. It's not possible to override an inner class. Expose the outer class might not be a good solution, but it's effective for me.
Type of issue: Feature Request
Is your feature request related to a problem? Please describe.
I'm extending
ChiselEnum
for some features.An inner class in the
ChiselEnum
is bad for extending. It's not possible to override an inner class. Expose the outer class might not be a good solution, but it's effective for me.Describe the solution you'd like
chisel/core/src/main/scala/chisel3/ChiselEnum.scala
Line 236 in 17398c1
Maybe change to
class Type(val factor: ChiselEnum) extends EnumType(this)
Additional context
It's possible to use
implict class
to extendChiselEnum#Type
, but we can't apply implict conversion automatically at runtime.For example:
What is the use case for implementing this feature?
Here are some examples:
So we can use
foo.is(Foo.bar)
instead offoo === Foo.bar
. It's shorter.So we can use
AluOp().default
to get a literal value.The text was updated successfully, but these errors were encountered: