summaryrefslogtreecommitdiff
path: root/src/mem/bus.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-04-04 20:50:49 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-04-04 20:50:49 +0000
commita664017c2a839279f8b8eea1076bba47d1863b88 (patch)
treeac302402f02133b6fda91ced93da52aaa8a8a3e8 /src/mem/bus.cc
parent10fe8b05dbf38acff65d95a696cad95a45bf2e16 (diff)
parent3d2a434e42b10ef30bbb590722e72ed104be669a (diff)
downloadgem5-a664017c2a839279f8b8eea1076bba47d1863b88.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem-o3-spec --HG-- extra : convert_revision : 81269f094834f43b4e908321bfce2e031b39d2a4
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r--src/mem/bus.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 6e6ba2380..b0636ecc2 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -52,9 +52,19 @@ Bus::getPort(const std::string &if_name, int idx)
} else
fatal("Default port already set\n");
}
+ int id;
+ if (if_name == "functional") {
+ if (!funcPort) {
+ id = maxId++;
+ funcPort = new BusPort(csprintf("%s-p%d-func", name(), id), this, id);
+ funcPortId = id;
+ interfaces[id] = funcPort;
+ }
+ return funcPort;
+ }
// if_name ignored? forced to be empty?
- int id = maxId++;
+ id = maxId++;
assert(maxId < std::numeric_limits<typeof(maxId)>::max());
BusPort *bp = new BusPort(csprintf("%s-p%d", name(), id), this, id);
interfaces[id] = bp;
@@ -64,10 +74,15 @@ Bus::getPort(const std::string &if_name, int idx)
void
Bus::deletePortRefs(Port *p)
{
+
BusPort *bp = dynamic_cast<BusPort*>(p);
if (bp == NULL)
panic("Couldn't convert Port* to BusPort*\n");
+ // If this is our one functional port
+ if (funcPort == bp)
+ return;
interfaces.erase(bp->getId());
+ delete bp;
}
/** Get the ranges of anyone other buses that we are connected to. */
@@ -520,7 +535,7 @@ Bus::recvStatusChange(Port::Status status, int id)
m5::hash_map<short,BusPort*>::iterator intIter;
for (intIter = interfaces.begin(); intIter != interfaces.end(); intIter++)
- if (intIter->first != id)
+ if (intIter->first != id && intIter->first != funcPortId)
intIter->second->sendStatusChange(Port::RangeChange);
if (id != defaultId && defaultPort)