summaryrefslogtreecommitdiff
path: root/src/mem/mport.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-02-24 11:50:15 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2012-02-24 11:50:15 -0500
commit77878d0a87ee18709ca4d6459b8ae436cc101fa7 (patch)
tree2db1f5113fadae1d49d6ef5048f1706c1d31307c /src/mem/mport.cc
parent86c2aad482df4bf56977bf1a098d2dd01c641bfd (diff)
downloadgem5-77878d0a87ee18709ca4d6459b8ae436cc101fa7.tar.xz
MEM: Prepare mport for master/slave split
This patch simplifies the mport in preparation for a split into a master and slave role for the message ports. In particular, sendMessageAtomic was only used in a single location and similarly so sendMessageTiming. The affected interrupt device is updated accordingly.
Diffstat (limited to 'src/mem/mport.cc')
-rw-r--r--src/mem/mport.cc38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/mem/mport.cc b/src/mem/mport.cc
index 80393c81e..2c57030b1 100644
--- a/src/mem/mport.cc
+++ b/src/mem/mport.cc
@@ -1,4 +1,16 @@
/*
+ * Copyright (c) 2012 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2008 The Regents of The University of Michigan
* All rights reserved.
*
@@ -34,30 +46,14 @@ Tick
MessagePort::recvAtomic(PacketPtr pkt)
{
if (pkt->cmd == MemCmd::MessageReq) {
- // We received a message.
return recvMessage(pkt);
} else if (pkt->cmd == MemCmd::MessageResp) {
+ // normally we would never see responses in recvAtomic, but
+ // since the timing port uses recvAtomic to implement
+ // recvTiming we have to deal with both cases
return recvResponse(pkt);
- } else if (pkt->wasNacked()) {
- return recvNack(pkt);
- } else if (pkt->isError()) {
- panic("Packet is error.\n");
} else {
- panic("Unexpected memory command %s.\n", pkt->cmd.toString());
+ panic("%s received unexpected atomic command %s from %s.\n",
+ name(), pkt->cmd.toString(), getPeer()->name());
}
}
-
-void
-MessagePort::sendMessageTiming(PacketPtr pkt, Tick latency)
-{
- schedSendTiming(pkt, curTick() + latency);
-}
-
-Tick
-MessagePort::sendMessageAtomic(PacketPtr pkt)
-{
- Tick latency = sendAtomic(pkt);
- assert(pkt->isResponse());
- latency += recvResponse(pkt);
- return latency;
-}