thread_state.hh (8777:dd43f1c9fa0a) | thread_state.hh (8799:dac1e33e07b0) |
---|---|
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) --- 44class ProfileNode; 45namespace TheISA { 46 namespace Kernel { 47 class Statistics; 48 }; 49}; 50 51class Checkpoint; | 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) --- 44class ProfileNode; 45namespace TheISA { 46 namespace Kernel { 47 class Statistics; 48 }; 49}; 50 51class Checkpoint; |
52class Port; 53class TranslatingPort; | 52class PortProxy; 53class SETranslatingPort; 54class FSTranslatingPort; |
54 55/** 56 * Struct for holding general thread state that is needed across CPU 57 * models. This includes things such as pointers to the process, 58 * memory, quiesce events, and certain stats. This can be expanded 59 * to hold more thread-specific stats within it. 60 */ 61struct ThreadState { --- 16 unchanged lines hidden (view full) --- 78 void setThreadId(ThreadID id) { _threadId = id; } 79 80 ThreadID threadId() { return _threadId; } 81 82 Tick readLastActivate() { return lastActivate; } 83 84 Tick readLastSuspend() { return lastSuspend; } 85 | 55 56/** 57 * Struct for holding general thread state that is needed across CPU 58 * models. This includes things such as pointers to the process, 59 * memory, quiesce events, and certain stats. This can be expanded 60 * to hold more thread-specific stats within it. 61 */ 62struct ThreadState { --- 16 unchanged lines hidden (view full) --- 79 void setThreadId(ThreadID id) { _threadId = id; } 80 81 ThreadID threadId() { return _threadId; } 82 83 Tick readLastActivate() { return lastActivate; } 84 85 Tick readLastSuspend() { return lastSuspend; } 86 |
86 void connectPhysPort(); | 87 /** 88 * Initialise the physical and virtual port proxies and tie them to 89 * the data port of the CPU. 90 * 91 * tc ThreadContext for the virtual-to-physical translation 92 */ 93 void initMemProxies(ThreadContext *tc); |
87 | 94 |
88 void connectVirtPort(ThreadContext *tc); 89 90 void connectMemPorts(ThreadContext *tc); 91 | |
92 void dumpFuncProfile(); 93 94 EndQuiesceEvent *getQuiesceEvent() { return quiesceEvent; } 95 96 void profileClear(); 97 98 void profileSample(); 99 100 TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; } 101 | 95 void dumpFuncProfile(); 96 97 EndQuiesceEvent *getQuiesceEvent() { return quiesceEvent; } 98 99 void profileClear(); 100 101 void profileSample(); 102 103 TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; } 104 |
102 Process *getProcessPtr() { return process; } | 105 PortProxy* getPhysProxy() { return physProxy; } |
103 | 106 |
104 TranslatingPort *getMemPort(); | 107 FSTranslatingPortProxy* getVirtProxy() { return virtProxy; } |
105 | 108 |
106 void setMemPort(TranslatingPort *_port) { port = _port; } | 109 Process *getProcessPtr() { return process; } |
107 | 110 |
108 VirtualPort *getVirtPort() { return virtPort; } | 111 SETranslatingPortProxy* getMemProxy(); |
109 | 112 |
110 FunctionalPort *getPhysPort() { return physPort; } 111 112 void setPhysPort(FunctionalPort *port) { physPort = port; } 113 | |
114 /** Reads the number of instructions functionally executed and 115 * committed. 116 */ 117 Counter readFuncExeInst() { return funcExeInst; } 118 119 /** Sets the total number of instructions functionally executed 120 * and committed. 121 */ 122 void setFuncExeInst(Counter new_val) { funcExeInst = new_val; } 123 124 /** Returns the status of this thread. */ 125 Status status() const { return _status; } 126 127 /** Sets the status of this thread. */ 128 void setStatus(Status new_status) { _status = new_status; } 129 130 public: | 113 /** Reads the number of instructions functionally executed and 114 * committed. 115 */ 116 Counter readFuncExeInst() { return funcExeInst; } 117 118 /** Sets the total number of instructions functionally executed 119 * and committed. 120 */ 121 void setFuncExeInst(Counter new_val) { funcExeInst = new_val; } 122 123 /** Returns the status of this thread. */ 124 Status status() const { return _status; } 125 126 /** Sets the status of this thread. */ 127 void setStatus(Status new_status) { _status = new_status; } 128 129 public: |
131 /** Connects port to the functional port of the memory object 132 * below the CPU. */ 133 void connectToMemFunc(Port *port); | |
134 135 /** Number of instructions committed. */ 136 Counter numInst; 137 /** Stat for number instructions committed. */ 138 Stats::Scalar numInsts; 139 /** Stat for number of memory references. */ 140 Stats::Scalar numMemRefs; 141 --- 30 unchanged lines hidden (view full) --- 172 Addr profilePC; 173 EndQuiesceEvent *quiesceEvent; 174 175 TheISA::Kernel::Statistics *kernelStats; 176 177 protected: 178 Process *process; 179 | 130 131 /** Number of instructions committed. */ 132 Counter numInst; 133 /** Stat for number instructions committed. */ 134 Stats::Scalar numInsts; 135 /** Stat for number of memory references. */ 136 Stats::Scalar numMemRefs; 137 --- 30 unchanged lines hidden (view full) --- 168 Addr profilePC; 169 EndQuiesceEvent *quiesceEvent; 170 171 TheISA::Kernel::Statistics *kernelStats; 172 173 protected: 174 Process *process; 175 |
180 TranslatingPort *port; 181 182 /** A functional port, outgoing only, for functional accesse to virtual 183 * addresses. */ 184 VirtualPort *virtPort; 185 186 /** A functional port outgoing only for functional accesses to physical | 176 /** A port proxy outgoing only for functional accesses to physical |
187 * addresses.*/ | 177 * addresses.*/ |
188 FunctionalPort *physPort; | 178 PortProxy *physProxy; |
189 | 179 |
180 /** A translating port proxy, outgoing only, for functional 181 * accesse to virtual addresses. */ 182 FSTranslatingPortProxy* virtProxy; 183 SETranslatingPortProxy* proxy; 184 |
|
190 public: 191 /* 192 * number of executed instructions, for matching with syscall trace 193 * points in EIO files. 194 */ 195 Counter funcExeInst; 196 197 // 198 // Count failed store conditionals so we can warn of apparent 199 // application deadlock situations. 200 unsigned storeCondFailures; 201}; 202 203#endif // __CPU_THREAD_STATE_HH__ | 185 public: 186 /* 187 * number of executed instructions, for matching with syscall trace 188 * points in EIO files. 189 */ 190 Counter funcExeInst; 191 192 // 193 // Count failed store conditionals so we can warn of apparent 194 // application deadlock situations. 195 unsigned storeCondFailures; 196}; 197 198#endif // __CPU_THREAD_STATE_HH__ |