base.cc (4796:e938afbfc8cd) | base.cc (4873:b135f6e6adfe) |
---|---|
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; --- 28 unchanged lines hidden (view full) --- 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" | 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; --- 28 unchanged lines hidden (view full) --- 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" |
|
45#include "sim/process.hh" 46#include "sim/sim_events.hh" 47#include "sim/system.hh" 48 49#include "base/trace.hh" 50 51// Hack 52#include "sim/stat_control.hh" --- 32 unchanged lines hidden (view full) --- 85#endif 86 lastNumInst = temp; 87 schedule(curTick + interval); 88} 89 90const char * 91CPUProgressEvent::description() 92{ | 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 53#include "sim/stat_control.hh" --- 32 unchanged lines hidden (view full) --- 86#endif 87 lastNumInst = temp; 88 schedule(curTick + interval); 89} 90 91const char * 92CPUProgressEvent::description() 93{ |
93 return "CPU Progress event"; | 94 return "CPU Progress"; |
94} 95 96#if FULL_SYSTEM 97BaseCPU::BaseCPU(Params *p) 98 : MemObject(p->name), clock(p->clock), instCnt(0), 99 params(p), number_of_threads(p->numberOfThreads), system(p->system), 100 phase(p->phase) 101#else 102BaseCPU::BaseCPU(Params *p) 103 : MemObject(p->name), clock(p->clock), params(p), 104 number_of_threads(p->numberOfThreads), system(p->system), 105 phase(p->phase) 106#endif 107{ 108// currentTick = curTick; | 95} 96 97#if FULL_SYSTEM 98BaseCPU::BaseCPU(Params *p) 99 : MemObject(p->name), clock(p->clock), instCnt(0), 100 params(p), number_of_threads(p->numberOfThreads), system(p->system), 101 phase(p->phase) 102#else 103BaseCPU::BaseCPU(Params *p) 104 : MemObject(p->name), clock(p->clock), params(p), 105 number_of_threads(p->numberOfThreads), system(p->system), 106 phase(p->phase) 107#endif 108{ 109// currentTick = curTick; |
110 DPRINTF(FullCPU, "BaseCPU: Creating object, mem address %#x.\n", this); |
|
109 110 // add self to global list of CPUs 111 cpuList.push_back(this); 112 | 111 112 // add self to global list of CPUs 113 cpuList.push_back(this); 114 |
115 DPRINTF(FullCPU, "BaseCPU: CPU added to cpuList, mem address %#x.\n", 116 this); 117 |
|
113 if (number_of_threads > maxThreadsPerCPU) 114 maxThreadsPerCPU = number_of_threads; 115 116 // allocate per-thread instruction-based event queues 117 comInstEventQueue = new EventQueue *[number_of_threads]; 118 for (int i = 0; i < number_of_threads; ++i) 119 comInstEventQueue[i] = new EventQueue("instruction-based event queue"); 120 --- 58 unchanged lines hidden (view full) --- 179 true); 180 } 181 } 182#if FULL_SYSTEM 183 profileEvent = NULL; 184 if (params->profile) 185 profileEvent = new ProfileEvent(this, params->profile); 186#endif | 118 if (number_of_threads > maxThreadsPerCPU) 119 maxThreadsPerCPU = number_of_threads; 120 121 // allocate per-thread instruction-based event queues 122 comInstEventQueue = new EventQueue *[number_of_threads]; 123 for (int i = 0; i < number_of_threads; ++i) 124 comInstEventQueue[i] = new EventQueue("instruction-based event queue"); 125 --- 58 unchanged lines hidden (view full) --- 184 true); 185 } 186 } 187#if FULL_SYSTEM 188 profileEvent = NULL; 189 if (params->profile) 190 profileEvent = new ProfileEvent(this, params->profile); 191#endif |
187 tracer = params->tracer; | |
188} 189 190BaseCPU::Params::Params() 191{ 192#if FULL_SYSTEM 193 profile = false; 194#endif 195 checker = NULL; | 192} 193 194BaseCPU::Params::Params() 195{ 196#if FULL_SYSTEM 197 profile = false; 198#endif 199 checker = NULL; |
196 tracer = NULL; | |
197} 198 199void 200BaseCPU::enableFunctionTrace() 201{ 202 functionTracingEnabled = true; 203} 204 --- 242 unchanged lines hidden (view full) --- 447 currentFunctionEnd = pc + 1; 448 } 449 450 ccprintf(*functionTraceStream, " (%d)\n%d: %s", 451 curTick - functionEntryTick, curTick, sym_str); 452 functionEntryTick = curTick; 453 } 454} | 200} 201 202void 203BaseCPU::enableFunctionTrace() 204{ 205 functionTracingEnabled = true; 206} 207 --- 242 unchanged lines hidden (view full) --- 450 currentFunctionEnd = pc + 1; 451 } 452 453 ccprintf(*functionTraceStream, " (%d)\n%d: %s", 454 curTick - functionEntryTick, curTick, sym_str); 455 functionEntryTick = curTick; 456 } 457} |
458 459 460DEFINE_SIM_OBJECT_CLASS_NAME("BaseCPU", BaseCPU) |
|