thread_state.hh (2669:f2b336e89d2a) thread_state.hh (2678:1f86b91dc3bb)
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;

--- 17 unchanged lines hidden (view full) ---

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef __CPU_THREAD_STATE_HH__
30#define __CPU_THREAD_STATE_HH__
31
32#include "cpu/exec_context.hh"
33
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;

--- 17 unchanged lines hidden (view full) ---

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef __CPU_THREAD_STATE_HH__
30#define __CPU_THREAD_STATE_HH__
31
32#include "cpu/exec_context.hh"
33
34#if !FULL_SYSTEM
35#include "mem/translating_port.hh"
36#endif
37
34#if FULL_SYSTEM
35class EndQuiesceEvent;
36class FunctionProfile;
37class ProfileNode;
38namespace Kernel {
39 class Statistics;
40};
41#else

--- 4 unchanged lines hidden (view full) ---

46/**
47 * Struct for holding general thread state that is needed across CPU
48 * models. This includes things such as pointers to the process,
49 * memory, quiesce events, and certain stats. This can be expanded
50 * to hold more thread-specific stats within it.
51 */
52struct ThreadState {
53#if FULL_SYSTEM
38#if FULL_SYSTEM
39class EndQuiesceEvent;
40class FunctionProfile;
41class ProfileNode;
42namespace Kernel {
43 class Statistics;
44};
45#else

--- 4 unchanged lines hidden (view full) ---

50/**
51 * Struct for holding general thread state that is needed across CPU
52 * models. This includes things such as pointers to the process,
53 * memory, quiesce events, and certain stats. This can be expanded
54 * to hold more thread-specific stats within it.
55 */
56struct ThreadState {
57#if FULL_SYSTEM
54 ThreadState(int _cpuId, int _tid, FunctionalMemory *_mem)
55 : cpuId(_cpuId), tid(_tid), mem(_mem), lastActivate(0), lastSuspend(0),
58 ThreadState(int _cpuId, int _tid)
59 : cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
56 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL)
57#else
60 profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL)
61#else
58 ThreadState(int _cpuId, int _tid, FunctionalMemory *_mem,
62 ThreadState(int _cpuId, int _tid, MemObject *mem,
59 Process *_process, short _asid)
63 Process *_process, short _asid)
60 : cpuId(_cpuId), tid(_tid), mem(_mem), process(_process), asid(_asid)
64 : cpuId(_cpuId), tid(_tid), process(_process), asid(_asid)
61#endif
62 {
63 funcExeInst = 0;
64 storeCondFailures = 0;
65#endif
66 {
67 funcExeInst = 0;
68 storeCondFailures = 0;
69#if !FULL_SYSTEM
70 /* Use this port to for syscall emulation writes to memory. */
71 Port *mem_port;
72 port = new TranslatingPort(csprintf("%d-funcport",
73 tid),
74 process->pTable, false);
75 mem_port = mem->getPort("functional");
76 mem_port->setPeer(port);
77 port->setPeer(mem_port);
78#endif
65 }
66
67 ExecContext::Status status;
68
69 int cpuId;
70
71 // Index of hardware thread context on the CPU that this represents.
72 int tid;
73
74 Counter numInst;
75 Stats::Scalar<> numInsts;
76 Stats::Scalar<> numMemRefs;
77
78 // number of simulated loads
79 Counter numLoad;
80 Counter startNumLoad;
81
79 }
80
81 ExecContext::Status status;
82
83 int cpuId;
84
85 // Index of hardware thread context on the CPU that this represents.
86 int tid;
87
88 Counter numInst;
89 Stats::Scalar<> numInsts;
90 Stats::Scalar<> numMemRefs;
91
92 // number of simulated loads
93 Counter numLoad;
94 Counter startNumLoad;
95
82 FunctionalMemory *mem; // functional storage for process address space
83
84#if FULL_SYSTEM
85 Tick lastActivate;
86 Tick lastSuspend;
87
88 FunctionProfile *profile;
89 ProfileNode *profileNode;
90 Addr profilePC;
91
92 EndQuiesceEvent *quiesceEvent;
93
94 Kernel::Statistics *kernelStats;
95#else
96#if FULL_SYSTEM
97 Tick lastActivate;
98 Tick lastSuspend;
99
100 FunctionProfile *profile;
101 ProfileNode *profileNode;
102 Addr profilePC;
103
104 EndQuiesceEvent *quiesceEvent;
105
106 Kernel::Statistics *kernelStats;
107#else
108 TranslatingPort *port;
109
96 Process *process;
97
98 // Address space ID. Note that this is used for TIMING cache
99 // simulation only; all functional memory accesses should use
100 // one of the FunctionalMemory pointers above.
101 short asid;
102
103#endif

--- 26 unchanged lines hidden ---
110 Process *process;
111
112 // Address space ID. Note that this is used for TIMING cache
113 // simulation only; all functional memory accesses should use
114 // one of the FunctionalMemory pointers above.
115 short asid;
116
117#endif

--- 26 unchanged lines hidden ---