diff options
| author | Aditya Naik | 2024-02-14 15:51:57 -0800 |
|---|---|---|
| committer | Aditya Naik | 2024-02-14 15:51:57 -0800 |
| commit | 0192314ca92572f79933c5101342b8c38022e566 (patch) | |
| tree | f3f8e7bc750a6a0faa11b25001e462f68cf3fbd5 /AbstractModule.scala | |
| parent | e7bdafd06c0760c562b27ce8a483493ce7f06864 (diff) | |
Get AbstractInterface arithmetic working
Diffstat (limited to 'AbstractModule.scala')
| -rw-r--r-- | AbstractModule.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/AbstractModule.scala b/AbstractModule.scala index 5da2550a..103d598f 100644 --- a/AbstractModule.scala +++ b/AbstractModule.scala @@ -5,8 +5,8 @@ import chisel3.stage.ChiselStage import chisel3.MetaConnect._ object TypeArithmetic { - implicit val f1: UInt => UInt => UInt = (a: UInt) => (b: UInt) => Mux(a > b, a, b) - implicit val f2: SomeTypeContainer => Unit => SomeTypeContainer = (a: SomeTypeContainer) => (b: Unit) => a + // implicit val f1: UInt => UInt => UInt = (a: UInt) => (b: UInt) => Mux(a > b, a, b) + implicit val f2: SomeTypeContainer => UInt => SomeTypeContainer = (a: SomeTypeContainer) => (b: UInt) => new SomeTypeContainer(b.litValue.toInt+a.w) } case class SomeTypeContainer(w: Int) extends UInt(w.W) @@ -17,8 +17,8 @@ class AbstractModuleContainer extends AbstractModule({ val mod3 = new AbstractInterface[SomeTypeContainer](Output(SomeTypeContainer(16))) import TypeArithmetic._ - val typeA = mod1.ioNode.makeConnection(mod2.ioNode) - val typeB = mod2.ioNode.makeConnection(mod3.ioNode) + val typeA = mod3.ioNode.makeConnection(mod2.ioNode) + // val typeB = mod2.ioNode.makeConnection(mod3.ioNode) // println(s"\ttypeA: ${typeA}\n\ttypeB: ${typeB}") // need to create versions of mods1-3 with these new type params // similar to log aggregation writer monad? but more like type aggregation |
