mem: update flag description and the if-block style
Change-Id: Iac727d38b88f1818aeeccf0d8de639fe18759074
This commit is contained in:
@@ -77,4 +77,11 @@ class AbstractMemory(ClockedObject):
|
||||
|
||||
writeable = Param.Bool(True, "Allow writes to this memory")
|
||||
|
||||
collect_stats = Param.Bool(True, "Collect traffic statistics")
|
||||
collect_stats = Param.Bool(
|
||||
True,
|
||||
"Collect statistics per requestor for "
|
||||
"each type of access. Set this to `False` if "
|
||||
"requestors may be unknown or when running "
|
||||
"with multiple `System` objects without a "
|
||||
"`SysBridge`.",
|
||||
)
|
||||
|
||||
@@ -433,8 +433,9 @@ AbstractMemory::access(PacketPtr pkt)
|
||||
|
||||
assert(!pkt->req->isInstFetch());
|
||||
TRACE_PACKET("Read/Write");
|
||||
if (collectStats)
|
||||
if (collectStats) {
|
||||
stats.numOther[pkt->req->requestorId()]++;
|
||||
}
|
||||
}
|
||||
} else if (pkt->isRead()) {
|
||||
assert(!pkt->isWrite());
|
||||
@@ -451,8 +452,9 @@ AbstractMemory::access(PacketPtr pkt)
|
||||
if (collectStats) {
|
||||
stats.numReads[pkt->req->requestorId()]++;
|
||||
stats.bytesRead[pkt->req->requestorId()] += pkt->getSize();
|
||||
if (pkt->req->isInstFetch())
|
||||
if (pkt->req->isInstFetch()) {
|
||||
stats.bytesInstRead[pkt->req->requestorId()] += pkt->getSize();
|
||||
}
|
||||
}
|
||||
} else if (pkt->isInvalidate() || pkt->isClean()) {
|
||||
assert(!pkt->isWrite());
|
||||
|
||||
Reference in New Issue
Block a user