make some base bundle classes easier to clone (#20)
authorHenry Cook <henry@sifive.com>
Thu, 15 Jun 2017 02:47:56 +0000 (19:47 -0700)
committerGitHub <noreply@github.com>
Thu, 15 Jun 2017 02:47:56 +0000 (19:47 -0700)
src/main/scala/devices/gpio/GPIO.scala
src/main/scala/devices/spi/SPIBundle.scala

index 9dd8d87ba58ef8d6da8da59263fa5fd771641a14..8c4cfbd3beae29c03f84630b0787f5ec770d5d2e 100644 (file)
@@ -5,7 +5,7 @@ import Chisel._
 import config.Parameters
 import regmapper._
 import uncore.tilelink2._
-import util.AsyncResetRegVec
+import util.{AsyncResetRegVec, GenericParameterizedBundle}
 
 case class GPIOParams(address: BigInt, width: Int)
 
@@ -93,7 +93,7 @@ class GPIOPin extends Bundle {
 // level, and we have to do the pinmux
 // outside of RocketChipTop.
 
-class GPIOPortIO(c: GPIOParams) extends Bundle {
+class GPIOPortIO(c: GPIOParams) extends GenericParameterizedBundle(c) {
   val pins = Vec(c.width, new GPIOPin)
   val iof_0 = Vec(c.width, new GPIOPinIOF).flip
   val iof_1 = Vec(c.width, new GPIOPinIOF).flip
index 5e2cadb1cda8fdf87c95781e886a6d988cbebf36..cb96df5829ef821d337883011b5f2e268f24aadb 100644 (file)
@@ -2,8 +2,9 @@
 package sifive.blocks.devices.spi
 
 import Chisel._
+import util.GenericParameterizedBundle
 
-abstract class SPIBundle(val c: SPIParamsBase) extends Bundle {
+abstract class SPIBundle(val c: SPIParamsBase) extends GenericParameterizedBundle(c) {
   override def cloneType: SPIBundle.this.type =
     this.getClass.getConstructors.head.newInstance(c).asInstanceOf[this.type]
 }