thread_state.cc (14022:a7cdc33dab35) | thread_state.cc (14023:40eb7ed47e61) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44#include "sim/system.hh" 45 46ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process) 47 : numInst(0), numOp(0), numLoad(0), startNumLoad(0), 48 _status(ThreadContext::Halted), baseCpu(cpu), 49 _contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0), 50 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), 51 kernelStats(NULL), process(_process), physProxy(NULL), virtProxy(NULL), | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44#include "sim/system.hh" 45 46ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process) 47 : numInst(0), numOp(0), numLoad(0), startNumLoad(0), 48 _status(ThreadContext::Halted), baseCpu(cpu), 49 _contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0), 50 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), 51 kernelStats(NULL), process(_process), physProxy(NULL), virtProxy(NULL), |
52 proxy(NULL), funcExeInst(0), storeCondFailures(0) | 52 funcExeInst(0), storeCondFailures(0) |
53{ 54} 55 56ThreadState::~ThreadState() 57{ 58 if (physProxy != NULL) 59 delete physProxy; 60 if (virtProxy != NULL) 61 delete virtProxy; | 53{ 54} 55 56ThreadState::~ThreadState() 57{ 58 if (physProxy != NULL) 59 delete physProxy; 60 if (virtProxy != NULL) 61 delete virtProxy; |
62 if (proxy != NULL) 63 delete proxy; | |
64} 65 66void 67ThreadState::serialize(CheckpointOut &cp) const 68{ 69 SERIALIZE_ENUM(_status); 70 // thread_num and cpu_id are deterministic from the config 71 SERIALIZE_SCALAR(funcExeInst); --- 41 unchanged lines hidden (view full) --- 113 // itself is created in the base cpu constructor and the 114 // getDataPort is a virtual function 115 physProxy = new PortProxy(baseCpu->getDataPort(), 116 baseCpu->cacheLineSize()); 117 118 assert(virtProxy == NULL); 119 virtProxy = new FSTranslatingPortProxy(tc); 120 } else { | 62} 63 64void 65ThreadState::serialize(CheckpointOut &cp) const 66{ 67 SERIALIZE_ENUM(_status); 68 // thread_num and cpu_id are deterministic from the config 69 SERIALIZE_SCALAR(funcExeInst); --- 41 unchanged lines hidden (view full) --- 111 // itself is created in the base cpu constructor and the 112 // getDataPort is a virtual function 113 physProxy = new PortProxy(baseCpu->getDataPort(), 114 baseCpu->cacheLineSize()); 115 116 assert(virtProxy == NULL); 117 virtProxy = new FSTranslatingPortProxy(tc); 118 } else { |
121 assert(proxy == NULL); 122 proxy = new SETranslatingPortProxy(baseCpu->getDataPort(), | 119 assert(virtProxy == NULL); 120 virtProxy = new SETranslatingPortProxy(baseCpu->getDataPort(), |
123 process, 124 SETranslatingPortProxy::NextPage); 125 } 126} 127 128PortProxy & 129ThreadState::getPhysProxy() 130{ --- 9 unchanged lines hidden (view full) --- 140 assert(virtProxy != NULL); 141 return *virtProxy; 142} 143 144PortProxy & 145ThreadState::getMemProxy() 146{ 147 assert(!FullSystem); | 121 process, 122 SETranslatingPortProxy::NextPage); 123 } 124} 125 126PortProxy & 127ThreadState::getPhysProxy() 128{ --- 9 unchanged lines hidden (view full) --- 138 assert(virtProxy != NULL); 139 return *virtProxy; 140} 141 142PortProxy & 143ThreadState::getMemProxy() 144{ 145 assert(!FullSystem); |
148 assert(proxy != NULL); 149 return *proxy; | 146 assert(virtProxy != NULL); 147 return *virtProxy; |
150} 151 152void 153ThreadState::profileClear() 154{ 155 if (profile) 156 profile->clear(); 157} 158 159void 160ThreadState::profileSample() 161{ 162 if (profile) 163 profile->sample(profileNode, profilePC); 164} | 148} 149 150void 151ThreadState::profileClear() 152{ 153 if (profile) 154 profile->clear(); 155} 156 157void 158ThreadState::profileSample() 159{ 160 if (profile) 161 profile->sample(profileNode, profilePC); 162} |