This tracks PR #478 in rocketchip.
case class GPIOConfig(address: BigInt, width: Int)
trait HasGPIOParameters {
- val params: Tuple2[Parameters, GPIOConfig]
- implicit val p = params._1
- val c = params._2
+ implicit val p: Parameters
+ val params: GPIOConfig
+ val c = params
}
// YAGNI: Make the PUE, DS, and
}
// Magic TL2 Incantation to create a TL2 Slave
-class TLGPIO(p: Parameters, c: GPIOConfig)
+class TLGPIO(c: GPIOConfig)(implicit p: Parameters)
extends TLRegisterRouter(c.address, interrupts = c.width, beatBytes = p(PeripheryBusConfig).beatBytes)(
- new TLRegBundle(Tuple2(p, c), _) with GPIOBundle)(
- new TLRegModule(Tuple2(p, c), _, _) with GPIOModule)
+ new TLRegBundle(c, _) with GPIOBundle)(
+ new TLRegModule(c, _, _) with GPIOModule)
trait PeripheryGPIO {
this: TopNetwork { val gpioConfig: GPIOConfig } =>
- val gpio = LazyModule(new TLGPIO(p, gpioConfig))
+ val gpio = LazyModule(new TLGPIO(gpioConfig))
gpio.node := TLFragmenter(peripheryBusConfig.beatBytes, cacheBlockBytes)(peripheryBus.node)
intBus.intnode := gpio.intnode
}
}
trait HasMockAONParameters {
- val params: (MockAONConfig, Parameters)
- val c = params._1
- implicit val p = params._2
+ implicit val p: Parameters
+ val params: MockAONConfig
+ val c = params
}
class MockAONPMUIO extends Bundle {
}
-class MockAON(c: MockAONConfig)(implicit val p: Parameters)
+class MockAON(c: MockAONConfig)(implicit p: Parameters)
extends TLRegisterRouter(c.address, interrupts = 2, size = c.size, beatBytes = p(PeripheryBusConfig).beatBytes, concurrency = 1)(
- new TLRegBundle((c, p), _) with MockAONBundle)(
- new TLRegModule((c, p), _, _) with MockAONModule)
+ new TLRegBundle(c, _) with MockAONBundle)(
+ new TLRegModule(c, _, _) with MockAONModule)
val rsts = new MockAONMOffRstIO()
}
-class MockAONWrapper(c: MockAONConfig)(implicit val p: Parameters) extends LazyModule {
+class MockAONWrapper(c: MockAONConfig)(implicit p: Parameters) extends LazyModule {
val node = TLAsyncInputNode()
val intnode = IntOutputNode()
}
trait HasPWMParameters {
- val params: (PWMConfig, Parameters)
- val c = params._1
- implicit val p = params._2
+ implicit val p: Parameters
+ val params: PWMConfig
+ val c = params
}
trait PWMBundle extends Bundle with HasPWMParameters {
regmap((GenericTimer.timerRegMap(pwm, 0, c.regBytes)):_*)
}
-class TLPWM(c: PWMConfig)(implicit val p: Parameters)
+class TLPWM(c: PWMConfig)(implicit p: Parameters)
extends TLRegisterRouter(c.address, interrupts = c.ncmp, size = c.size, beatBytes = p(PeripheryBusConfig).beatBytes)(
- new TLRegBundle((c, p), _) with PWMBundle)(
- new TLRegModule((c, p), _, _) with PWMModule)
+ new TLRegBundle(c, _) with PWMBundle)(
+ new TLRegModule(c, _, _) with PWMModule)
RegField.r(1, ip.rxwm)))
}
-abstract class TLSPIBase(c: SPIConfigBase)(implicit val p: Parameters) extends LazyModule {
+abstract class TLSPIBase(c: SPIConfigBase)(implicit p: Parameters) extends LazyModule {
require(isPow2(c.rSize))
val rnode = TLRegisterNode(address = AddressSet(c.rAddress, c.rSize-1), beatBytes = p(PeripheryBusConfig).beatBytes)
val intnode = IntSourceNode(1)
}
trait MixUARTParameters {
- val params: (UARTConfig, Parameters)
- val c = params._1
- implicit val p = params._2
+ implicit val p: Parameters
+ val params: UARTConfig
+ val c = params
}
trait UARTTopBundle extends Bundle with MixUARTParameters with HasUARTParameters {
}
// Magic TL2 Incantation to create a TL2 Slave
-class UART(c: UARTConfig)(implicit val p: Parameters)
+class UART(c: UARTConfig)(implicit p: Parameters)
extends TLRegisterRouter(c.address, interrupts = 1, beatBytes = p(PeripheryBusConfig).beatBytes)(
- new TLRegBundle((c, p), _) with UARTTopBundle)(
- new TLRegModule((c, p), _, _) with UARTTopModule)
+ new TLRegBundle(c, _) with UARTTopBundle)(
+ new TLRegModule(c, _, _) with UARTTopModule)