-trait PeripheryGPIO {
- this: TopNetwork { val gpioConfig: GPIOConfig } =>
- val gpio = LazyModule(new TLGPIO(p, gpioConfig))
- gpio.node := TLFragmenter(peripheryBusConfig.beatBytes, cacheBlockBytes)(peripheryBus.node)
- intBus.intnode := gpio.intnode
+case object PeripheryGPIOKey extends Field[Seq[GPIOParams]]
+
+trait HasPeripheryGPIO extends HasPeripheryBus with HasInterruptBus {
+ val gpioParams = p(PeripheryGPIOKey)
+ val gpios = gpioParams map { params =>
+ val gpio = LazyModule(new TLGPIO(pbus.beatBytes, params))
+ gpio.node := pbus.toVariableWidthSlaves
+ ibus.fromSync := gpio.intnode
+ gpio
+ }