From 3db3f83a5ea4b9565db1ab6b22d18e2b33ecef98 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 7 Jan 2013 13:05:35 -0500 Subject: arch: Make the ISA class inherit from SimObject The ISA class on stores the contents of ID registers on many architectures. In order to make reset values of such registers configurable, we make the class inherit from SimObject, which allows us to use the normal generated parameter headers. This patch introduces a Python helper method, BaseCPU.createThreads(), which creates a set of ISAs for each of the threads in an SMT system. Although it is currently only needed when creating multi-threaded CPUs, it should always be called before instantiating the system as this is an obvious place to configure ID registers identifying a thread/CPU. --- src/cpu/o3/thread_context_impl.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/cpu/o3/thread_context_impl.hh') diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 38e7c5dec..9d60a9700 100755 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -219,14 +219,14 @@ template void O3ThreadContext::clearArchRegs() { - cpu->isa[thread->threadId()].clear(); + cpu->isa[thread->threadId()]->clear(); } template uint64_t O3ThreadContext::readIntReg(int reg_idx) { - reg_idx = cpu->isa[thread->threadId()].flattenIntIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenIntIndex(reg_idx); return cpu->readArchIntReg(reg_idx, thread->threadId()); } @@ -234,7 +234,7 @@ template TheISA::FloatReg O3ThreadContext::readFloatReg(int reg_idx) { - reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenFloatIndex(reg_idx); return cpu->readArchFloatReg(reg_idx, thread->threadId()); } @@ -242,7 +242,7 @@ template TheISA::FloatRegBits O3ThreadContext::readFloatRegBits(int reg_idx) { - reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenFloatIndex(reg_idx); return cpu->readArchFloatRegInt(reg_idx, thread->threadId()); } @@ -250,7 +250,7 @@ template void O3ThreadContext::setIntReg(int reg_idx, uint64_t val) { - reg_idx = cpu->isa[thread->threadId()].flattenIntIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenIntIndex(reg_idx); cpu->setArchIntReg(reg_idx, val, thread->threadId()); conditionalSquash(); @@ -260,7 +260,7 @@ template void O3ThreadContext::setFloatReg(int reg_idx, FloatReg val) { - reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenFloatIndex(reg_idx); cpu->setArchFloatReg(reg_idx, val, thread->threadId()); conditionalSquash(); @@ -270,7 +270,7 @@ template void O3ThreadContext::setFloatRegBits(int reg_idx, FloatRegBits val) { - reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); + reg_idx = cpu->isa[thread->threadId()]->flattenFloatIndex(reg_idx); cpu->setArchFloatRegInt(reg_idx, val, thread->threadId()); conditionalSquash(); @@ -298,14 +298,14 @@ template int O3ThreadContext::flattenIntIndex(int reg) { - return cpu->isa[thread->threadId()].flattenIntIndex(reg); + return cpu->isa[thread->threadId()]->flattenIntIndex(reg); } template int O3ThreadContext::flattenFloatIndex(int reg) { - return cpu->isa[thread->threadId()].flattenFloatIndex(reg); + return cpu->isa[thread->threadId()]->flattenFloatIndex(reg); } template -- cgit v1.2.3