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; --- 37 unchanged lines hidden (view full) --- 46class ProfileNode; 47namespace Kernel { 48 class Statistics; 49}; 50#endif 51 52class BaseCPU; 53class Checkpoint; |
54class Port; |
55class TranslatingPort; 56 57/** 58 * Struct for holding general thread state that is needed across CPU 59 * models. This includes things such as pointers to the process, 60 * memory, quiesce events, and certain stats. This can be expanded 61 * to hold more thread-specific stats within it. 62 */ 63struct ThreadState { 64 typedef ThreadContext::Status Status; 65 66#if FULL_SYSTEM 67 ThreadState(BaseCPU *cpu, int _cpuId, int _tid); 68#else 69 ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process, 70 short _asid); 71#endif 72 |
73 ~ThreadState(); 74 |
75 void serialize(std::ostream &os); 76 77 void unserialize(Checkpoint *cp, const std::string §ion); 78 79 void setCpuId(int id) { cpuId = id; } 80 81 int readCpuId() { return cpuId; } 82 --- 51 unchanged lines hidden (view full) --- 134 void setFuncExeInst(Counter new_val) { funcExeInst = new_val; } 135 136 /** Returns the status of this thread. */ 137 Status status() const { return _status; } 138 139 /** Sets the status of this thread. */ 140 void setStatus(Status new_status) { _status = new_status; } 141 |
142 protected: 143 /** Gets a functional port from the memory object that's connected 144 * to the CPU. */ 145 Port *getMemFuncPort(); 146 147 public: |
148 /** Number of instructions committed. */ 149 Counter numInst; 150 /** Stat for number instructions committed. */ 151 Stats::Scalar<> numInsts; 152 /** Stat for number of memory references. */ 153 Stats::Scalar<> numMemRefs; 154 155 /** Number of simulated loads, used for tracking events based on --- 96 unchanged lines hidden --- |