mem: update flag description and the if-block style

Change-Id: Iac727d38b88f1818aeeccf0d8de639fe18759074
This commit is contained in:
Yu-hsin Wang
2023-12-07 10:21:28 +08:00
parent e2b3f0b8e4
commit 5de50cc9dd
2 changed files with 12 additions and 3 deletions

View File

@@ -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`.",
)

View File

@@ -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());