Deleted Added
sdiff udiff text old ( 2831:0a42b294727c ) new ( 2843:19c4c6c2b5b1 )
full compact
1/*
2 * Copyright (c) 2004-2006 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;

--- 95 unchanged lines hidden (view full) ---

104 commitToFetchDelay(params->commitToFetchDelay),
105 fetchWidth(params->fetchWidth),
106 cacheBlocked(false),
107 retryPkt(NULL),
108 retryTid(-1),
109 numThreads(params->numberOfThreads),
110 numFetchingThreads(params->smtNumFetchingThreads),
111 interruptPending(false),
112 switchedOut(false)
113{
114 if (numThreads > Impl::MaxThreads)
115 fatal("numThreads is not a valid value\n");
116
117 // Set fetch stage's status to inactive.
118 _status = Inactive;
119

--- 228 unchanged lines hidden (view full) ---

348 unsigned tid = pkt->req->getThreadNum();
349
350 DPRINTF(Fetch, "[tid:%u] Waking up from cache miss.\n",tid);
351
352 // Only change the status if it's still waiting on the icache access
353 // to return.
354 if (fetchStatus[tid] != IcacheWaitResponse ||
355 pkt->req != memReq[tid] ||
356 isSwitchedOut()) {
357 ++fetchIcacheSquashes;
358 delete pkt->req;
359 delete pkt;
360 return;
361 }
362
363 // Wake up the CPU (if it went to sleep and was waiting on this completion
364 // event).

--- 14 unchanged lines hidden (view full) ---

379 // Reset the mem req to NULL.
380 delete pkt->req;
381 delete pkt;
382 memReq[tid] = NULL;
383}
384
385template <class Impl>
386void
387DefaultFetch<Impl>::switchOut()
388{
389 // Fetch is ready to switch out at any time.
390 switchedOut = true;
391 cpu->signalSwitched();
392}
393
394template <class Impl>
395void
396DefaultFetch<Impl>::doSwitchOut()
397{
398 // Branch predictor needs to have its state cleared.
399 branchPred.switchOut();
400}
401
402template <class Impl>
403void
404DefaultFetch<Impl>::takeOverFrom()
405{

--- 87 unchanged lines hidden (view full) ---

493
494#if FULL_SYSTEM
495 // Flag to say whether or not address is physical addr.
496 unsigned flags = cpu->inPalMode(fetch_PC) ? PHYSICAL : 0;
497#else
498 unsigned flags = 0;
499#endif // FULL_SYSTEM
500
501 if (cacheBlocked || (interruptPending && flags == 0) || switchedOut) {
502 // Hold off fetch from getting new instructions when:
503 // Cache is blocked, or
504 // while an interrupt is pending and we're not in PAL mode, or
505 // fetch is switched out.
506 return false;
507 }
508
509 // Align the fetch PC so it's at the start of a cache block.

--- 780 unchanged lines hidden ---