summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Element.scala
diff options
context:
space:
mode:
authorJack Koenig2020-12-01 22:44:11 -0800
committerGitHub2020-12-01 22:44:11 -0800
commit5a6ce6604b5bde06dc88c55bc76aaf76aff87437 (patch)
treed05b075b94a521889129ec3f2e96a983d136faaa /core/src/main/scala/chisel3/Element.scala
parentba05dcaf10251f0c5e9eb0f8e30e101b83830c59 (diff)
Fix RegInit of Bundle lits (#1688)
Implemented by folding Element.ref into Data.ref. Element.ref had special handling for literals, but because Bundles can also be literals, there were code paths that tried to get the ref of a Bundle literal which was non-existent. Now, all literals are handled together. Because FIRRTL does not have support for Bundle literals, Bundle literal refs are implemented by materializing a Wire.
Diffstat (limited to 'core/src/main/scala/chisel3/Element.scala')
-rw-r--r--core/src/main/scala/chisel3/Element.scala10
1 files changed, 0 insertions, 10 deletions
diff --git a/core/src/main/scala/chisel3/Element.scala b/core/src/main/scala/chisel3/Element.scala
index 7596bc82..55415f3d 100644
--- a/core/src/main/scala/chisel3/Element.scala
+++ b/core/src/main/scala/chisel3/Element.scala
@@ -40,16 +40,6 @@ abstract class Element extends Data {
override def litOption: Option[BigInt] = litArgOption.map(_.num)
private[chisel3] def litIsForcedWidth: Option[Boolean] = litArgOption.map(_.forcedWidth)
- // provide bits-specific literal handling functionality here
- override private[chisel3] def ref: Arg = topBindingOpt match {
- case Some(ElementLitBinding(litArg)) => litArg
- case Some(BundleLitBinding(litMap)) => litMap.get(this) match {
- case Some(litArg) => litArg
- case _ => throwException(s"internal error: DontCare should be caught before getting ref")
- }
- case _ => super.ref
- }
-
private[chisel3] def legacyConnect(that: Data)(implicit sourceInfo: SourceInfo): Unit = {
// If the source is a DontCare, generate a DefInvalid for the sink,
// otherwise, issue a Connect.