Deleted Added
sdiff udiff text old ( 3093:b09c33e66bce ) new ( 3221:669a04468c0d )
full compact
1/*
2 * Copyright (c) 2004-2005 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;

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

197 }
198
199 /** The tick event used for scheduling CPU ticks. */
200 ActivateThreadEvent activateThreadEvent[Impl::MaxThreads];
201
202 class DeallocateContextEvent : public Event
203 {
204 private:
205 /** Number of Thread to Activate */
206 int tid;
207
208 /** Pointer to the CPU. */
209 FullO3CPU<Impl> *cpu;
210
211 public:
212 /** Constructs the event. */
213 DeallocateContextEvent();
214
215 /** Initialize Event */
216 void init(int thread_num, FullO3CPU<Impl> *thread_cpu);
217
218 /** Processes the event, calling activateThread() on the CPU. */
219 void process();
220
221 /** Returns the description of the event. */
222 const char *description();
223 };
224
225 /** Schedule cpu to deallocate thread context.*/
226 void scheduleDeallocateContextEvent(int tid, int delay)
227 {
228 // Schedule thread to activate, regardless of its current state.
229 if (deallocateContextEvent[tid].squashed())
230 deallocateContextEvent[tid].reschedule(curTick + cycles(delay));
231 else if (!deallocateContextEvent[tid].scheduled())
232 deallocateContextEvent[tid].schedule(curTick + cycles(delay));
233 }
234

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

291
292 /** Add Thread to Active Threads List. */
293 void activateContext(int tid, int delay);
294
295 /** Remove Thread from Active Threads List */
296 void suspendContext(int tid);
297
298 /** Remove Thread from Active Threads List &&
299 * Remove Thread Context from CPU.
300 */
301 void deallocateContext(int tid, int delay = 1);
302
303 /** Remove Thread from Active Threads List &&
304 * Remove Thread Context from CPU.
305 */
306 void haltContext(int tid);
307
308 /** Activate a Thread When CPU Resources are Available. */
309 void activateWhenReady(int tid);

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

621 Event *drainEvent;
622
623 /** Counter of how many stages have completed draining. */
624 int drainCount;
625
626 /** Pointers to all of the threads in the CPU. */
627 std::vector<Thread *> thread;
628
629 /** Pointer to the icache interface. */
630 MemInterface *icacheInterface;
631 /** Pointer to the dcache interface. */
632 MemInterface *dcacheInterface;
633
634 /** Whether or not the CPU should defer its registration. */
635 bool deferRegistration;
636
637 /** Is there a context switch pending? */
638 bool contextSwitch;
639
640 /** Threads Scheduled to Enter CPU */
641 std::list<int> cpuWaitList;

--- 35 unchanged lines hidden ---