fetch_impl.hh (12749:223c83ed9979) fetch_impl.hh (13429:a1e199fd8122)
1/*
2 * Copyright (c) 2010-2014 ARM Limited
3 * Copyright (c) 2012-2013 AMD
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

541 if (thread_it != priorityList.end()) {
542 priorityList.erase(thread_it);
543 }
544}
545
546template <class Impl>
547bool
548DefaultFetch<Impl>::lookupAndUpdateNextPC(
1/*
2 * Copyright (c) 2010-2014 ARM Limited
3 * Copyright (c) 2012-2013 AMD
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

541 if (thread_it != priorityList.end()) {
542 priorityList.erase(thread_it);
543 }
544}
545
546template <class Impl>
547bool
548DefaultFetch<Impl>::lookupAndUpdateNextPC(
549 DynInstPtr &inst, TheISA::PCState &nextPC)
549 const DynInstPtr &inst, TheISA::PCState &nextPC)
550{
551 // Do branch prediction check here.
552 // A bit of a misnomer...next_PC is actually the current PC until
553 // this function updates it.
554 bool predict_taken;
555
556 if (!inst->isControl()) {
557 TheISA::advancePC(nextPC, inst->staticInst);

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

948
949 // Pick a random thread to start trying to grab instructions from
950 auto tid_itr = activeThreads->begin();
951 std::advance(tid_itr, random_mt.random<uint8_t>(0, activeThreads->size() - 1));
952
953 while (available_insts != 0 && insts_to_decode < decodeWidth) {
954 ThreadID tid = *tid_itr;
955 if (!stalls[tid].decode && !fetchQueue[tid].empty()) {
550{
551 // Do branch prediction check here.
552 // A bit of a misnomer...next_PC is actually the current PC until
553 // this function updates it.
554 bool predict_taken;
555
556 if (!inst->isControl()) {
557 TheISA::advancePC(nextPC, inst->staticInst);

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

948
949 // Pick a random thread to start trying to grab instructions from
950 auto tid_itr = activeThreads->begin();
951 std::advance(tid_itr, random_mt.random<uint8_t>(0, activeThreads->size() - 1));
952
953 while (available_insts != 0 && insts_to_decode < decodeWidth) {
954 ThreadID tid = *tid_itr;
955 if (!stalls[tid].decode && !fetchQueue[tid].empty()) {
956 auto inst = fetchQueue[tid].front();
956 const auto& inst = fetchQueue[tid].front();
957 toDecode->insts[toDecode->size++] = inst;
958 DPRINTF(Fetch, "[tid:%i][sn:%i]: Sending instruction to decode from "
959 "fetch queue. Fetch queue size: %i.\n",
960 tid, inst->seqNum, fetchQueue[tid].size());
961
962 wroteToTimeBuffer = true;
963 fetchQueue[tid].pop_front();
964 insts_to_decode++;

--- 712 unchanged lines hidden ---
957 toDecode->insts[toDecode->size++] = inst;
958 DPRINTF(Fetch, "[tid:%i][sn:%i]: Sending instruction to decode from "
959 "fetch queue. Fetch queue size: %i.\n",
960 tid, inst->seqNum, fetchQueue[tid].size());
961
962 wroteToTimeBuffer = true;
963 fetchQueue[tid].pop_front();
964 insts_to_decode++;

--- 712 unchanged lines hidden ---