base.cc (9647:5b6b315472e7) | base.cc (9749:cffb82b745cf) |
---|---|
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"; | 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 Event *event = new SimLoopExitEvent(cause, 0); 152 comInstEventQueue[tid]->schedule(event, p->max_insts_any_thread); 153 } | 150 for (ThreadID tid = 0; tid < numThreads; ++tid) 151 scheduleInstStop(tid, p->max_insts_any_thread, cause); |
154 } 155 156 // Set up instruction-count-based termination events for SimPoints 157 // Typically, there are more than one action points. 158 // Simulation.py is responsible to take the necessary actions upon 159 // exitting the simulation loop. 160 if (!p->simpoint_start_insts.empty()) { 161 const char *cause = "simpoint starting point found"; | 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"; |
162 for (size_t i = 0; i < p->simpoint_start_insts.size(); ++i) { 163 Event *event = new SimLoopExitEvent(cause, 0); 164 comInstEventQueue[0]->schedule(event, p->simpoint_start_insts[i]); 165 } | 160 for (size_t i = 0; i < p->simpoint_start_insts.size(); ++i) 161 scheduleInstStop(0, p->simpoint_start_insts[i], cause); |
166 } 167 168 if (p->max_insts_all_threads != 0) { 169 const char *cause = "all threads reached the max instruction count"; 170 171 // allocate & initialize shared downcounter: each event will 172 // decrement this when triggered; simulation will terminate 173 // when counter reaches 0 --- 10 unchanged lines hidden (view full) --- 184 for (ThreadID tid = 0; tid < numThreads; ++tid) 185 comLoadEventQueue[tid] = new EventQueue("load-based event queue"); 186 187 // 188 // set up instruction-count-based termination events, if any 189 // 190 if (p->max_loads_any_thread != 0) { 191 const char *cause = "a thread reached the max load count"; | 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"; |
192 for (ThreadID tid = 0; tid < numThreads; ++tid) { 193 Event *event = new SimLoopExitEvent(cause, 0); 194 comLoadEventQueue[tid]->schedule(event, p->max_loads_any_thread); 195 } | 188 for (ThreadID tid = 0; tid < numThreads; ++tid) 189 scheduleLoadStop(tid, p->max_loads_any_thread, cause); |
196 } 197 198 if (p->max_loads_all_threads != 0) { 199 const char *cause = "all threads reached the max load count"; 200 // allocate & initialize shared downcounter: each event will 201 // decrement this when triggered; simulation will terminate 202 // when counter reaches 0 203 int *counter = new int; --- 363 unchanged lines hidden (view full) --- 567 568 // Unserialize the threads, this is done by the CPU implementation. 569 for (ThreadID i = 0; i < numThreads; ++i) 570 unserializeThread(cp, csprintf("%s.xc.%i", section, i), i); 571 } 572} 573 574void | 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 |
|
575BaseCPU::traceFunctionsInternal(Addr pc) 576{ 577 if (!debugSymbolTable) 578 return; 579 580 // if pc enters different function, print new function symbol and 581 // update saved range. Otherwise do nothing. 582 if (pc < currentFunctionStart || pc >= currentFunctionEnd) { --- 17 unchanged lines hidden --- | 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 --- |