Deleted Added
sdiff udiff text old ( 9647:5b6b315472e7 ) new ( 9749:cffb82b745cf )
full compact
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

142 comInstEventQueue[tid] =
143 new EventQueue("instruction-based event queue");
144
145 //
146 // set up instruction-count-based termination events, if any
147 //
148 if (p->max_insts_any_thread != 0) {
149 const char *cause = "a thread reached the max instruction count";
150 for (ThreadID tid = 0; tid < numThreads; ++tid)
151 scheduleInstStop(tid, p->max_insts_any_thread, cause);
152 }
153
154 // Set up instruction-count-based termination events for SimPoints
155 // Typically, there are more than one action points.
156 // Simulation.py is responsible to take the necessary actions upon
157 // exitting the simulation loop.
158 if (!p->simpoint_start_insts.empty()) {
159 const char *cause = "simpoint starting point found";
160 for (size_t i = 0; i < p->simpoint_start_insts.size(); ++i)
161 scheduleInstStop(0, p->simpoint_start_insts[i], cause);
162 }
163
164 if (p->max_insts_all_threads != 0) {
165 const char *cause = "all threads reached the max instruction count";
166
167 // allocate & initialize shared downcounter: each event will
168 // decrement this when triggered; simulation will terminate
169 // when counter reaches 0

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

180 for (ThreadID tid = 0; tid < numThreads; ++tid)
181 comLoadEventQueue[tid] = new EventQueue("load-based event queue");
182
183 //
184 // set up instruction-count-based termination events, if any
185 //
186 if (p->max_loads_any_thread != 0) {
187 const char *cause = "a thread reached the max load count";
188 for (ThreadID tid = 0; tid < numThreads; ++tid)
189 scheduleLoadStop(tid, p->max_loads_any_thread, cause);
190 }
191
192 if (p->max_loads_all_threads != 0) {
193 const char *cause = "all threads reached the max load count";
194 // allocate & initialize shared downcounter: each event will
195 // decrement this when triggered; simulation will terminate
196 // when counter reaches 0
197 int *counter = new int;

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

561
562 // Unserialize the threads, this is done by the CPU implementation.
563 for (ThreadID i = 0; i < numThreads; ++i)
564 unserializeThread(cp, csprintf("%s.xc.%i", section, i), i);
565 }
566}
567
568void
569BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
570{
571 const Tick now(comInstEventQueue[tid]->getCurTick());
572 Event *event(new SimLoopExitEvent(cause, 0));
573
574 comInstEventQueue[tid]->schedule(event, now + insts);
575}
576
577void
578BaseCPU::scheduleLoadStop(ThreadID tid, Counter loads, const char *cause)
579{
580 const Tick now(comLoadEventQueue[tid]->getCurTick());
581 Event *event(new SimLoopExitEvent(cause, 0));
582
583 comLoadEventQueue[tid]->schedule(event, now + loads);
584}
585
586
587void
588BaseCPU::traceFunctionsInternal(Addr pc)
589{
590 if (!debugSymbolTable)
591 return;
592
593 // if pc enters different function, print new function symbol and
594 // update saved range. Otherwise do nothing.
595 if (pc < currentFunctionStart || pc >= currentFunctionEnd) {

--- 17 unchanged lines hidden ---