1/* 2 * Copyright (c) 2004-2005 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; --- 33 unchanged lines hidden (view full) --- 42 DPRINTF(Fetch, "BTB: Creating BTB object.\n"); 43 44 if (!isPowerOf2(numEntries)) { 45 fatal("BTB entries is not a power of 2!"); 46 } 47 48 btb.resize(numEntries); 49 |
50 for (unsigned i = 0; i < numEntries; ++i) { |
51 btb[i].valid = false; 52 } 53 54 idxMask = numEntries - 1; 55 56 tagMask = (1 << tagBits) - 1; 57 58 tagShiftAmt = instShiftAmt + floorLog2(numEntries); 59} 60 61void 62DefaultBTB::reset() 63{ |
64 for (unsigned i = 0; i < numEntries; ++i) { |
65 btb[i].valid = false; 66 } 67} 68 69inline 70unsigned 71DefaultBTB::getIndex(const Addr &inst_PC) 72{ --- 62 unchanged lines hidden --- |