summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2007-07-26 17:04:12 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2007-07-26 17:04:12 -0700
commit58250b8e5fd8aba9ed99b7aff6ce67b05b379fa0 (patch)
treeff47f12a46a739f09602c24f25c3bb2719b66f2c /src/mem
parentc1097d06f7b27f4dd6ecaa47d1685e015725b5f5 (diff)
downloadgem5-58250b8e5fd8aba9ed99b7aff6ce67b05b379fa0.tar.xz
bus: Fix default port handling.
--HG-- extra : convert_revision : 121b6e31cddff17c51fc4f3df20e7e2bde87d04f
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/bus.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 8243d40f1..1fad13c5a 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -197,7 +197,8 @@ Bus::recvTiming(PacketPtr pkt)
if (dest == Packet::Broadcast) {
dest_port_id = findPort(pkt->getAddr());
- dest_port = interfaces[dest_port_id];
+ dest_port = (dest_port_id == defaultId) ?
+ defaultPort : interfaces[dest_port_id];
for (SnoopIter s_iter = snoopPorts.begin();
s_iter != snoopPorts.end();
s_iter++) {
@@ -217,7 +218,8 @@ Bus::recvTiming(PacketPtr pkt)
assert(dest >= 0 && dest < maxId);
assert(dest != src); // catch infinite loops
dest_port_id = dest;
- dest_port = interfaces[dest_port_id];
+ dest_port = (dest_port_id == defaultId) ?
+ defaultPort : interfaces[dest_port_id];
}
if (dest_port_id == src) {
@@ -336,7 +338,8 @@ Bus::recvAtomic(PacketPtr pkt)
int orig_src = pkt->getSrc();
int target_port_id = findPort(pkt->getAddr());
- Port *target_port = interfaces[target_port_id];
+ Port *target_port = (target_port_id == defaultId) ?
+ defaultPort : interfaces[target_port_id];
SnoopIter s_end = snoopPorts.end();
for (SnoopIter s_iter = snoopPorts.begin(); s_iter != s_end; s_iter++) {
@@ -394,7 +397,7 @@ Bus::recvFunctional(PacketPtr pkt)
assert(pkt->getDest() == Packet::Broadcast);
int port_id = findPort(pkt->getAddr());
- Port *port = interfaces[port_id];
+ Port *port = (port_id == defaultId) ? defaultPort : interfaces[port_id];
// The packet may be changed by another bus on snoops, restore the
// id after each
int src_id = pkt->getSrc();