Remove cloneTypes in favor of autoclonetype (#51)
* Remove cloneTypes in favor of autoclonetype * Consistently use private val for autoclonetype
This commit is contained in:
@ -9,17 +9,11 @@ import sifive.blocks.devices.pinctrl.{Pin}
|
||||
// even though it looks like something that more directly talks to
|
||||
// a pin. It also makes it possible to change the exact
|
||||
// type of pad this connects to.
|
||||
class GPIOSignals[T <: Data] (pingen: ()=> T, c: GPIOParams) extends Bundle {
|
||||
class GPIOSignals[T <: Data](private val pingen: () => T, private val c: GPIOParams) extends Bundle {
|
||||
val pins = Vec(c.width, pingen())
|
||||
|
||||
override def cloneType: this.type =
|
||||
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
|
||||
}
|
||||
|
||||
class GPIOPins[T <: Pin] (pingen: ()=> T, c: GPIOParams) extends GPIOSignals[T](pingen, c) {
|
||||
override def cloneType: this.type =
|
||||
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
|
||||
}
|
||||
class GPIOPins[T <: Pin](pingen: () => T, c: GPIOParams) extends GPIOSignals[T](pingen, c)
|
||||
|
||||
object GPIOPinsFromPort {
|
||||
|
||||
|
Reference in New Issue
Block a user