File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
core/src/main/scala/chisel3 Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ private[chisel3] abstract class EnumTypeImpl(private[chisel3] val factory: Chise
7070 _wire := this .asUInt
7171 _wire
7272 }
73- _padded.asTypeOf (that)
74- case None => super .asTypeOf (that)
73+ _padded._asTypeOfImpl (that)
74+ case None => super ._asTypeOfImpl (that)
7575 }
7676 }
7777
@@ -222,15 +222,7 @@ private[chisel3] abstract class EnumTypeImpl(private[chisel3] val factory: Chise
222222 for ((name, value) <- allNamesPadded) {
223223 when(this === value) {
224224 for ((r, c) <- result.zip(name)) {
225- // todo: this doesn't work in scala3
226- // r := c.toChar.U
227- // ^^^^^^^^^^
228- // value U is not a member of Char.
229- // An extension method was tried,
230- // but could not be fully constructed:
231- //
232- // chisel3.fromLongToLiteral(c.toChar)
233- // r := c.toChar.U
225+ r := UInt .Lit (BigInt (c.toChar), Width ())
234226 }
235227 }
236228 }
Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ private[chisel3] trait DataImpl extends HasId with NamedComponent { self: Data =
861861 /** Returns Some(width) if the width is known, else None. */
862862 final def widthOption : Option [Int ] = if (isWidthKnown) Some (getWidth) else None
863863
864- protected def _asTypeOfImpl [T <: Data ](that : T )(implicit sourceInfo : SourceInfo ): T = {
864+ private [chisel3] def _asTypeOfImpl [T <: Data ](that : T )(implicit sourceInfo : SourceInfo ): T = {
865865 that._fromUInt(this .asUInt).asInstanceOf [T ].viewAsReadOnly { _ =>
866866 " Return values of asTypeOf are now read-only"
867867 }
You can’t perform that action at this time.
0 commit comments