1/* |
2 * Copyright (c) 2010-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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 38 unchanged lines hidden (view full) --- 49#include "arch/utility.hh" 50#include "config/the_isa.hh" 51#include "cpu/checker/cpu.hh" 52#include "cpu/o3/fu_pool.hh" 53#include "cpu/o3/iew.hh" 54#include "cpu/timebuf.hh" 55#include "debug/Activity.hh" 56#include "debug/Decode.hh" |
57#include "debug/Drain.hh" |
58#include "debug/IEW.hh" 59#include "params/DerivO3CPU.hh" 60 61using namespace std; 62 63template<class Impl> 64DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params) 65 : issueToExecQueue(params->backComSize, params->forwardComSize), 66 cpu(_cpu), 67 instQueue(_cpu, this, params), 68 ldstQueue(_cpu, this, params), 69 fuPool(params->fuPool), 70 commitToIEWDelay(params->commitToIEWDelay), 71 renameToIEWDelay(params->renameToIEWDelay), 72 issueToExecuteDelay(params->issueToExecuteDelay), 73 dispatchWidth(params->dispatchWidth), 74 issueWidth(params->issueWidth), 75 wbOutstanding(0), 76 wbWidth(params->wbWidth), |
77 numThreads(params->numThreads) |
78{ 79 _status = Active; 80 exeStatus = Running; 81 wbStatus = Idle; 82 83 // Setup wire to read instructions coming from issue. 84 fromIssue = issueToExecQueue.getWire(-issueToExecuteDelay); 85 --- 269 unchanged lines hidden (view full) --- 355void 356DefaultIEW<Impl>::setScoreboard(Scoreboard *sb_ptr) 357{ 358 scoreboard = sb_ptr; 359} 360 361template <class Impl> 362bool |
363DefaultIEW<Impl>::isDrained() const |
364{ |
365 bool drained(ldstQueue.isDrained()); |
366 |
367 for (ThreadID tid = 0; tid < numThreads; tid++) { 368 if (!insts[tid].empty()) { 369 DPRINTF(Drain, "%i: Insts not empty.\n", tid); 370 drained = false; 371 } 372 if (!skidBuffer[tid].empty()) { 373 DPRINTF(Drain, "%i: Skid buffer not empty.\n", tid); 374 drained = false; 375 } 376 } 377 378 return drained; |
379} 380 381template <class Impl> 382void |
383DefaultIEW<Impl>::drainSanityCheck() const |
384{ |
385 assert(isDrained()); |
386 |
387 instQueue.drainSanityCheck(); 388 ldstQueue.drainSanityCheck(); 389 fuPool->drainSanityCheck(); |
390} 391 392template <class Impl> 393void 394DefaultIEW<Impl>::takeOverFrom() 395{ 396 // Reset all state. 397 _status = Active; 398 exeStatus = Running; 399 wbStatus = Idle; |
400 401 instQueue.takeOverFrom(); 402 ldstQueue.takeOverFrom(); |
403 fuPool->takeOverFrom(); |
404 405 startupStage(); 406 cpu->activityThisCycle(); 407 408 for (ThreadID tid = 0; tid < numThreads; tid++) { 409 dispatchStatus[tid] = Running; 410 stalls[tid].commit = false; 411 fetchRedirect[tid] = false; --- 1253 unchanged lines hidden --- |