Remove cloneTypes in favor of autoclonetype (#51)
* Remove cloneTypes in favor of autoclonetype * Consistently use private val for autoclonetype
This commit is contained in:
@ -2,12 +2,8 @@
|
||||
package sifive.blocks.devices.spi
|
||||
|
||||
import Chisel._
|
||||
import freechips.rocketchip.util.GenericParameterizedBundle
|
||||
|
||||
abstract class SPIBundle(val c: SPIParamsBase) extends GenericParameterizedBundle(c) {
|
||||
override def cloneType: SPIBundle.this.type =
|
||||
this.getClass.getConstructors.head.newInstance(c).asInstanceOf[this.type]
|
||||
}
|
||||
abstract class SPIBundle(private val c: SPIParamsBase) extends Bundle
|
||||
|
||||
class SPIDataIO extends Bundle {
|
||||
val i = Bool(INPUT)
|
||||
|
@ -5,15 +5,11 @@ import Chisel._
|
||||
import chisel3.experimental.{withClockAndReset}
|
||||
import sifive.blocks.devices.pinctrl.{PinCtrl, Pin}
|
||||
|
||||
class SPISignals[T <: Data] (pingen: ()=> T, c: SPIParamsBase) extends SPIBundle(c) {
|
||||
class SPISignals[T <: Data](private val pingen: () => T, c: SPIParamsBase) extends SPIBundle(c) {
|
||||
|
||||
val sck = pingen()
|
||||
val dq = Vec(4, pingen())
|
||||
val cs = Vec(c.csWidth, pingen())
|
||||
|
||||
override def cloneType: this.type =
|
||||
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
|
||||
|
||||
}
|
||||
|
||||
class SPIPins[T <: Pin] (pingen: ()=> T, c: SPIParamsBase) extends SPISignals(pingen, c)
|
||||
|
Reference in New Issue
Block a user