Add missing cloneType methods to pin bundles
[sifive-blocks.git] / src / main / scala / devices / uart / UARTPeriphery.scala
index d94d5180941502ff3e3bc0f872d248f582c973d0..105592d2042e7a6f19d265d37c45f3e5ff771c46 100644 (file)
@@ -44,6 +44,9 @@ class UARTPins[T <: Pin] (pingen: () => T) extends Bundle {
   val rxd = pingen()
   val txd = pingen()
 
+  override def cloneType: this.type =
+    this.getClass.getConstructors.head.newInstance(pingen).asInstanceOf[this.type]
+
   def fromUARTPort(uart: UARTPortIO, clock: Clock, reset: Bool, syncStages: Int = 0) {
     withClockAndReset(clock, reset) {
       txd.outputPin(uart.txd)