base.cc (9294:8fb03b13de02) | base.cc (9332:ae2a5329ce96) |
---|---|
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 --- 104 unchanged lines hidden (view full) --- 113{ 114 return "CPU Progress"; 115} 116 117BaseCPU::BaseCPU(Params *p, bool is_checker) 118 : MemObject(p), instCnt(0), _cpuId(p->cpu_id), 119 _instMasterId(p->system->getMasterId(name() + ".inst")), 120 _dataMasterId(p->system->getMasterId(name() + ".data")), | 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 --- 104 unchanged lines hidden (view full) --- 113{ 114 return "CPU Progress"; 115} 116 117BaseCPU::BaseCPU(Params *p, bool is_checker) 118 : MemObject(p), instCnt(0), _cpuId(p->cpu_id), 119 _instMasterId(p->system->getMasterId(name() + ".inst")), 120 _dataMasterId(p->system->getMasterId(name() + ".data")), |
121 _taskId(ContextSwitchTaskId::Unknown), _pid(Request::invldPid), |
|
121 interrupts(p->interrupts), profileEvent(NULL), 122 numThreads(p->numThreads), system(p->system) 123{ 124 // if Python did not provide a valid ID, do it here 125 if (_cpuId == -1 ) { 126 _cpuId = cpuList.size(); 127 } 128 --- 225 unchanged lines hidden (view full) --- 354 deschedule(profileEvent); 355} 356 357void 358BaseCPU::takeOverFrom(BaseCPU *oldCPU) 359{ 360 assert(threadContexts.size() == oldCPU->threadContexts.size()); 361 assert(_cpuId == oldCPU->cpuId()); | 122 interrupts(p->interrupts), profileEvent(NULL), 123 numThreads(p->numThreads), system(p->system) 124{ 125 // if Python did not provide a valid ID, do it here 126 if (_cpuId == -1 ) { 127 _cpuId = cpuList.size(); 128 } 129 --- 225 unchanged lines hidden (view full) --- 355 deschedule(profileEvent); 356} 357 358void 359BaseCPU::takeOverFrom(BaseCPU *oldCPU) 360{ 361 assert(threadContexts.size() == oldCPU->threadContexts.size()); 362 assert(_cpuId == oldCPU->cpuId()); |
363 _pid = oldCPU->getPid(); 364 _taskId = oldCPU->taskId(); |
|
362 363 ThreadID size = threadContexts.size(); 364 for (ThreadID i = 0; i < size; ++i) { 365 ThreadContext *newTC = threadContexts[i]; 366 ThreadContext *oldTC = oldCPU->threadContexts[i]; 367 368 newTC->takeOverFrom(oldTC); 369 --- 114 unchanged lines hidden (view full) --- 484 485 cpu->schedule(this, curTick() + interval); 486} 487 488void 489BaseCPU::serialize(std::ostream &os) 490{ 491 SERIALIZE_SCALAR(instCnt); | 365 366 ThreadID size = threadContexts.size(); 367 for (ThreadID i = 0; i < size; ++i) { 368 ThreadContext *newTC = threadContexts[i]; 369 ThreadContext *oldTC = oldCPU->threadContexts[i]; 370 371 newTC->takeOverFrom(oldTC); 372 --- 114 unchanged lines hidden (view full) --- 487 488 cpu->schedule(this, curTick() + interval); 489} 490 491void 492BaseCPU::serialize(std::ostream &os) 493{ 494 SERIALIZE_SCALAR(instCnt); |
495 496 /* Unlike _pid, _taskId is not serialized, as they are dynamically 497 * assigned unique ids that are only meaningful for the duration of 498 * a specific run. We will need to serialize the entire taskMap in 499 * system. */ 500 SERIALIZE_SCALAR(_pid); 501 |
|
492 interrupts->serialize(os); 493} 494 495void 496BaseCPU::unserialize(Checkpoint *cp, const std::string §ion) 497{ 498 UNSERIALIZE_SCALAR(instCnt); | 502 interrupts->serialize(os); 503} 504 505void 506BaseCPU::unserialize(Checkpoint *cp, const std::string §ion) 507{ 508 UNSERIALIZE_SCALAR(instCnt); |
509 UNSERIALIZE_SCALAR(_pid); |
|
499 interrupts->unserialize(cp, section); 500} 501 502void 503BaseCPU::traceFunctionsInternal(Addr pc) 504{ 505 if (!debugSymbolTable) 506 return; --- 42 unchanged lines hidden --- | 510 interrupts->unserialize(cp, section); 511} 512 513void 514BaseCPU::traceFunctionsInternal(Addr pc) 515{ 516 if (!debugSymbolTable) 517 return; --- 42 unchanged lines hidden --- |