simple_thread.cc (9377:6f294e7a93d1) simple_thread.cc (9384:877293183bdf)
1/*
2 * Copyright (c) 2001-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;

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

56#include "sim/sim_exit.hh"
57#include "sim/system.hh"
58
59using namespace std;
60
61// constructor
62SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
63 Process *_process, TheISA::TLB *_itb,
1/*
2 * Copyright (c) 2001-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;

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

56#include "sim/sim_exit.hh"
57#include "sim/system.hh"
58
59using namespace std;
60
61// constructor
62SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
63 Process *_process, TheISA::TLB *_itb,
64 TheISA::TLB *_dtb)
65 : ThreadState(_cpu, _thread_num, _process), system(_sys), itb(_itb),
66 dtb(_dtb)
64 TheISA::TLB *_dtb, TheISA::ISA *_isa)
65 : ThreadState(_cpu, _thread_num, _process), isa(_isa), system(_sys),
66 itb(_itb), dtb(_dtb)
67{
68 clearArchRegs();
69 tc = new ProxyThreadContext<SimpleThread>(this);
70}
71
72SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
73 TheISA::TLB *_itb, TheISA::TLB *_dtb,
67{
68 clearArchRegs();
69 tc = new ProxyThreadContext<SimpleThread>(this);
70}
71
72SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
73 TheISA::TLB *_itb, TheISA::TLB *_dtb,
74 bool use_kernel_stats)
75 : ThreadState(_cpu, _thread_num, NULL), system(_sys), itb(_itb), dtb(_dtb)
74 TheISA::ISA *_isa, bool use_kernel_stats)
75 : ThreadState(_cpu, _thread_num, NULL), isa(_isa), system(_sys), itb(_itb),
76 dtb(_dtb)
76{
77 tc = new ProxyThreadContext<SimpleThread>(this);
78
79 quiesceEvent = new EndQuiesceEvent(tc);
80
81 clearArchRegs();
82
83 if (baseCpu->params()->profile) {

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

94 profileNode = &dummyNode;
95 profilePC = 3;
96
97 if (use_kernel_stats)
98 kernelStats = new TheISA::Kernel::Statistics(system);
99}
100
101SimpleThread::SimpleThread()
77{
78 tc = new ProxyThreadContext<SimpleThread>(this);
79
80 quiesceEvent = new EndQuiesceEvent(tc);
81
82 clearArchRegs();
83
84 if (baseCpu->params()->profile) {

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

95 profileNode = &dummyNode;
96 profilePC = 3;
97
98 if (use_kernel_stats)
99 kernelStats = new TheISA::Kernel::Statistics(system);
100}
101
102SimpleThread::SimpleThread()
102 : ThreadState(NULL, -1, NULL)
103 : ThreadState(NULL, -1, NULL), isa(NULL)
103{
104 tc = new ProxyThreadContext<SimpleThread>(this);
105}
106
107SimpleThread::~SimpleThread()
108{
109 delete tc;
110}

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

177 SERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
178 SERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
179 _pcState.serialize(os);
180 // thread_num and cpu_id are deterministic from the config
181
182 //
183 // Now must serialize all the ISA dependent state
184 //
104{
105 tc = new ProxyThreadContext<SimpleThread>(this);
106}
107
108SimpleThread::~SimpleThread()
109{
110 delete tc;
111}

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

178 SERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
179 SERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
180 _pcState.serialize(os);
181 // thread_num and cpu_id are deterministic from the config
182
183 //
184 // Now must serialize all the ISA dependent state
185 //
185 isa.serialize(baseCpu, os);
186 isa->serialize(baseCpu, os);
186}
187
188
189void
190SimpleThread::unserialize(Checkpoint *cp, const std::string &section)
191{
192 ThreadState::unserialize(cp, section);
193 UNSERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
194 UNSERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
195 _pcState.unserialize(cp, section);
196 // thread_num and cpu_id are deterministic from the config
197
198 //
199 // Now must unserialize all the ISA dependent state
200 //
187}
188
189
190void
191SimpleThread::unserialize(Checkpoint *cp, const std::string &section)
192{
193 ThreadState::unserialize(cp, section);
194 UNSERIALIZE_ARRAY(floatRegs.i, TheISA::NumFloatRegs);
195 UNSERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
196 _pcState.unserialize(cp, section);
197 // thread_num and cpu_id are deterministic from the config
198
199 //
200 // Now must unserialize all the ISA dependent state
201 //
201 isa.unserialize(baseCpu, cp, section);
202 isa->unserialize(baseCpu, cp, section);
202}
203
204void
205SimpleThread::dumpFuncProfile()
206{
207 std::ostream *os = simout.create(csprintf("profile.%s.dat",
208 baseCpu->name()));
209 profile->dump(tc, *os);

--- 58 unchanged lines hidden ---
203}
204
205void
206SimpleThread::dumpFuncProfile()
207{
208 std::ostream *os = simout.create(csprintf("profile.%s.dat",
209 baseCpu->name()));
210 profile->dump(tc, *os);

--- 58 unchanged lines hidden ---