diff options
| author | Aditya Naik | 2024-02-14 16:16:47 -0800 |
|---|---|---|
| committer | Aditya Naik | 2024-02-14 16:16:47 -0800 |
| commit | 6a132a490c280684fd27f09a3af2249faf4d13d1 (patch) | |
| tree | c847aa87994bc9bf654f2152baebab7a701a084a /AbstractModuleStandalone.scala | |
| parent | 0192314ca92572f79933c5101342b8c38022e566 (diff) | |
dynamic wire creation
Diffstat (limited to 'AbstractModuleStandalone.scala')
| -rw-r--r-- | AbstractModuleStandalone.scala | 5 |
1 files 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 } } |
