summaryrefslogtreecommitdiff
path: root/mem/physical.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-03-12 17:21:59 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2006-03-12 17:21:59 -0500
commite2b329d574483096da64d4050a9a0b228757a72e (patch)
tree1eaa5625be7cc5132c91a948771479141878a564 /mem/physical.cc
parent2d9c9dba37499d87ee599388aca5502279ce953a (diff)
downloadgem5-e2b329d574483096da64d4050a9a0b228757a72e.tar.xz
Replace Memory with MemObject; no need for two different levels of hierarchy there.
Get rid of addPort(). Change getPort() behavior on PhysicalMemory. SConscript: cpu/simple/cpu.hh: sim/system.cc: sim/system.hh: Replace Memory with MemObject. cpu/base.hh: No need to declare Port here anymore. cpu/cpu_exec_context.hh: Need PageTable definition. cpu/simple/cpu.cc: mem/physical.cc: mem/physical.hh: Replace Memory with MemObject. Get rid of addPort(); allow getting anonymous ports with getPort(). mem/translating_port.hh: Remove unneeded header. sim/process.cc: Replace Memory with MemObject. Change how initialization port gets set up to deal with change in addPort()/getPort(). Current solution is not ideal but it works. sim/process.hh: Remove unneeded headers and declarations. Make LiveProcess::getDesc() abstract instead of panicing if called. sim/syscall_emul.hh: Fix includes. --HG-- extra : convert_revision : 11d4ffb54230038afcf7219cc46e51f809329a2f
Diffstat (limited to 'mem/physical.cc')
-rw-r--r--mem/physical.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/mem/physical.cc b/mem/physical.cc
index a00c59139..c1e83fb9e 100644
--- a/mem/physical.cc
+++ b/mem/physical.cc
@@ -70,7 +70,7 @@ PhysicalMemory::MemResponseEvent::description()
}
PhysicalMemory::PhysicalMemory(const string &n)
- : Memory(n), base_addr(0), pmem_addr(NULL)
+ : MemObject(n), base_addr(0), pmem_addr(NULL)
{
// Hardcoded to 128 MB for now.
pmem_size = 1 << 27;
@@ -107,13 +107,6 @@ PhysicalMemory::new_page()
return return_addr;
}
-Port *
-PhysicalMemory::addPort(std::string portName)
-{
- memoryPortList[portName] = new MemoryPort(this);
- return memoryPortList[portName];
-}
-
int
PhysicalMemory::deviceBlockSize()
{
@@ -161,10 +154,11 @@ PhysicalMemory::doFunctionalAccess(Packet &pkt)
Port *
PhysicalMemory::getPort(const char *if_name)
{
- if (memoryPortList.find(if_name) != memoryPortList.end())
- return memoryPortList[if_name];
- else
- panic("Looking for a port that didn't exist\n");
+ if (if_name == NULL) {
+ return new MemoryPort(this);
+ } else {
+ panic("PhysicalMemory::getPort: unknown port %s requested", if_name);
+ }
}
void