1
0

tilelink2 Broadcast: only support caching readable devices

This commit is contained in:
Wesley W. Terpstra 2016-11-04 11:20:37 -07:00 committed by Henry Cook
parent d03046d11c
commit 14800f8fb4

View File

@ -26,14 +26,14 @@ class TLBroadcast(lineBytes: Int, numTrackers: Int = 4) extends LazyModule
require (m.regionType != RegionType.TRACKED) require (m.regionType != RegionType.TRACKED)
require (!m.supportsAcquire) require (!m.supportsAcquire)
// We only manage addresses which are uncached // We only manage addresses which are uncached
if (m.regionType == RegionType.UNCACHED) { if (m.regionType == RegionType.UNCACHED && m.supportsGet) {
// The device had better support line transfers // The device had better support line transfers
val lowerBound = max(m.supportsPutFull.min, m.supportsGet.min)
require (!m.supportsPutFull || m.supportsPutFull.contains(lineBytes)) require (!m.supportsPutFull || m.supportsPutFull.contains(lineBytes))
require (!m.supportsPutPartial || m.supportsPutPartial.contains(lineBytes))
require (!m.supportsGet || m.supportsGet .contains(lineBytes)) require (!m.supportsGet || m.supportsGet .contains(lineBytes))
m.copy( m.copy(
regionType = RegionType.TRACKED, regionType = RegionType.TRACKED,
supportsAcquire = TransferSizes(1, lineBytes), supportsAcquire = TransferSizes(lowerBound, lineBytes),
// truncate supported accesses to lineBytes (we only ever probe for one line) // truncate supported accesses to lineBytes (we only ever probe for one line)
supportsPutFull = TransferSizes(m.supportsPutFull .min, min(m.supportsPutFull .max, lineBytes)), supportsPutFull = TransferSizes(m.supportsPutFull .min, min(m.supportsPutFull .max, lineBytes)),
supportsPutPartial = TransferSizes(m.supportsPutPartial.min, min(m.supportsPutPartial.max, lineBytes)), supportsPutPartial = TransferSizes(m.supportsPutPartial.min, min(m.supportsPutPartial.max, lineBytes)),