base.cc (5875:d82be3235ab4) | base.cc (6144:e330f7bc22ef) |
---|---|
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; --- 47 unchanged lines hidden (view full) --- 56vector<BaseCPU *> BaseCPU::cpuList; 57 58// This variable reflects the max number of threads in any CPU. Be 59// careful to only use it once all the CPUs that you care about have 60// been initialized 61int maxThreadsPerCPU = 1; 62 63CPUProgressEvent::CPUProgressEvent(BaseCPU *_cpu, Tick ival) | 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; --- 47 unchanged lines hidden (view full) --- 56vector<BaseCPU *> BaseCPU::cpuList; 57 58// This variable reflects the max number of threads in any CPU. Be 59// careful to only use it once all the CPUs that you care about have 60// been initialized 61int maxThreadsPerCPU = 1; 62 63CPUProgressEvent::CPUProgressEvent(BaseCPU *_cpu, Tick ival) |
64 : Event(Event::Progress_Event_Pri), interval(ival), lastNumInst(0), 65 cpu(_cpu) | 64 : Event(Event::Progress_Event_Pri), _interval(ival), lastNumInst(0), 65 cpu(_cpu), _repeatEvent(true) |
66{ | 66{ |
67 if (interval) 68 cpu->schedule(this, curTick + interval); | 67 if (_interval) 68 cpu->schedule(this, curTick + _interval); |
69} 70 71void 72CPUProgressEvent::process() 73{ 74 Counter temp = cpu->totalInstructions(); 75#ifndef NDEBUG | 69} 70 71void 72CPUProgressEvent::process() 73{ 74 Counter temp = cpu->totalInstructions(); 75#ifndef NDEBUG |
76 double ipc = double(temp - lastNumInst) / (interval / cpu->ticks(1)); | 76 double ipc = double(temp - lastNumInst) / (_interval / cpu->ticks(1)); |
77 | 77 |
78 DPRINTFN("%s progress event, instructions committed: %lli, IPC: %0.8d\n", 79 cpu->name(), temp - lastNumInst, ipc); | 78 DPRINTFN("%s progress event, total committed:%i, progress insts committed: " 79 "%lli, IPC: %0.8d\n", cpu->name(), temp, temp - lastNumInst, 80 ipc); |
80 ipc = 0.0; 81#else | 81 ipc = 0.0; 82#else |
82 cprintf("%lli: %s progress event, instructions committed: %lli\n", 83 curTick, cpu->name(), temp - lastNumInst); | 83 cprintf("%lli: %s progress event, total committed:%i, progress insts " 84 "committed: %lli\n", curTick, cpu->name(), temp, 85 temp - lastNumInst); |
84#endif 85 lastNumInst = temp; | 86#endif 87 lastNumInst = temp; |
86 cpu->schedule(this, curTick + interval); | 88 89 if (_repeatEvent) 90 cpu->schedule(this, curTick + _interval); |
87} 88 89const char * 90CPUProgressEvent::description() const 91{ 92 return "CPU Progress"; 93} 94 --- 130 unchanged lines hidden (view full) --- 225{ 226#if FULL_SYSTEM 227 if (!params()->defer_registration && profileEvent) 228 schedule(profileEvent, curTick); 229#endif 230 231 if (params()->progress_interval) { 232 Tick num_ticks = ticks(params()->progress_interval); | 91} 92 93const char * 94CPUProgressEvent::description() const 95{ 96 return "CPU Progress"; 97} 98 --- 130 unchanged lines hidden (view full) --- 229{ 230#if FULL_SYSTEM 231 if (!params()->defer_registration && profileEvent) 232 schedule(profileEvent, curTick); 233#endif 234 235 if (params()->progress_interval) { 236 Tick num_ticks = ticks(params()->progress_interval); |
233 Event *event = new CPUProgressEvent(this, num_ticks); 234 schedule(event, curTick + num_ticks); | 237 238 Event *event; 239 event = new CPUProgressEvent(this, num_ticks); |
235 } 236} 237 238 239void 240BaseCPU::regStats() 241{ 242 using namespace Stats; --- 198 unchanged lines hidden --- | 240 } 241} 242 243 244void 245BaseCPU::regStats() 246{ 247 using namespace Stats; --- 198 unchanged lines hidden --- |