diff options
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala b/chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala index c359a119..1689e6ad 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/StrongEnum.scala @@ -102,10 +102,10 @@ abstract class EnumType(private val factory: EnumFactory, selfAnnotating: Boolea this.factory == that.asInstanceOf[EnumType].factory } - // This isn't actually used anywhere (and it would throw an exception anyway). But it has to be defined since we - // inherit it from Data. private[core] override def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo, - compileOptions: CompileOptions): Unit = ??? + compileOptions: CompileOptions): Unit = { + this := factory.apply(that.asUInt) + } final def === (that: EnumType): Bool = macro SourceInfoTransform.thatArg final def =/= (that: EnumType): Bool = macro SourceInfoTransform.thatArg |
