summaryrefslogtreecommitdiff
path: root/AbstractModule.scala
blob: 2c2574adaca6d71afb6b73ebefa7040ef63bd735 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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))
  }
}