/*
- * Copyright (c) 2012-2013, 2015 ARM Limited
+ * Copyright (c) 2012-2013, 2015, 2018 ARM Limited
* Copyright (c) 2016 Google Inc.
+ * Copyright (c) 2017, Centre National de la Recherche Scientifique
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
* Authors: Thomas Grass
* Andreas Hansson
* Rahul Thakur
+ * Pierre-Yves Peneau
*/
#include "mem/comm_monitor.hh"
: MemObject(params),
masterPort(name() + "-master", *this),
slavePort(name() + "-slave", *this),
- samplePeriodicEvent(this),
+ samplePeriodicEvent([this]{ samplePeriodic(); }, name()),
samplePeriodTicks(params->sample_period),
samplePeriod(params->sample_period / SimClock::Float::s),
stats(params)
ppPktResp.reset(new ProbePoints::Packet(getProbeManager(), "PktResponse"));
}
-BaseMasterPort&
-CommMonitor::getMasterPort(const std::string& if_name, PortID idx)
+Port &
+CommMonitor::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "master") {
return masterPort;
- } else {
- return MemObject::getMasterPort(if_name, idx);
- }
-}
-
-BaseSlavePort&
-CommMonitor::getSlavePort(const std::string& if_name, PortID idx)
-{
- if (if_name == "slave") {
+ } else if (if_name == "slave") {
return slavePort;
} else {
- return MemObject::getSlavePort(if_name, idx);
+ return MemObject::getPort(if_name, idx);
}
}
// or even deleted when sendTiming() is called.
const ProbePoints::PacketInfo pkt_info(pkt);
- const bool is_read = pkt->isRead();
- const bool is_write = pkt->isWrite();
const bool expects_response(pkt->needsResponse() &&
!pkt->cacheResponding());
}
if (successful) {
- DPRINTF(CommMonitor, "Forwarded %s request\n",
- (is_read ? "read" : (is_write ? "write" : "non read/write")));
+ DPRINTF(CommMonitor, "Forwarded %s request\n", pkt->isRead() ? "read" :
+ pkt->isWrite() ? "write" : "non read/write");
stats.updateReqStats(pkt_info, false, expects_response);
}
return successful;
// or even deleted when sendTiming() is called.
const ProbePoints::PacketInfo pkt_info(pkt);
- bool is_read = pkt->isRead();
- bool is_write = pkt->isWrite();
Tick latency = 0;
CommMonitorSenderState* received_state =
dynamic_cast<CommMonitorSenderState*>(pkt->senderState);
if (successful) {
ppPktResp->notify(pkt_info);
- DPRINTF(CommMonitor, "Received %s response\n",
- (is_read ? "Read" : (is_write ? "Write" : "non read/write")));
+ DPRINTF(CommMonitor, "Received %s response\n", pkt->isRead() ? "read" :
+ pkt->isWrite() ? "write" : "non read/write");
stats.updateRespStats(pkt_info, latency, false);
}
return successful;
masterPort.sendRetryResp();
}
+bool
+CommMonitor::tryTiming(PacketPtr pkt)
+{
+ return masterPort.tryTiming(pkt);
+}
+
void
CommMonitor::recvRangeChange()
{
stats.writeTransHist
.init(params()->transaction_bins)
.name(name() + ".writeTransHist")
- .desc("Histogram of read transactions per sample period")
+ .desc("Histogram of write transactions per sample period")
.flags(stats.disableTransactionHists ? nozero : pdf);
stats.readAddrDist