summaryrefslogtreecommitdiff
path: root/src/cpu/simple_thread.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-11-17 21:55:28 -0500
committerRon Dreslinski <rdreslin@umich.edu>2006-11-17 21:55:28 -0500
commitcd0b65508e3f9d9f72cd834aeccf9fd1f0349351 (patch)
treee92d97d22335627754de60a808183e2d00ea3c9c /src/cpu/simple_thread.cc
parentdbdf2f14ae6b586efd31b73aa4548a38ecee263f (diff)
downloadgem5-cd0b65508e3f9d9f72cd834aeccf9fd1f0349351.tar.xz
Make an initialization pass for the thread context and set the [phys,virt]Port correctly
src/cpu/simple/atomic.cc: src/cpu/simple/timing.cc: Call the thread context initialization --HG-- extra : convert_revision : d7dc2a8b893dc670077b7f6150d4b710a1778620
Diffstat (limited to 'src/cpu/simple_thread.cc')
-rw-r--r--src/cpu/simple_thread.cc31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 1edcbf352..e07d6e7c1 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -91,18 +91,6 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
} else {
kernelStats = NULL;
}
- Port *mem_port;
- physPort = new FunctionalPort(csprintf("%s-%d-funcport",
- cpu->name(), tid));
- mem_port = system->physmem->getPort("functional");
- mem_port->setPeer(physPort);
- physPort->setPeer(mem_port);
-
- virtPort = new VirtualPort(csprintf("%s-%d-vport",
- cpu->name(), tid));
- mem_port = system->physmem->getPort("functional");
- mem_port->setPeer(virtPort);
- virtPort->setPeer(mem_port);
}
#else
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
@@ -116,6 +104,25 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
#endif
+#if FULL_SYSTEM
+void
+SimpleThread::init()
+{
+ Port *mem_port;
+ physPort = new FunctionalPort(csprintf("%s-%d-funcport",
+ cpu->name(), tid));
+ mem_port = getMemFuncPort();
+ mem_port->setPeer(physPort);
+ physPort->setPeer(mem_port);
+
+ virtPort = new VirtualPort(csprintf("%s-%d-vport",
+ cpu->name(), tid));
+ mem_port = getMemFuncPort();
+ mem_port->setPeer(virtPort);
+ virtPort->setPeer(mem_port);
+}
+#endif
+
SimpleThread::SimpleThread()
#if FULL_SYSTEM
: ThreadState(NULL, -1, -1)