X-Git-Url: https://git.libre-soc.org/?p=sifive-blocks.git;a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fpwm%2FPWMPeriphery.scala;h=94f65dd760e8c5d75537fc380140492a689526d8;hp=3754f71ca3dbf562d05f3169ba370e9a5e1335ba;hb=38f537c438224418356c1ef6979c482841a0da4c;hpb=6a13639cf3e64acf4a672daa0c895e4919d4a6dc diff --git a/src/main/scala/devices/pwm/PWMPeriphery.scala b/src/main/scala/devices/pwm/PWMPeriphery.scala index 3754f71..94f65dd 100644 --- a/src/main/scala/devices/pwm/PWMPeriphery.scala +++ b/src/main/scala/devices/pwm/PWMPeriphery.scala @@ -13,10 +13,17 @@ class PWMPortIO(val c: PWMParams) extends Bundle { override def cloneType: this.type = new PWMPortIO(c).asInstanceOf[this.type] } -class PWMPins[T <: Pin] (pingen: ()=> T, val c: PWMParams) extends Bundle { +class PWMSignals[T <: Data] (pingen: ()=> T, val c: PWMParams) extends Bundle { val pwm: Vec[T] = Vec(c.ncmp, pingen()) + override def cloneType: this.type = + this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type] +} + + +class PWMPins[T <: Pin] (pingen: ()=> T, val c: PWMParams) extends PWMSignals[T](pingen, c) { + override def cloneType: this.type = this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]