From 0c43dadf60c1485be348115c20690990f0fea940 Mon Sep 17 00:00:00 2001 From: Adam Izraelevitz Date: Thu, 28 Oct 2021 18:18:34 -0700 Subject: Exposing more APIs from D/I internals (#2220) Exposing more internals of D/I, which are required for supporting D/I with more powerful Chisel libraries: - Exposing IsClone[_] - Exposing InstantiableClone[_] - Gated builders for Instance/Definition - Unsealing Lookupable, with protected accessors for proto and cloned--- src/main/scala/chisel3/aop/Select.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/scala/chisel3/aop/Select.scala b/src/main/scala/chisel3/aop/Select.scala index 8bdf4344..8f5a2577 100644 --- a/src/main/scala/chisel3/aop/Select.scala +++ b/src/main/scala/chisel3/aop/Select.scala @@ -53,7 +53,7 @@ object Select { case d: DefInstance => d.id match { case p: chisel3.internal.BaseModule.IsClone[_] => - parent._lookup { x => new Instance(Right(p)).asInstanceOf[Instance[BaseModule]] } + parent._lookup { x => new Instance(Clone(p)).asInstanceOf[Instance[BaseModule]] } case other: BaseModule => parent._lookup { x => other } } @@ -75,7 +75,7 @@ object Select { case d: DefInstance => d.id match { case p: chisel3.internal.BaseModule.IsClone[_] => - val i = parent._lookup { x => new Instance(Right(p)).asInstanceOf[Instance[BaseModule]] } + val i = parent._lookup { x => new Instance(Clone(p)).asInstanceOf[Instance[BaseModule]] } if(i.isA[T]) Some(i.asInstanceOf[Instance[T]]) else None case other: BaseModule => val i = parent._lookup { x => other } @@ -111,7 +111,7 @@ object Select { case i: DefInstance => i.id match { case p: chisel3.internal.BaseModule.IsClone[_] => - parent._lookup { x => new Definition(Left(p.getProto)).asInstanceOf[Definition[BaseModule]] } + parent._lookup { x => new Definition(Proto(p.getProto)).asInstanceOf[Definition[BaseModule]] } case other: BaseModule => parent._lookup { x => other.toDefinition } } @@ -139,7 +139,7 @@ object Select { case d: DefInstance => d.id match { case p: chisel3.internal.BaseModule.IsClone[_] => - val d = parent._lookup { x => new Definition(Right(p)).asInstanceOf[Definition[BaseModule]] } + val d = parent._lookup { x => new Definition(Clone(p)).asInstanceOf[Definition[BaseModule]] } if(d.isA[T]) Some(d.asInstanceOf[Definition[T]]) else None case other: BaseModule => val d = parent._lookup { x => other.toDefinition } -- cgit v1.2.3