projects
/
sifive-blocks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ca609d
)
GPIO: Make GPIO peripheral another listable one
author
Megan Wachs
<megan@sifive.com>
Thu, 8 Jun 2017 23:25:20 +0000
(16:25 -0700)
committer
Megan Wachs
<megan@sifive.com>
Thu, 8 Jun 2017 23:25:20 +0000
(16:25 -0700)
src/main/scala/devices/gpio/GPIOPeriphery.scala
patch
|
blob
|
history
diff --git
a/src/main/scala/devices/gpio/GPIOPeriphery.scala
b/src/main/scala/devices/gpio/GPIOPeriphery.scala
index 20f8b5d8172438746251a471dd1f205d346ef78a..3c7a2ec41120cab68ac680c782d4199112223ef3 100644
(file)
--- a/
src/main/scala/devices/gpio/GPIOPeriphery.scala
+++ b/
src/main/scala/devices/gpio/GPIOPeriphery.scala
@@
-11,22
+11,27
@@
import rocketchip.{
}
import uncore.tilelink2.TLFragmenter
}
import uncore.tilelink2.TLFragmenter
-case object PeripheryGPIOKey extends Field[
GPIOParams
]
+case object PeripheryGPIOKey extends Field[
Seq[GPIOParams]
]
trait HasPeripheryGPIO extends HasTopLevelNetworks {
val gpioParams = p(PeripheryGPIOKey)
trait HasPeripheryGPIO extends HasTopLevelNetworks {
val gpioParams = p(PeripheryGPIOKey)
- val gpio = LazyModule(new TLGPIO(peripheryBusBytes, gpioParams))
- gpio.node := TLFragmenter(peripheryBusBytes, cacheBlockBytes)(peripheryBus.node)
- intBus.intnode := gpio.intnode
+ val gpio = gpioParams map {params =>
+ val gpio = LazyModule(new TLGPIO(peripheryBusBytes, params))
+ gpio.node := TLFragmenter(peripheryBusBytes, cacheBlockBytes)(peripheryBus.node)
+ intBus.intnode := gpio.intnode
+ gpio
+ }
}
trait HasPeripheryGPIOBundle extends HasTopLevelNetworksBundle {
val outer: HasPeripheryGPIO
}
trait HasPeripheryGPIOBundle extends HasTopLevelNetworksBundle {
val outer: HasPeripheryGPIO
- val gpio =
new GPIOPortIO(outer.gpioParams
)
+ val gpio =
HeterogeneousBag(outer.gpioParams(map(new GPIOPortIO(_)))
)
}
trait HasPeripheryGPIOModule extends HasTopLevelNetworksModule {
val outer: HasPeripheryGPIO
val io: HasPeripheryGPIOBundle
}
trait HasPeripheryGPIOModule extends HasTopLevelNetworksModule {
val outer: HasPeripheryGPIO
val io: HasPeripheryGPIOBundle
- io.gpio <> outer.gpio.module.io.port
+ (io.gpio zip outer.gpio) foreach { case (io, device) =>
+ io.gpio <> device.module.io.port
+ }
}
}