From 6a132a490c280684fd27f09a3af2249faf4d13d1 Mon Sep 17 00:00:00 2001 From: Aditya Naik Date: Wed, 14 Feb 2024 16:16:47 -0800 Subject: dynamic wire creation --- AbstractModuleStandalone.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AbstractModuleStandalone.scala b/AbstractModuleStandalone.scala index 5f94b7e8..050cd4f4 100644 --- a/AbstractModuleStandalone.scala +++ b/AbstractModuleStandalone.scala @@ -9,8 +9,6 @@ object MetaConnect { implicit def abstractInterfaceConnection[A, B, C](implicit f: A => B => C): AbstractInterface[A] => AbstractInterface[B] => AbstractInterface[C] = (a: AbstractInterface[A]) => (b: AbstractInterface[B]) => new AbstractInterface(f(a.params)(b.params)) } - - case class AbstractInterface[T](params: T) object TypeArithmetic { @@ -20,6 +18,8 @@ object TypeArithmetic { val litval: Int = 1 new SomeTypeContainer(litval.toInt+a.i) } + // Dynamically create a wire + implicit val f4: UInt => UInt => (() => Any) = (a: UInt) => (b: UInt) => (() => Wire(a)) } case class SomeTypeContainer(i: Int) @@ -40,5 +40,6 @@ object AbstractModuleStandalone { bar makeConnection baz makeConnection foo abaz makeConnection afoo + afoo makeConnection abar } } -- cgit v1.2.3