From a2113fd3dc85798c7dcc1d67691ffd29a86ef5a0 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Sun, 19 Nov 2006 17:43:03 -0500 Subject: Update Virtual and Physical ports. src/cpu/o3/alpha/cpu_impl.hh: Handle the PhysicalPort and VirtualPort in the ThreadState. src/cpu/o3/cpu.cc: Initialize the thread context. src/cpu/o3/thread_context.hh: Add new function to initialize thread context. src/cpu/o3/thread_context_impl.hh: Use code now put into function. src/cpu/simple_thread.cc: Move code to ThreadState and use the new helper function. src/cpu/simple_thread.hh: Remove init() in this derived class; use init() from ThreadState base class. src/cpu/thread_state.cc: Move setting up of Physical and Virtual ports here. Change getMemFuncPort() to connectToMemFunc(), which connects a port to a functional port of the memory object below the CPU. src/cpu/thread_state.hh: Update functions. --HG-- extra : convert_revision : ff254715ef0b259dc80d08f13543b63e4024ca8d --- src/cpu/o3/alpha/cpu_impl.hh | 18 ------------------ src/cpu/o3/cpu.cc | 2 ++ src/cpu/o3/thread_context.hh | 2 ++ src/cpu/o3/thread_context_impl.hh | 5 +---- 4 files changed, 5 insertions(+), 22 deletions(-) (limited to 'src/cpu/o3') diff --git a/src/cpu/o3/alpha/cpu_impl.hh b/src/cpu/o3/alpha/cpu_impl.hh index b2ef78360..98fd0699a 100644 --- a/src/cpu/o3/alpha/cpu_impl.hh +++ b/src/cpu/o3/alpha/cpu_impl.hh @@ -116,24 +116,6 @@ AlphaO3CPU::AlphaO3CPU(Params *params) #if FULL_SYSTEM // Setup quiesce event. this->thread[i]->quiesceEvent = new EndQuiesceEvent(tc); - - Port *mem_port; - FunctionalPort *phys_port; - VirtualPort *virt_port; - phys_port = new FunctionalPort(csprintf("%s-%d-funcport", - name(), i)); - mem_port = this->system->physmem->getPort("functional"); - mem_port->setPeer(phys_port); - phys_port->setPeer(mem_port); - - virt_port = new VirtualPort(csprintf("%s-%d-vport", - name(), i)); - mem_port = this->system->physmem->getPort("functional"); - mem_port->setPeer(virt_port); - virt_port->setPeer(mem_port); - - this->thread[i]->setPhysPort(phys_port); - this->thread[i]->setVirtPort(virt_port); #endif // Give the thread the TC. this->thread[i]->tc = tc; diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 580816372..3dc353a9f 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -497,6 +497,8 @@ FullO3CPU::init() } #if FULL_SYSTEM + src_tc->init(); + TheISA::initCPU(src_tc, src_tc->readCpuId()); #endif } diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index daee2fc7d..031f36480 100755 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -91,6 +91,8 @@ class O3ThreadContext : public ThreadContext virtual VirtualPort *getVirtPort(ThreadContext *src_tc = NULL); void delVirtPort(VirtualPort *vp); + + virtual void init() { thread->init(); } #else virtual TranslatingPort *getMemPort() { return thread->getMemPort(); } diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 8d623f5b8..0180756e3 100755 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -41,12 +41,9 @@ O3ThreadContext::getVirtPort(ThreadContext *src_tc) return thread->getVirtPort(); VirtualPort *vp; - Port *mem_port; vp = new VirtualPort("tc-vport", src_tc); - mem_port = cpu->system->physmem->getPort("functional"); - mem_port->setPeer(vp); - vp->setPeer(mem_port); + thread->connectToMemFunc(vp); return vp; } -- cgit v1.2.3