thread_context.hh revision 8733
12330SN/A/* 213610Sgiacomo.gabrielli@arm.com * Copyright (c) 2011 ARM Limited 39920Syasuko.eckert@amd.com * All rights reserved 48733Sgeoffrey.blake@arm.com * 58733Sgeoffrey.blake@arm.com * The license below extends only to copyright in the software and shall 68733Sgeoffrey.blake@arm.com * not be construed as granting a license to any other intellectual 78733Sgeoffrey.blake@arm.com * property including but not limited to intellectual property relating 88733Sgeoffrey.blake@arm.com * to a hardware implementation of the functionality of the software 98733Sgeoffrey.blake@arm.com * licensed hereunder. You may use the software subject to the license 108733Sgeoffrey.blake@arm.com * terms below provided that you ensure that this notice is replicated 118733Sgeoffrey.blake@arm.com * unmodified and in its entirety in all distributions of the software, 128733Sgeoffrey.blake@arm.com * modified or unmodified, in source code or in binary form. 138733Sgeoffrey.blake@arm.com * 148733Sgeoffrey.blake@arm.com * Copyright (c) 2006 The Regents of The University of Michigan 152330SN/A * All rights reserved. 162330SN/A * 172330SN/A * Redistribution and use in source and binary forms, with or without 182330SN/A * modification, are permitted provided that the following conditions are 192330SN/A * met: redistributions of source code must retain the above copyright 202330SN/A * notice, this list of conditions and the following disclaimer; 212330SN/A * redistributions in binary form must reproduce the above copyright 222330SN/A * notice, this list of conditions and the following disclaimer in the 232330SN/A * documentation and/or other materials provided with the distribution; 242330SN/A * neither the name of the copyright holders nor the names of its 252330SN/A * contributors may be used to endorse or promote products derived from 262330SN/A * this software without specific prior written permission. 272330SN/A * 282330SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292330SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 302330SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 312330SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 322330SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 332330SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 342330SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 352330SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 362330SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 372330SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 382330SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 392330SN/A * 402689Sktlim@umich.edu * Authors: Kevin Lim 412689Sktlim@umich.edu */ 422330SN/A 432330SN/A#ifndef __CPU_THREAD_CONTEXT_HH__ 442683Sktlim@umich.edu#define __CPU_THREAD_CONTEXT_HH__ 452683Sktlim@umich.edu 462315SN/A#include <iostream> 472972Sgblack@eecs.umich.edu#include <string> 486658Snate@binkert.org 492315SN/A#include "arch/registers.hh" 502683Sktlim@umich.edu#include "arch/types.hh" 512680SN/A#include "base/types.hh" 528733Sgeoffrey.blake@arm.com#include "config/full_system.hh" 532315SN/A#include "config/the_isa.hh" 542315SN/A#include "config/use_checker.hh" 5513905Sgabeblack@google.com 5613905Sgabeblack@google.com// @todo: Figure out a more architecture independent way to obtain the ITB and 5713905Sgabeblack@google.com// DTB pointers. 583548Sgblack@eecs.umich.edunamespace TheISA 599020Sgblack@eecs.umich.edu{ 602330SN/A class TLB; 612315SN/A} 622350SN/Aclass BaseCPU; 632680SN/Aclass Checkpoint; 642680SN/Aclass Decoder; 652683Sktlim@umich.educlass EndQuiesceEvent; 662683Sktlim@umich.educlass SETranslatingPortProxy; 672683Sktlim@umich.educlass FSTranslatingPortProxy; 682683Sktlim@umich.educlass PortProxy; 692350SN/Aclass Process; 702680SN/Aclass System; 712680SN/Anamespace TheISA { 722315SN/A namespace Kernel { 732315SN/A class Statistics; 742680SN/A }; 752683Sktlim@umich.edu}; 762683Sktlim@umich.edu 772330SN/A/** 782315SN/A * ThreadContext is the external interface to all thread state for 792315SN/A * anything outside of the CPU. It provides all accessor methods to 802315SN/A * state that might be needed by external objects, ranging from 812683Sktlim@umich.edu * register values to things such as kernel stats. It is an abstract 822683Sktlim@umich.edu * base class; the CPU can create its own ThreadContext by either 832680SN/A * deriving from it, or using the templated ProxyThreadContext. 842683Sktlim@umich.edu * 852683Sktlim@umich.edu * The ThreadContext is slightly different than the ExecContext. The 862683Sktlim@umich.edu * ThreadContext provides access to an individual thread's state; an 872683Sktlim@umich.edu * ExecContext provides ISA access to the CPU (meaning it is 882683Sktlim@umich.edu * implicitly multithreaded on SMT systems). Additionally the 892315SN/A * ThreadState is an abstract class that exactly defines the 902315SN/A * interface; the ExecContext is a more implicit interface that must 912315SN/A * be implemented so that the ISA can access whatever state it needs. 922315SN/A */ 9313628SAndrea.Mondelli@ucf.educlass ThreadContext 942315SN/A{ 9513628SAndrea.Mondelli@ucf.edu protected: 9610190Sakash.bagdia@arm.com typedef TheISA::MachInst MachInst; 9713628SAndrea.Mondelli@ucf.edu typedef TheISA::IntReg IntReg; 988733Sgeoffrey.blake@arm.com typedef TheISA::FloatReg FloatReg; 9913628SAndrea.Mondelli@ucf.edu typedef TheISA::FloatRegBits FloatRegBits; 1008733Sgeoffrey.blake@arm.com typedef TheISA::MiscReg MiscReg; 10113865Sgabeblack@google.com public: 10213865Sgabeblack@google.com 1032315SN/A enum Status 1048733Sgeoffrey.blake@arm.com { 1058733Sgeoffrey.blake@arm.com /// Running. Instructions should be executed only when 1062315SN/A /// the context is in this state. 1072315SN/A Active, 1088733Sgeoffrey.blake@arm.com 10913628SAndrea.Mondelli@ucf.edu /// Temporarily inactive. Entered while waiting for 11013865Sgabeblack@google.com /// synchronization, etc. 11113865Sgabeblack@google.com Suspended, 1128733Sgeoffrey.blake@arm.com 1138733Sgeoffrey.blake@arm.com /// Permanently shut down. Entered when target executes 1148733Sgeoffrey.blake@arm.com /// m5exit pseudo-instruction. When all contexts enter 1158733Sgeoffrey.blake@arm.com /// this state, the simulation will terminate. 1162315SN/A Halted 11713628SAndrea.Mondelli@ucf.edu }; 1184997Sgblack@eecs.umich.edu 11913628SAndrea.Mondelli@ucf.edu virtual ~ThreadContext() { }; 1204997Sgblack@eecs.umich.edu 12113865Sgabeblack@google.com virtual BaseCPU *getCpuPtr() = 0; 12213865Sgabeblack@google.com 1238887Sgeoffrey.blake@arm.com virtual int cpuId() = 0; 1248887Sgeoffrey.blake@arm.com 1258887Sgeoffrey.blake@arm.com virtual int threadId() = 0; 1268733Sgeoffrey.blake@arm.com 12713693Sgiacomo.gabrielli@arm.com virtual void setThreadId(int id) = 0; 12813693Sgiacomo.gabrielli@arm.com 12913865Sgabeblack@google.com virtual int contextId() = 0; 13013865Sgabeblack@google.com 13113865Sgabeblack@google.com virtual void setContextId(int id) = 0; 13213628SAndrea.Mondelli@ucf.edu 13313628SAndrea.Mondelli@ucf.edu virtual TheISA::TLB *getITBPtr() = 0; 1348733Sgeoffrey.blake@arm.com 13513628SAndrea.Mondelli@ucf.edu virtual TheISA::TLB *getDTBPtr() = 0; 1362315SN/A 13713905Sgabeblack@google.com#if USE_CHECKER 13813865Sgabeblack@google.com virtual BaseCPU *getCheckerCpuPtr() = 0; 13913865Sgabeblack@google.com#endif 14013865Sgabeblack@google.com 14113865Sgabeblack@google.com virtual Decoder *getDecoderPtr() = 0; 1422690Sktlim@umich.edu 14313628SAndrea.Mondelli@ucf.edu virtual System *getSystemPtr() = 0; 1447679Sgblack@eecs.umich.edu 14513628SAndrea.Mondelli@ucf.edu#if FULL_SYSTEM 14611886Sbrandon.potter@amd.com virtual TheISA::Kernel::Statistics *getKernelStats() = 0; 14713628SAndrea.Mondelli@ucf.edu 1482690Sktlim@umich.edu virtual PortProxy* getPhysProxy() = 0; 14913865Sgabeblack@google.com 15013865Sgabeblack@google.com virtual FSTranslatingPortProxy* getVirtProxy() = 0; 15113865Sgabeblack@google.com 15213865Sgabeblack@google.com /** 15313865Sgabeblack@google.com * Initialise the physical and virtual port proxies and tie them to 1548733Sgeoffrey.blake@arm.com * the data port of the CPU. 15513865Sgabeblack@google.com * 15613865Sgabeblack@google.com * tc ThreadContext for the virtual-to-physical translation 15713865Sgabeblack@google.com */ 15813865Sgabeblack@google.com virtual void initMemProxies(ThreadContext *tc) = 0; 15913865Sgabeblack@google.com#else 1608733Sgeoffrey.blake@arm.com virtual SETranslatingPortProxy *getMemProxy() = 0; 16113865Sgabeblack@google.com 16213865Sgabeblack@google.com virtual Process *getProcessPtr() = 0; 1638733Sgeoffrey.blake@arm.com#endif 1648733Sgeoffrey.blake@arm.com 1658733Sgeoffrey.blake@arm.com virtual Status status() const = 0; 1668809Sgblack@eecs.umich.edu 16713865Sgabeblack@google.com virtual void setStatus(Status new_status) = 0; 16813865Sgabeblack@google.com 16913865Sgabeblack@google.com /// Set the status to Active. Optional delay indicates number of 17013628SAndrea.Mondelli@ucf.edu /// cycles to wait before beginning execution. 17113628SAndrea.Mondelli@ucf.edu virtual void activate(int delay = 1) = 0; 1722690Sktlim@umich.edu 1738733Sgeoffrey.blake@arm.com /// Set the status to Suspended. 17413865Sgabeblack@google.com virtual void suspend(int delay = 0) = 0; 17513865Sgabeblack@google.com 17613865Sgabeblack@google.com /// Set the status to Halted. 17713865Sgabeblack@google.com virtual void halt(int delay = 0) = 0; 17813865Sgabeblack@google.com 1792315SN/A#if FULL_SYSTEM 18013628SAndrea.Mondelli@ucf.edu virtual void dumpFuncProfile() = 0; 1812315SN/A#endif 18213865Sgabeblack@google.com 18313865Sgabeblack@google.com virtual void takeOverFrom(ThreadContext *old_context) = 0; 1842330SN/A 1852680SN/A virtual void regStats(const std::string &name) = 0; 1862680SN/A 1872330SN/A virtual void serialize(std::ostream &os) = 0; 1882315SN/A virtual void unserialize(Checkpoint *cp, const std::string §ion) = 0; 18910407Smitch.hayenga@arm.com 19013628SAndrea.Mondelli@ucf.edu#if FULL_SYSTEM 1912315SN/A virtual EndQuiesceEvent *getQuiesceEvent() = 0; 1922315SN/A 19313865Sgabeblack@google.com // Not necessarily the best location for these... 1942315SN/A // Having an extra function just to read these is obnoxious 1952315SN/A virtual Tick readLastActivate() = 0; 19613865Sgabeblack@google.com virtual Tick readLastSuspend() = 0; 1972315SN/A 19813865Sgabeblack@google.com virtual void profileClear() = 0; 1992315SN/A virtual void profileSample() = 0; 20013865Sgabeblack@google.com#endif 20113865Sgabeblack@google.com 2022315SN/A virtual void copyArchRegs(ThreadContext *tc) = 0; 2032680SN/A 2043225Sktlim@umich.edu virtual void clearArchRegs() = 0; 2052315SN/A 2062315SN/A // 20713865Sgabeblack@google.com // New accessors for new decoder. 20813865Sgabeblack@google.com // 2098733Sgeoffrey.blake@arm.com virtual uint64_t readIntReg(int reg_idx) = 0; 2108733Sgeoffrey.blake@arm.com 2118733Sgeoffrey.blake@arm.com virtual FloatReg readFloatReg(int reg_idx) = 0; 2128733Sgeoffrey.blake@arm.com 2132315SN/A virtual FloatRegBits readFloatRegBits(int reg_idx) = 0; 21413865Sgabeblack@google.com 21513865Sgabeblack@google.com virtual void setIntReg(int reg_idx, uint64_t val) = 0; 21613865Sgabeblack@google.com 21713628SAndrea.Mondelli@ucf.edu virtual void setFloatReg(int reg_idx, FloatReg val) = 0; 21813628SAndrea.Mondelli@ucf.edu 2192315SN/A virtual void setFloatRegBits(int reg_idx, FloatRegBits val) = 0; 22013865Sgabeblack@google.com 22113865Sgabeblack@google.com virtual TheISA::PCState pcState() = 0; 2222315SN/A 22313865Sgabeblack@google.com virtual void pcState(const TheISA::PCState &val) = 0; 22413865Sgabeblack@google.com 2252315SN/A#if USE_CHECKER 2262315SN/A virtual void pcStateNoRecord(const TheISA::PCState &val) = 0; 22713865Sgabeblack@google.com#endif 22813865Sgabeblack@google.com 2292315SN/A virtual Addr instAddr() = 0; 2302680SN/A 2312680SN/A virtual Addr nextInstAddr() = 0; 2322315SN/A 2332315SN/A virtual MicroPC microPC() = 0; 23413865Sgabeblack@google.com 23513865Sgabeblack@google.com virtual MiscReg readMiscRegNoEffect(int misc_reg) = 0; 2362315SN/A 2372680SN/A virtual MiscReg readMiscReg(int misc_reg) = 0; 2382680SN/A 2392315SN/A virtual void setMiscRegNoEffect(int misc_reg, const MiscReg &val) = 0; 2402315SN/A 2412315SN/A virtual void setMiscReg(int misc_reg, const MiscReg &val) = 0; 2422315SN/A 2432315SN/A virtual int flattenIntIndex(int reg) = 0; 24413865Sgabeblack@google.com virtual int flattenFloatIndex(int reg) = 0; 24513865Sgabeblack@google.com 24613865Sgabeblack@google.com virtual uint64_t 24713628SAndrea.Mondelli@ucf.edu readRegOtherThread(int misc_reg, ThreadID tid) 24813628SAndrea.Mondelli@ucf.edu { 2492315SN/A return 0; 25013557Sgabeblack@google.com } 25113865Sgabeblack@google.com 25213557Sgabeblack@google.com virtual void 25313611Sgabeblack@google.com setRegOtherThread(int misc_reg, const MiscReg &val, ThreadID tid) 25413557Sgabeblack@google.com { 2552315SN/A } 25613865Sgabeblack@google.com 25713865Sgabeblack@google.com // Also not necessarily the best location for these two. Hopefully will go 25813865Sgabeblack@google.com // away once we decide upon where st cond failures goes. 25913865Sgabeblack@google.com virtual unsigned readStCondFailures() = 0; 26013865Sgabeblack@google.com 26112109SRekai.GonzalezAlberquilla@arm.com virtual void setStCondFailures(unsigned sc_failures) = 0; 26212109SRekai.GonzalezAlberquilla@arm.com 26312109SRekai.GonzalezAlberquilla@arm.com // Only really makes sense for old CPU model. Still could be useful though. 26412109SRekai.GonzalezAlberquilla@arm.com virtual bool misspeculating() = 0; 26513865Sgabeblack@google.com 26613865Sgabeblack@google.com#if !FULL_SYSTEM 26713865Sgabeblack@google.com // Same with st cond failures. 26813865Sgabeblack@google.com virtual Counter readFuncExeInst() = 0; 26913865Sgabeblack@google.com 27012109SRekai.GonzalezAlberquilla@arm.com virtual void syscall(int64_t callnum) = 0; 27112109SRekai.GonzalezAlberquilla@arm.com 27212109SRekai.GonzalezAlberquilla@arm.com // This function exits the thread context in the CPU and returns 27312109SRekai.GonzalezAlberquilla@arm.com // 1 if the CPU has no more active threads (meaning it's OK to exit); 27412109SRekai.GonzalezAlberquilla@arm.com // Used in syscall-emulation mode when a thread calls the exit syscall. 27513865Sgabeblack@google.com virtual int exit() { return 1; }; 27613865Sgabeblack@google.com#endif 27713865Sgabeblack@google.com 27813865Sgabeblack@google.com /** function to compare two thread contexts (for debugging) */ 27912109SRekai.GonzalezAlberquilla@arm.com static void compare(ThreadContext *one, ThreadContext *two); 28012109SRekai.GonzalezAlberquilla@arm.com}; 28112109SRekai.GonzalezAlberquilla@arm.com 28213865Sgabeblack@google.com/** 28313865Sgabeblack@google.com * ProxyThreadContext class that provides a way to implement a 28413865Sgabeblack@google.com * ThreadContext without having to derive from it. ThreadContext is an 28513865Sgabeblack@google.com * abstract class, so anything that derives from it and uses its 28612109SRekai.GonzalezAlberquilla@arm.com * interface will pay the overhead of virtual function calls. This 28712109SRekai.GonzalezAlberquilla@arm.com * class is created to enable a user-defined Thread object to be used 28812109SRekai.GonzalezAlberquilla@arm.com * wherever ThreadContexts are used, without paying the overhead of 28913865Sgabeblack@google.com * virtual function calls when it is used by itself. See 29013865Sgabeblack@google.com * simple_thread.hh for an example of this. 29113865Sgabeblack@google.com */ 29213865Sgabeblack@google.comtemplate <class TC> 29312109SRekai.GonzalezAlberquilla@arm.comclass ProxyThreadContext : public ThreadContext 29412109SRekai.GonzalezAlberquilla@arm.com{ 29512109SRekai.GonzalezAlberquilla@arm.com public: 29613865Sgabeblack@google.com ProxyThreadContext(TC *actual_tc) 29713865Sgabeblack@google.com { actualTC = actual_tc; } 29813865Sgabeblack@google.com 29913865Sgabeblack@google.com private: 30012109SRekai.GonzalezAlberquilla@arm.com TC *actualTC; 30112109SRekai.GonzalezAlberquilla@arm.com 30213865Sgabeblack@google.com public: 30313865Sgabeblack@google.com 30413865Sgabeblack@google.com BaseCPU *getCpuPtr() { return actualTC->getCpuPtr(); } 30513865Sgabeblack@google.com 30613865Sgabeblack@google.com int cpuId() { return actualTC->cpuId(); } 30713865Sgabeblack@google.com 30813865Sgabeblack@google.com int threadId() { return actualTC->threadId(); } 30913865Sgabeblack@google.com 31013865Sgabeblack@google.com void setThreadId(int id) { return actualTC->setThreadId(id); } 31113865Sgabeblack@google.com 31213865Sgabeblack@google.com int contextId() { return actualTC->contextId(); } 31313865Sgabeblack@google.com 31413865Sgabeblack@google.com void setContextId(int id) { actualTC->setContextId(id); } 31513865Sgabeblack@google.com 31613865Sgabeblack@google.com TheISA::TLB *getITBPtr() { return actualTC->getITBPtr(); } 31713865Sgabeblack@google.com 31813865Sgabeblack@google.com TheISA::TLB *getDTBPtr() { return actualTC->getDTBPtr(); } 31913865Sgabeblack@google.com 32013865Sgabeblack@google.com#if USE_CHECKER 32113865Sgabeblack@google.com BaseCPU *getCheckerCpuPtr() { return actualTC->getCheckerCpuPtr(); } 32213865Sgabeblack@google.com#endif 32313865Sgabeblack@google.com 32413865Sgabeblack@google.com Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } 32513865Sgabeblack@google.com 32612109SRekai.GonzalezAlberquilla@arm.com System *getSystemPtr() { return actualTC->getSystemPtr(); } 32712109SRekai.GonzalezAlberquilla@arm.com 32813865Sgabeblack@google.com#if FULL_SYSTEM 32913865Sgabeblack@google.com TheISA::Kernel::Statistics *getKernelStats() 33013865Sgabeblack@google.com { return actualTC->getKernelStats(); } 33113865Sgabeblack@google.com 33213865Sgabeblack@google.com PortProxy* getPhysProxy() { return actualTC->getPhysProxy(); } 33312109SRekai.GonzalezAlberquilla@arm.com 33413865Sgabeblack@google.com FSTranslatingPortProxy* getVirtProxy() { return actualTC->getVirtProxy(); } 33513865Sgabeblack@google.com 33613865Sgabeblack@google.com void initMemProxies(ThreadContext *tc) { actualTC->initMemProxies(tc); } 33713865Sgabeblack@google.com#else 33813865Sgabeblack@google.com SETranslatingPortProxy* getMemProxy() { return actualTC->getMemProxy(); } 33913610Sgiacomo.gabrielli@arm.com 34013865Sgabeblack@google.com Process *getProcessPtr() { return actualTC->getProcessPtr(); } 34113865Sgabeblack@google.com#endif 34213865Sgabeblack@google.com 34313865Sgabeblack@google.com Status status() const { return actualTC->status(); } 34413865Sgabeblack@google.com 34513610Sgiacomo.gabrielli@arm.com void setStatus(Status new_status) { actualTC->setStatus(new_status); } 34613865Sgabeblack@google.com 34713865Sgabeblack@google.com /// Set the status to Active. Optional delay indicates number of 34813865Sgabeblack@google.com /// cycles to wait before beginning execution. 34913865Sgabeblack@google.com void activate(int delay = 1) { actualTC->activate(delay); } 35013865Sgabeblack@google.com 3519920Syasuko.eckert@amd.com /// Set the status to Suspended. 35213557Sgabeblack@google.com void suspend(int delay = 0) { actualTC->suspend(); } 35313865Sgabeblack@google.com 3542315SN/A /// Set the status to Halted. 3552680SN/A void halt(int delay = 0) { actualTC->halt(); } 3562680SN/A 3572315SN/A#if FULL_SYSTEM 3582315SN/A void dumpFuncProfile() { actualTC->dumpFuncProfile(); } 35913557Sgabeblack@google.com#endif 36013865Sgabeblack@google.com 3612669SN/A void takeOverFrom(ThreadContext *oldContext) 36213611Sgabeblack@google.com { actualTC->takeOverFrom(oldContext); } 36313611Sgabeblack@google.com 3642315SN/A void regStats(const std::string &name) { actualTC->regStats(name); } 3652315SN/A 36613557Sgabeblack@google.com void serialize(std::ostream &os) { actualTC->serialize(os); } 36713628SAndrea.Mondelli@ucf.edu void unserialize(Checkpoint *cp, const std::string §ion) 36812109SRekai.GonzalezAlberquilla@arm.com { actualTC->unserialize(cp, section); } 36912109SRekai.GonzalezAlberquilla@arm.com 37012109SRekai.GonzalezAlberquilla@arm.com#if FULL_SYSTEM 37112109SRekai.GonzalezAlberquilla@arm.com EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); } 37212109SRekai.GonzalezAlberquilla@arm.com 37313557Sgabeblack@google.com Tick readLastActivate() { return actualTC->readLastActivate(); } 37413628SAndrea.Mondelli@ucf.edu Tick readLastSuspend() { return actualTC->readLastSuspend(); } 37512109SRekai.GonzalezAlberquilla@arm.com 37612109SRekai.GonzalezAlberquilla@arm.com void profileClear() { return actualTC->profileClear(); } 37712109SRekai.GonzalezAlberquilla@arm.com void profileSample() { return actualTC->profileSample(); } 37812109SRekai.GonzalezAlberquilla@arm.com#endif 37912109SRekai.GonzalezAlberquilla@arm.com 38013557Sgabeblack@google.com // @todo: Do I need this? 38113628SAndrea.Mondelli@ucf.edu void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); } 38213610Sgiacomo.gabrielli@arm.com 38313610Sgiacomo.gabrielli@arm.com void clearArchRegs() { actualTC->clearArchRegs(); } 38413610Sgiacomo.gabrielli@arm.com 38513610Sgiacomo.gabrielli@arm.com // 38613610Sgiacomo.gabrielli@arm.com // New accessors for new decoder. 38713610Sgiacomo.gabrielli@arm.com // 38813865Sgabeblack@google.com uint64_t readIntReg(int reg_idx) 3899920Syasuko.eckert@amd.com { return actualTC->readIntReg(reg_idx); } 3909920Syasuko.eckert@amd.com 3919920Syasuko.eckert@amd.com FloatReg readFloatReg(int reg_idx) 3929920Syasuko.eckert@amd.com { return actualTC->readFloatReg(reg_idx); } 3939920Syasuko.eckert@amd.com 3948733Sgeoffrey.blake@arm.com FloatRegBits readFloatRegBits(int reg_idx) 39513865Sgabeblack@google.com { return actualTC->readFloatRegBits(reg_idx); } 3962315SN/A 3978733Sgeoffrey.blake@arm.com void setIntReg(int reg_idx, uint64_t val) 39813557Sgabeblack@google.com { actualTC->setIntReg(reg_idx, val); } 39913628SAndrea.Mondelli@ucf.edu 4002315SN/A void setFloatReg(int reg_idx, FloatReg val) 4018733Sgeoffrey.blake@arm.com { actualTC->setFloatReg(reg_idx, val); } 4028733Sgeoffrey.blake@arm.com 4038733Sgeoffrey.blake@arm.com void setFloatRegBits(int reg_idx, FloatRegBits val) 4042315SN/A { actualTC->setFloatRegBits(reg_idx, val); } 4058733Sgeoffrey.blake@arm.com 4062315SN/A TheISA::PCState pcState() { return actualTC->pcState(); } 4072315SN/A 40813557Sgabeblack@google.com void pcState(const TheISA::PCState &val) { actualTC->pcState(val); } 40913557Sgabeblack@google.com 41011886Sbrandon.potter@amd.com#if USE_CHECKER 41111886Sbrandon.potter@amd.com void pcStateNoRecord(const TheISA::PCState &val) { actualTC->pcState(val); } 41211886Sbrandon.potter@amd.com#endif 41311886Sbrandon.potter@amd.com 41411886Sbrandon.potter@amd.com Addr instAddr() { return actualTC->instAddr(); } 41513557Sgabeblack@google.com Addr nextInstAddr() { return actualTC->nextInstAddr(); } 41613628SAndrea.Mondelli@ucf.edu MicroPC microPC() { return actualTC->microPC(); } 4172315SN/A 4188733Sgeoffrey.blake@arm.com bool readPredicate() { return actualTC->readPredicate(); } 4192315SN/A 4202315SN/A void setPredicate(bool val) 4218733Sgeoffrey.blake@arm.com { actualTC->setPredicate(val); } 42213865Sgabeblack@google.com 4232669SN/A MiscReg readMiscRegNoEffect(int misc_reg) 4248733Sgeoffrey.blake@arm.com { return actualTC->readMiscRegNoEffect(misc_reg); } 42513865Sgabeblack@google.com 4268733Sgeoffrey.blake@arm.com MiscReg readMiscReg(int misc_reg) 4278733Sgeoffrey.blake@arm.com { return actualTC->readMiscReg(misc_reg); } 42813865Sgabeblack@google.com 4292669SN/A void setMiscRegNoEffect(int misc_reg, const MiscReg &val) 43013865Sgabeblack@google.com { return actualTC->setMiscRegNoEffect(misc_reg, val); } 43113865Sgabeblack@google.com 43213865Sgabeblack@google.com void setMiscReg(int misc_reg, const MiscReg &val) 43313865Sgabeblack@google.com { return actualTC->setMiscReg(misc_reg, val); } 43413865Sgabeblack@google.com 4354172Ssaidi@eecs.umich.edu int flattenIntIndex(int reg) 43613865Sgabeblack@google.com { return actualTC->flattenIntIndex(reg); } 43713865Sgabeblack@google.com 43813865Sgabeblack@google.com int flattenFloatIndex(int reg) 43913865Sgabeblack@google.com { return actualTC->flattenFloatIndex(reg); } 44013865Sgabeblack@google.com 4412315SN/A unsigned readStCondFailures() 44213557Sgabeblack@google.com { return actualTC->readStCondFailures(); } 44313865Sgabeblack@google.com 4444172Ssaidi@eecs.umich.edu void setStCondFailures(unsigned sc_failures) 4458733Sgeoffrey.blake@arm.com { actualTC->setStCondFailures(sc_failures); } 4468733Sgeoffrey.blake@arm.com 4474172Ssaidi@eecs.umich.edu // @todo: Fix this! 4484172Ssaidi@eecs.umich.edu bool misspeculating() { return actualTC->misspeculating(); } 4494172Ssaidi@eecs.umich.edu 4502315SN/A#if !FULL_SYSTEM 45113557Sgabeblack@google.com void syscall(int64_t callnum) 45213865Sgabeblack@google.com { actualTC->syscall(callnum); } 4532315SN/A 4548733Sgeoffrey.blake@arm.com Counter readFuncExeInst() { return actualTC->readFuncExeInst(); } 4558733Sgeoffrey.blake@arm.com#endif 4562680SN/A}; 4573468Sgblack@eecs.umich.edu 4582315SN/A#endif 4592315SN/A