Clones an existing module and returns a record of all its top-level ports.
Clones an existing module and returns a record of all its top-level ports. Each element of the record is named with a string matching the corresponding port's name and shares the port's type.
val q1 = Module(new Queue(UInt(32.W), 2)) val q2_io = CloneModuleAsRecord(q1)("io").asInstanceOf[q1.io.type] q2_io.enq <> q1.io.deq