diff options
| author | Aditya Naik | 2023-12-15 09:22:44 -0800 |
|---|---|---|
| committer | Aditya Naik | 2023-12-15 09:22:44 -0800 |
| commit | 783bcb8b3436e342a04169eaf967db2dbc58abc7 (patch) | |
| tree | 7e67f79fa4e5d6662d5be696f86403bed677398d /AbstractModule.scala | |
| parent | af415532cf160e63e971ceb301833b8433c18a50 (diff) | |
Add abstract module
Diffstat (limited to 'AbstractModule.scala')
| -rw-r--r-- | AbstractModule.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/AbstractModule.scala b/AbstractModule.scala new file mode 100644 index 00000000..2c2574ad --- /dev/null +++ b/AbstractModule.scala @@ -0,0 +1,21 @@ +package chiselTests + +import chisel3._ +import chisel3.stage.ChiselStage + +class AbstractModule[T <: Data](params: T) extends Module[T] { + val node = IO(params) +} + +class AbstractModuleContainer extends Module { + val mod1 = Module(new AbstractModule[UInt](Input(UInt(0.W)))) + val mod2 = Module(new AbstractModule[UInt](Output(UInt(0.W)))) + mod2.node := mod1.node +} + +object main { + def main(args: Array[String]): Unit = { + // println(getVerilogString(new Example)) + println(chisel3.stage.ChiselStage.emitVerilog(new AbstractModuleContainer)) + } +} |
