1
0

rocketchip: add Zero device to the memory subsystem

This commit is contained in:
Wesley W. Terpstra
2017-02-03 17:18:20 -08:00
parent b240505a15
commit a3e56cfa5e
3 changed files with 38 additions and 0 deletions

View File

@ -34,6 +34,9 @@ case object PeripheryBusConfig extends Field[TLBusConfig]
case object PeripheryBusArithmetic extends Field[Boolean]
/* Specifies the SOC-bus configuration */
case object SOCBusConfig extends Field[TLBusConfig]
/* Specifies the location of the Zero device */
case class ZeroConfig(base: Long, size: Long, beatBytes: Int)
case object ZeroConfig extends Field[ZeroConfig]
/** Utility trait for quick access to some relevant parameters */
trait HasPeripheryParameters {
@ -121,6 +124,36 @@ trait PeripheryMasterAXI4MemModule {
/////
trait PeripheryZero {
this: TopNetwork =>
val module: PeripheryZeroModule
private val config = p(ZeroConfig)
private val address = AddressSet(config.base, config.size-1)
private val lineBytes = p(CacheBlockBytes)
val zeros = mem map { case xbar =>
val zero = LazyModule(new TLZero(address, beatBytes = config.beatBytes))
zero.node := TLFragmenter(config.beatBytes, lineBytes)(xbar.node)
zero
}
}
trait PeripheryZeroBundle {
this: TopNetworkBundle {
val outer: PeripheryZero
} =>
}
trait PeripheryZeroModule {
this: TopNetworkModule {
val outer: PeripheryZero
val io: PeripheryZeroBundle
} =>
}
/////
// PeripheryMasterAXI4MMIO is an example, make your own cake pattern like this one.
trait PeripheryMasterAXI4MMIO {
this: TopNetwork =>