base.cc (3541:d74340b852f6) | base.cc (3661:efc80a01aeb6) |
---|---|
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; --- 83 unchanged lines hidden (view full) --- 92CPUProgressEvent::description() 93{ 94 return "CPU Progress event"; 95} 96 97#if FULL_SYSTEM 98BaseCPU::BaseCPU(Params *p) 99 : MemObject(p->name), clock(p->clock), checkInterrupts(true), | 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; --- 83 unchanged lines hidden (view full) --- 92CPUProgressEvent::description() 93{ 94 return "CPU Progress event"; 95} 96 97#if FULL_SYSTEM 98BaseCPU::BaseCPU(Params *p) 99 : MemObject(p->name), clock(p->clock), checkInterrupts(true), |
100 params(p), number_of_threads(p->numberOfThreads), system(p->system) | 100 params(p), number_of_threads(p->numberOfThreads), system(p->system), 101 phase(p->phase) |
101#else 102BaseCPU::BaseCPU(Params *p) 103 : MemObject(p->name), clock(p->clock), params(p), | 102#else 103BaseCPU::BaseCPU(Params *p) 104 : MemObject(p->name), clock(p->clock), params(p), |
104 number_of_threads(p->numberOfThreads), system(p->system) | 105 number_of_threads(p->numberOfThreads), system(p->system), 106 phase(p->phase) |
105#endif 106{ 107// currentTick = curTick; 108 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 --- 139 unchanged lines hidden (view full) --- 252 253#if FULL_SYSTEM 254#endif 255} 256 257Tick 258BaseCPU::nextCycle() 259{ | 107#endif 108{ 109// currentTick = curTick; 110 DPRINTF(FullCPU, "BaseCPU: Creating object, mem address %#x.\n", this); 111 112 // add self to global list of CPUs 113 cpuList.push_back(this); 114 --- 139 unchanged lines hidden (view full) --- 254 255#if FULL_SYSTEM 256#endif 257} 258 259Tick 260BaseCPU::nextCycle() 261{ |
260 Tick next_tick = curTick + clock - 1; | 262 Tick next_tick = curTick - phase + clock - 1; |
261 next_tick -= (next_tick % clock); | 263 next_tick -= (next_tick % clock); |
264 next_tick += phase; |
|
262 return next_tick; 263} 264 265Tick 266BaseCPU::nextCycle(Tick begin_tick) 267{ 268 Tick next_tick = begin_tick; | 265 return next_tick; 266} 267 268Tick 269BaseCPU::nextCycle(Tick begin_tick) 270{ 271 Tick next_tick = begin_tick; |
272 next_tick -= (next_tick % clock); 273 next_tick += phase; |
|
269 270 while (next_tick < curTick) 271 next_tick += clock; 272 | 274 275 while (next_tick < curTick) 276 next_tick += clock; 277 |
273 next_tick -= (next_tick % clock); | |
274 assert(next_tick >= curTick); 275 return next_tick; 276} 277 278void 279BaseCPU::registerThreadContexts() 280{ 281 for (int i = 0; i < threadContexts.size(); ++i) { --- 142 unchanged lines hidden --- | 278 assert(next_tick >= curTick); 279 return next_tick; 280} 281 282void 283BaseCPU::registerThreadContexts() 284{ 285 for (int i = 0; i < threadContexts.size(); ++i) { --- 142 unchanged lines hidden --- |