1/*
2 * Copyright (c) 2002-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;

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

36#include "base/cprintf.hh"
37#include "base/loader/symtab.hh"
38#include "base/misc.hh"
39#include "base/output.hh"
40#include "cpu/base.hh"
41#include "cpu/cpuevent.hh"
42#include "cpu/thread_context.hh"
43#include "cpu/profile.hh"
44#include "sim/sim_exit.hh"
45#include "sim/param.hh"
46#include "sim/process.hh"
47#include "sim/sim_events.hh"
48#include "sim/system.hh"
49
50#include "base/trace.hh"
51
52// Hack

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

121 for (int i = 0; i < number_of_threads; ++i)
122 comInstEventQueue[i] = new EventQueue("instruction-based event queue");
123
124 //
125 // set up instruction-count-based termination events, if any
126 //
127 if (p->max_insts_any_thread != 0)
128 for (int i = 0; i < number_of_threads; ++i)
128 new SimLoopExitEvent(comInstEventQueue[i], p->max_insts_any_thread,
129 "a thread reached the max instruction count");
129 schedExitSimLoop("a thread reached the max instruction count",
130 p->max_insts_any_thread, 0,
131 comInstEventQueue[i]);
132
133 if (p->max_insts_all_threads != 0) {
134 // allocate & initialize shared downcounter: each event will
135 // decrement this when triggered; simulation will terminate
136 // when counter reaches 0
137 int *counter = new int;
138 *counter = number_of_threads;
139 for (int i = 0; i < number_of_threads; ++i)

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

147 for (int i = 0; i < number_of_threads; ++i)
148 comLoadEventQueue[i] = new EventQueue("load-based event queue");
149
150 //
151 // set up instruction-count-based termination events, if any
152 //
153 if (p->max_loads_any_thread != 0)
154 for (int i = 0; i < number_of_threads; ++i)
153 new SimLoopExitEvent(comLoadEventQueue[i], p->max_loads_any_thread,
154 "a thread reached the max load count");
155 schedExitSimLoop("a thread reached the max load count",
156 p->max_loads_any_thread, 0,
157 comLoadEventQueue[i]);
158
159 if (p->max_loads_all_threads != 0) {
160 // allocate & initialize shared downcounter: each event will
161 // decrement this when triggered; simulation will terminate
162 // when counter reaches 0
163 int *counter = new int;
164 *counter = number_of_threads;
165 for (int i = 0; i < number_of_threads; ++i)

--- 269 unchanged lines hidden ---