1
0

simplify TileLinkParameters with Option

This commit is contained in:
Henry Cook 2015-10-16 18:24:02 -07:00
parent 49667aa4b0
commit e1f573918d
2 changed files with 7 additions and 5 deletions

View File

@ -32,8 +32,8 @@ class L2BroadcastHub(implicit p: Parameters) extends ManagerCoherenceAgent()(p)
val inStoreQueue :: inVolWBQueue :: inClientReleaseQueue :: Nil = Enum(UInt(), nDataQueueLocations)
val usingStoreDataQueue = p.alterPartial({
case TLKey(`innerTLId`) => innerTLParams.copy()(internalDataBits, innerWriteMaskBits)
case TLKey(`outerTLId`) => outerTLParams.copy()(internalDataBits, outerWriteMaskBits)
case TLKey(`innerTLId`) => innerTLParams.copy(overrideDataBitsPerBeat = Some(internalDataBits))
case TLKey(`outerTLId`) => outerTLParams.copy(overrideDataBitsPerBeat = Some(internalDataBits))
})
// Create SHRs for outstanding transactions

View File

@ -33,10 +33,12 @@ case class TileLinkParameters(
maxManagerXacts: Int,
addrBits: Int,
dataBits: Int,
dataBeats: Int = 4)
(val dataBitsPerBeat: Int = dataBits / dataBeats,
val writeMaskBits: Int = ((dataBits / dataBeats) - 1) / 8 + 1) {
dataBeats: Int = 4,
overrideDataBitsPerBeat: Option[Int] = None
) {
val nClients = nCachingClients + nCachelessClients
val writeMaskBits: Int = ((dataBits / dataBeats) - 1) / 8 + 1
val dataBitsPerBeat: Int = overrideDataBitsPerBeat.getOrElse(dataBits / dataBeats)
}