fetch.hh revision 8503:479b186a4652
110695SAli.Saidi@ARM.com/* 210695SAli.Saidi@ARM.com * Copyright (c) 2010 ARM Limited 310695SAli.Saidi@ARM.com * All rights reserved 410695SAli.Saidi@ARM.com * 510695SAli.Saidi@ARM.com * The license below extends only to copyright in the software and shall 610695SAli.Saidi@ARM.com * not be construed as granting a license to any other intellectual 710695SAli.Saidi@ARM.com * property including but not limited to intellectual property relating 810695SAli.Saidi@ARM.com * to a hardware implementation of the functionality of the software 910695SAli.Saidi@ARM.com * licensed hereunder. You may use the software subject to the license 1010695SAli.Saidi@ARM.com * terms below provided that you ensure that this notice is replicated 1110695SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software, 1210695SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form. 1310695SAli.Saidi@ARM.com * 1410695SAli.Saidi@ARM.com * Copyright (c) 2004-2006 The Regents of The University of Michigan 1510695SAli.Saidi@ARM.com * All rights reserved. 1610695SAli.Saidi@ARM.com * 1710695SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without 1810695SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are 1910695SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright 2010695SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer; 2110695SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright 2210695SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the 2310695SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution; 2410695SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its 2510695SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from 2610695SAli.Saidi@ARM.com * this software without specific prior written permission. 2710695SAli.Saidi@ARM.com * 2810695SAli.Saidi@ARM.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2910695SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3010695SAli.Saidi@ARM.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3110695SAli.Saidi@ARM.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3210695SAli.Saidi@ARM.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3310695SAli.Saidi@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3410695SAli.Saidi@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3510695SAli.Saidi@ARM.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3610695SAli.Saidi@ARM.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3710695SAli.Saidi@ARM.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3810695SAli.Saidi@ARM.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3910695SAli.Saidi@ARM.com * 4010695SAli.Saidi@ARM.com * Authors: Kevin Lim 4110695SAli.Saidi@ARM.com * Korey Sewell 4210695SAli.Saidi@ARM.com */ 4310695SAli.Saidi@ARM.com 4410695SAli.Saidi@ARM.com#ifndef __CPU_O3_FETCH_HH__ 4510695SAli.Saidi@ARM.com#define __CPU_O3_FETCH_HH__ 4610695SAli.Saidi@ARM.com 4710695SAli.Saidi@ARM.com#include "arch/predecoder.hh" 4810695SAli.Saidi@ARM.com#include "arch/utility.hh" 4910695SAli.Saidi@ARM.com#include "base/statistics.hh" 5010695SAli.Saidi@ARM.com#include "config/the_isa.hh" 5110695SAli.Saidi@ARM.com#include "cpu/pc_event.hh" 5210695SAli.Saidi@ARM.com#include "cpu/timebuf.hh" 5310695SAli.Saidi@ARM.com#include "cpu/translation.hh" 5410695SAli.Saidi@ARM.com#include "mem/packet.hh" 5510695SAli.Saidi@ARM.com#include "mem/port.hh" 5610695SAli.Saidi@ARM.com#include "sim/eventq.hh" 5710695SAli.Saidi@ARM.com 5810695SAli.Saidi@ARM.comclass DerivO3CPUParams; 5910695SAli.Saidi@ARM.com 6010695SAli.Saidi@ARM.com/** 6110695SAli.Saidi@ARM.com * DefaultFetch class handles both single threaded and SMT fetch. Its 6210695SAli.Saidi@ARM.com * width is specified by the parameters; each cycle it tries to fetch 6310695SAli.Saidi@ARM.com * that many instructions. It supports using a branch predictor to 6410695SAli.Saidi@ARM.com * predict direction and targets. 6510695SAli.Saidi@ARM.com * It supports the idling functionality of the CPU by indicating to 6610695SAli.Saidi@ARM.com * the CPU when it is active and inactive. 6710695SAli.Saidi@ARM.com */ 6810695SAli.Saidi@ARM.comtemplate <class Impl> 6910695SAli.Saidi@ARM.comclass DefaultFetch 7010695SAli.Saidi@ARM.com{ 7110695SAli.Saidi@ARM.com public: 7210695SAli.Saidi@ARM.com /** Typedefs from Impl. */ 7310695SAli.Saidi@ARM.com typedef typename Impl::CPUPol CPUPol; 7410695SAli.Saidi@ARM.com typedef typename Impl::DynInst DynInst; 7510695SAli.Saidi@ARM.com typedef typename Impl::DynInstPtr DynInstPtr; 7610695SAli.Saidi@ARM.com typedef typename Impl::O3CPU O3CPU; 7710695SAli.Saidi@ARM.com 7811168Sandreas.hansson@arm.com /** Typedefs from the CPU policy. */ 7910695SAli.Saidi@ARM.com typedef typename CPUPol::BPredUnit BPredUnit; 8010695SAli.Saidi@ARM.com typedef typename CPUPol::FetchStruct FetchStruct; 8110695SAli.Saidi@ARM.com typedef typename CPUPol::TimeStruct TimeStruct; 8210695SAli.Saidi@ARM.com 8310695SAli.Saidi@ARM.com /** Typedefs from ISA. */ 8410695SAli.Saidi@ARM.com typedef TheISA::MachInst MachInst; 8510761Sandreas.hansson@arm.com typedef TheISA::ExtMachInst ExtMachInst; 8610695SAli.Saidi@ARM.com 8710695SAli.Saidi@ARM.com /** IcachePort class for DefaultFetch. Handles doing the 8810695SAli.Saidi@ARM.com * communication with the cache/memory. 8910695SAli.Saidi@ARM.com */ 9010695SAli.Saidi@ARM.com class IcachePort : public Port 9110695SAli.Saidi@ARM.com { 9210695SAli.Saidi@ARM.com protected: 9311168Sandreas.hansson@arm.com /** Pointer to fetch. */ 9410695SAli.Saidi@ARM.com DefaultFetch<Impl> *fetch; 9510695SAli.Saidi@ARM.com 9610695SAli.Saidi@ARM.com public: 9710695SAli.Saidi@ARM.com /** Default constructor. */ 9810695SAli.Saidi@ARM.com IcachePort(DefaultFetch<Impl> *_fetch) 9910695SAli.Saidi@ARM.com : Port(_fetch->name() + "-iport", _fetch->cpu), fetch(_fetch) 10010695SAli.Saidi@ARM.com { } 10110695SAli.Saidi@ARM.com 10210695SAli.Saidi@ARM.com bool snoopRangeSent; 10310695SAli.Saidi@ARM.com 10410695SAli.Saidi@ARM.com virtual void setPeer(Port *port); 10510695SAli.Saidi@ARM.com 10610695SAli.Saidi@ARM.com protected: 10710695SAli.Saidi@ARM.com /** Atomic version of receive. Panics. */ 10810695SAli.Saidi@ARM.com virtual Tick recvAtomic(PacketPtr pkt); 10910695SAli.Saidi@ARM.com 11010695SAli.Saidi@ARM.com /** Functional version of receive. Panics. */ 11110695SAli.Saidi@ARM.com virtual void recvFunctional(PacketPtr pkt); 11210695SAli.Saidi@ARM.com 11310695SAli.Saidi@ARM.com /** Receives status change. Other than range changing, panics. */ 11410695SAli.Saidi@ARM.com virtual void recvStatusChange(Status status); 11510695SAli.Saidi@ARM.com 11610695SAli.Saidi@ARM.com /** Returns the address ranges of this device. */ 11710695SAli.Saidi@ARM.com virtual void getDeviceAddressRanges(AddrRangeList &resp, 11810695SAli.Saidi@ARM.com bool &snoop) 11910695SAli.Saidi@ARM.com { resp.clear(); snoop = true; } 12010695SAli.Saidi@ARM.com 12110695SAli.Saidi@ARM.com /** Timing version of receive. Handles setting fetch to the 12210695SAli.Saidi@ARM.com * proper status to start fetching. */ 12310695SAli.Saidi@ARM.com virtual bool recvTiming(PacketPtr pkt); 12410695SAli.Saidi@ARM.com 12510695SAli.Saidi@ARM.com /** Handles doing a retry of a failed fetch. */ 12610695SAli.Saidi@ARM.com virtual void recvRetry(); 12710695SAli.Saidi@ARM.com }; 12810695SAli.Saidi@ARM.com 12910695SAli.Saidi@ARM.com class FetchTranslation : public BaseTLB::Translation 13010695SAli.Saidi@ARM.com { 13110695SAli.Saidi@ARM.com protected: 13210695SAli.Saidi@ARM.com DefaultFetch<Impl> *fetch; 13310695SAli.Saidi@ARM.com 13410695SAli.Saidi@ARM.com public: 13510695SAli.Saidi@ARM.com FetchTranslation(DefaultFetch<Impl> *_fetch) 136 : fetch(_fetch) 137 {} 138 139 void 140 markDelayed() 141 {} 142 143 void 144 finish(Fault fault, RequestPtr req, ThreadContext *tc, 145 BaseTLB::Mode mode) 146 { 147 assert(mode == BaseTLB::Execute); 148 fetch->finishTranslation(fault, req); 149 delete this; 150 } 151 }; 152 153 private: 154 /* Event to delay delivery of a fetch translation result in case of 155 * a fault and the nop to carry the fault cannot be generated 156 * immediately */ 157 class FinishTranslationEvent : public Event 158 { 159 private: 160 DefaultFetch<Impl> *fetch; 161 Fault fault; 162 RequestPtr req; 163 164 public: 165 FinishTranslationEvent(DefaultFetch<Impl> *_fetch) 166 : fetch(_fetch) 167 {} 168 169 void setFault(Fault _fault) 170 { 171 fault = _fault; 172 } 173 174 void setReq(RequestPtr _req) 175 { 176 req = _req; 177 } 178 179 /** Process the delayed finish translation */ 180 void process() 181 { 182 assert(fetch->numInst < fetch->fetchWidth); 183 fetch->finishTranslation(fault, req); 184 } 185 186 const char *description() const 187 { 188 return "FullO3CPU FetchFinishTranslation"; 189 } 190 }; 191 192 public: 193 /** Overall fetch status. Used to determine if the CPU can 194 * deschedule itsef due to a lack of activity. 195 */ 196 enum FetchStatus { 197 Active, 198 Inactive 199 }; 200 201 /** Individual thread status. */ 202 enum ThreadStatus { 203 Running, 204 Idle, 205 Squashing, 206 Blocked, 207 Fetching, 208 TrapPending, 209 QuiescePending, 210 SwitchOut, 211 ItlbWait, 212 IcacheWaitResponse, 213 IcacheWaitRetry, 214 IcacheAccessComplete, 215 NoGoodAddr 216 }; 217 218 /** Fetching Policy, Add new policies here.*/ 219 enum FetchPriority { 220 SingleThread, 221 RoundRobin, 222 Branch, 223 IQ, 224 LSQ 225 }; 226 227 private: 228 /** Fetch status. */ 229 FetchStatus _status; 230 231 /** Per-thread status. */ 232 ThreadStatus fetchStatus[Impl::MaxThreads]; 233 234 /** Fetch policy. */ 235 FetchPriority fetchPolicy; 236 237 /** List that has the threads organized by priority. */ 238 std::list<ThreadID> priorityList; 239 240 public: 241 /** DefaultFetch constructor. */ 242 DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params); 243 244 /** Returns the name of fetch. */ 245 std::string name() const; 246 247 /** Registers statistics. */ 248 void regStats(); 249 250 /** Returns the icache port. */ 251 Port *getIcachePort() { return icachePort; } 252 253 /** Sets the main backwards communication time buffer pointer. */ 254 void setTimeBuffer(TimeBuffer<TimeStruct> *time_buffer); 255 256 /** Sets pointer to list of active threads. */ 257 void setActiveThreads(std::list<ThreadID> *at_ptr); 258 259 /** Sets pointer to time buffer used to communicate to the next stage. */ 260 void setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr); 261 262 /** Initialize stage. */ 263 void initStage(); 264 265 /** Tells the fetch stage that the Icache is set. */ 266 void setIcache(); 267 268 /** Processes cache completion event. */ 269 void processCacheCompletion(PacketPtr pkt); 270 271 /** Begins the drain of the fetch stage. */ 272 bool drain(); 273 274 /** Resumes execution after a drain. */ 275 void resume(); 276 277 /** Tells fetch stage to prepare to be switched out. */ 278 void switchOut(); 279 280 /** Takes over from another CPU's thread. */ 281 void takeOverFrom(); 282 283 /** Checks if the fetch stage is switched out. */ 284 bool isSwitchedOut() { return switchedOut; } 285 286 /** Tells fetch to wake up from a quiesce instruction. */ 287 void wakeFromQuiesce(); 288 289 private: 290 /** Changes the status of this stage to active, and indicates this 291 * to the CPU. 292 */ 293 inline void switchToActive(); 294 295 /** Changes the status of this stage to inactive, and indicates 296 * this to the CPU. 297 */ 298 inline void switchToInactive(); 299 300 /** 301 * Looks up in the branch predictor to see if the next PC should be 302 * either next PC+=MachInst or a branch target. 303 * @param next_PC Next PC variable passed in by reference. It is 304 * expected to be set to the current PC; it will be updated with what 305 * the next PC will be. 306 * @param next_NPC Used for ISAs which use delay slots. 307 * @return Whether or not a branch was predicted as taken. 308 */ 309 bool lookupAndUpdateNextPC(DynInstPtr &inst, TheISA::PCState &pc); 310 311 /** 312 * Fetches the cache line that contains fetch_PC. Returns any 313 * fault that happened. Puts the data into the class variable 314 * cacheData. 315 * @param vaddr The memory address that is being fetched from. 316 * @param ret_fault The fault reference that will be set to the result of 317 * the icache access. 318 * @param tid Thread id. 319 * @param pc The actual PC of the current instruction. 320 * @return Any fault that occured. 321 */ 322 bool fetchCacheLine(Addr vaddr, ThreadID tid, Addr pc); 323 void finishTranslation(Fault fault, RequestPtr mem_req); 324 325 326 /** Check if an interrupt is pending and that we need to handle 327 */ 328 bool 329 checkInterrupt(Addr pc) 330 { 331 return (interruptPending && (THE_ISA != ALPHA_ISA || !(pc & 0x3))); 332 } 333 334 /** Squashes a specific thread and resets the PC. */ 335 inline void doSquash(const TheISA::PCState &newPC, 336 const DynInstPtr squashInst, ThreadID tid); 337 338 /** Squashes a specific thread and resets the PC. Also tells the CPU to 339 * remove any instructions between fetch and decode that should be sqaushed. 340 */ 341 void squashFromDecode(const TheISA::PCState &newPC, 342 const DynInstPtr squashInst, 343 const InstSeqNum seq_num, ThreadID tid); 344 345 /** Checks if a thread is stalled. */ 346 bool checkStall(ThreadID tid) const; 347 348 /** Updates overall fetch stage status; to be called at the end of each 349 * cycle. */ 350 FetchStatus updateFetchStatus(); 351 352 public: 353 /** Squashes a specific thread and resets the PC. Also tells the CPU to 354 * remove any instructions that are not in the ROB. The source of this 355 * squash should be the commit stage. 356 */ 357 void squash(const TheISA::PCState &newPC, const InstSeqNum seq_num, 358 DynInstPtr squashInst, ThreadID tid); 359 360 /** Ticks the fetch stage, processing all inputs signals and fetching 361 * as many instructions as possible. 362 */ 363 void tick(); 364 365 /** Checks all input signals and updates the status as necessary. 366 * @return: Returns if the status has changed due to input signals. 367 */ 368 bool checkSignalsAndUpdate(ThreadID tid); 369 370 /** Does the actual fetching of instructions and passing them on to the 371 * next stage. 372 * @param status_change fetch() sets this variable if there was a status 373 * change (ie switching to IcacheMissStall). 374 */ 375 void fetch(bool &status_change); 376 377 /** Align a PC to the start of an I-cache block. */ 378 Addr icacheBlockAlignPC(Addr addr) 379 { 380 return (addr & ~(cacheBlkMask)); 381 } 382 383 private: 384 DynInstPtr buildInst(ThreadID tid, StaticInstPtr staticInst, 385 StaticInstPtr curMacroop, TheISA::PCState thisPC, 386 TheISA::PCState nextPC, bool trace); 387 388 /** Handles retrying the fetch access. */ 389 void recvRetry(); 390 391 /** Returns the appropriate thread to fetch, given the fetch policy. */ 392 ThreadID getFetchingThread(FetchPriority &fetch_priority); 393 394 /** Returns the appropriate thread to fetch using a round robin policy. */ 395 ThreadID roundRobin(); 396 397 /** Returns the appropriate thread to fetch using the IQ count policy. */ 398 ThreadID iqCount(); 399 400 /** Returns the appropriate thread to fetch using the LSQ count policy. */ 401 ThreadID lsqCount(); 402 403 /** Returns the appropriate thread to fetch using the branch count 404 * policy. */ 405 ThreadID branchCount(); 406 407 /** Pipeline the next I-cache access to the current one. */ 408 void pipelineIcacheAccesses(ThreadID tid); 409 410 /** Profile the reasons of fetch stall. */ 411 void profileStall(ThreadID tid); 412 413 private: 414 /** Pointer to the O3CPU. */ 415 O3CPU *cpu; 416 417 /** Time buffer interface. */ 418 TimeBuffer<TimeStruct> *timeBuffer; 419 420 /** Wire to get decode's information from backwards time buffer. */ 421 typename TimeBuffer<TimeStruct>::wire fromDecode; 422 423 /** Wire to get rename's information from backwards time buffer. */ 424 typename TimeBuffer<TimeStruct>::wire fromRename; 425 426 /** Wire to get iew's information from backwards time buffer. */ 427 typename TimeBuffer<TimeStruct>::wire fromIEW; 428 429 /** Wire to get commit's information from backwards time buffer. */ 430 typename TimeBuffer<TimeStruct>::wire fromCommit; 431 432 /** Internal fetch instruction queue. */ 433 TimeBuffer<FetchStruct> *fetchQueue; 434 435 //Might be annoying how this name is different than the queue. 436 /** Wire used to write any information heading to decode. */ 437 typename TimeBuffer<FetchStruct>::wire toDecode; 438 439 /** Icache interface. */ 440 IcachePort *icachePort; 441 442 /** BPredUnit. */ 443 BPredUnit branchPred; 444 445 /** Predecoder. */ 446 TheISA::Predecoder predecoder; 447 448 TheISA::PCState pc[Impl::MaxThreads]; 449 450 Addr fetchOffset[Impl::MaxThreads]; 451 452 StaticInstPtr macroop[Impl::MaxThreads]; 453 454 /** Can the fetch stage redirect from an interrupt on this instruction? */ 455 bool delayedCommit[Impl::MaxThreads]; 456 457 /** Memory request used to access cache. */ 458 RequestPtr memReq[Impl::MaxThreads]; 459 460 /** Variable that tracks if fetch has written to the time buffer this 461 * cycle. Used to tell CPU if there is activity this cycle. 462 */ 463 bool wroteToTimeBuffer; 464 465 /** Tracks how many instructions has been fetched this cycle. */ 466 int numInst; 467 468 /** Source of possible stalls. */ 469 struct Stalls { 470 bool decode; 471 bool rename; 472 bool iew; 473 bool commit; 474 }; 475 476 /** Tracks which stages are telling fetch to stall. */ 477 Stalls stalls[Impl::MaxThreads]; 478 479 /** Decode to fetch delay, in ticks. */ 480 unsigned decodeToFetchDelay; 481 482 /** Rename to fetch delay, in ticks. */ 483 unsigned renameToFetchDelay; 484 485 /** IEW to fetch delay, in ticks. */ 486 unsigned iewToFetchDelay; 487 488 /** Commit to fetch delay, in ticks. */ 489 unsigned commitToFetchDelay; 490 491 /** The width of fetch in instructions. */ 492 unsigned fetchWidth; 493 494 /** Is the cache blocked? If so no threads can access it. */ 495 bool cacheBlocked; 496 497 /** The packet that is waiting to be retried. */ 498 PacketPtr retryPkt; 499 500 /** The thread that is waiting on the cache to tell fetch to retry. */ 501 ThreadID retryTid; 502 503 /** Cache block size. */ 504 int cacheBlkSize; 505 506 /** Mask to get a cache block's address. */ 507 Addr cacheBlkMask; 508 509 /** The cache line being fetched. */ 510 uint8_t *cacheData[Impl::MaxThreads]; 511 512 /** The PC of the cacheline that has been loaded. */ 513 Addr cacheDataPC[Impl::MaxThreads]; 514 515 /** Whether or not the cache data is valid. */ 516 bool cacheDataValid[Impl::MaxThreads]; 517 518 /** Size of instructions. */ 519 int instSize; 520 521 /** Icache stall statistics. */ 522 Counter lastIcacheStall[Impl::MaxThreads]; 523 524 /** List of Active Threads */ 525 std::list<ThreadID> *activeThreads; 526 527 /** Number of threads. */ 528 ThreadID numThreads; 529 530 /** Number of threads that are actively fetching. */ 531 ThreadID numFetchingThreads; 532 533 /** Thread ID being fetched. */ 534 ThreadID threadFetched; 535 536 /** Checks if there is an interrupt pending. If there is, fetch 537 * must stop once it is not fetching PAL instructions. 538 */ 539 bool interruptPending; 540 541 /** Is there a drain pending. */ 542 bool drainPending; 543 544 /** Records if fetch is switched out. */ 545 bool switchedOut; 546 547 /** Set to true if a pipelined I-cache request should be issued. */ 548 bool issuePipelinedIfetch[Impl::MaxThreads]; 549 550 /** Event used to delay fault generation of translation faults */ 551 FinishTranslationEvent finishTranslationEvent; 552 553 // @todo: Consider making these vectors and tracking on a per thread basis. 554 /** Stat for total number of cycles stalled due to an icache miss. */ 555 Stats::Scalar icacheStallCycles; 556 /** Stat for total number of fetched instructions. */ 557 Stats::Scalar fetchedInsts; 558 /** Total number of fetched branches. */ 559 Stats::Scalar fetchedBranches; 560 /** Stat for total number of predicted branches. */ 561 Stats::Scalar predictedBranches; 562 /** Stat for total number of cycles spent fetching. */ 563 Stats::Scalar fetchCycles; 564 /** Stat for total number of cycles spent squashing. */ 565 Stats::Scalar fetchSquashCycles; 566 /** Stat for total number of cycles spent waiting for translation */ 567 Stats::Scalar fetchTlbCycles; 568 /** Stat for total number of cycles spent blocked due to other stages in 569 * the pipeline. 570 */ 571 Stats::Scalar fetchIdleCycles; 572 /** Total number of cycles spent blocked. */ 573 Stats::Scalar fetchBlockedCycles; 574 /** Total number of cycles spent in any other state. */ 575 Stats::Scalar fetchMiscStallCycles; 576 /** Total number of cycles spent in waiting for drains. */ 577 Stats::Scalar fetchPendingDrainCycles; 578 /** Total number of stall cycles caused by no active threads to run. */ 579 Stats::Scalar fetchNoActiveThreadStallCycles; 580 /** Total number of stall cycles caused by pending traps. */ 581 Stats::Scalar fetchPendingTrapStallCycles; 582 /** Total number of stall cycles caused by pending quiesce instructions. */ 583 Stats::Scalar fetchPendingQuiesceStallCycles; 584 /** Total number of stall cycles caused by I-cache wait retrys. */ 585 Stats::Scalar fetchIcacheWaitRetryStallCycles; 586 /** Stat for total number of fetched cache lines. */ 587 Stats::Scalar fetchedCacheLines; 588 /** Total number of outstanding icache accesses that were dropped 589 * due to a squash. 590 */ 591 Stats::Scalar fetchIcacheSquashes; 592 /** Total number of outstanding tlb accesses that were dropped 593 * due to a squash. 594 */ 595 Stats::Scalar fetchTlbSquashes; 596 /** Distribution of number of instructions fetched each cycle. */ 597 Stats::Distribution fetchNisnDist; 598 /** Rate of how often fetch was idle. */ 599 Stats::Formula idleRate; 600 /** Number of branch fetches per cycle. */ 601 Stats::Formula branchRate; 602 /** Number of instruction fetched per cycle. */ 603 Stats::Formula fetchRate; 604}; 605 606#endif //__CPU_O3_FETCH_HH__ 607