thread_state.hh (3402:db60546818d0) thread_state.hh (3486:11b71489efd6)
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;
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;
54class TranslatingPort;
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 {
63 typedef ThreadContext::Status Status;
64
65#if FULL_SYSTEM
66 ThreadState(BaseCPU *cpu, int _cpuId, int _tid);
67#else
68 ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,
69 short _asid);
70#endif
71
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
72 void serialize(std::ostream &os);
73
74 void unserialize(Checkpoint *cp, const std::string &section);
75
76 void setCpuId(int id) { cpuId = id; }
77
78 int readCpuId() { return cpuId; }
79

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

131 void setFuncExeInst(Counter new_val) { funcExeInst = new_val; }
132
133 /** Returns the status of this thread. */
134 Status status() const { return _status; }
135
136 /** Sets the status of this thread. */
137 void setStatus(Status new_status) { _status = new_status; }
138
75 void serialize(std::ostream &os);
76
77 void unserialize(Checkpoint *cp, const std::string &section);
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:
139 /** Number of instructions committed. */
140 Counter numInst;
141 /** Stat for number instructions committed. */
142 Stats::Scalar<> numInsts;
143 /** Stat for number of memory references. */
144 Stats::Scalar<> numMemRefs;
145
146 /** Number of simulated loads, used for tracking events based on

--- 96 unchanged lines hidden ---
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 ---