btb.hh (11425:e24d92c62860) | btb.hh (11429:cf5af0cc3be4) |
---|---|
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; --- 52 unchanged lines hidden (view full) --- 61 public: 62 /** Creates a BTB with the given number of entries, number of bits per 63 * tag, and instruction offset amount. 64 * @param numEntries Number of entries for the BTB. 65 * @param tagBits Number of bits for each tag in the BTB. 66 * @param instShiftAmt Offset amount for instructions to ignore alignment. 67 */ 68 DefaultBTB(unsigned numEntries, unsigned tagBits, | 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; --- 52 unchanged lines hidden (view full) --- 61 public: 62 /** Creates a BTB with the given number of entries, number of bits per 63 * tag, and instruction offset amount. 64 * @param numEntries Number of entries for the BTB. 65 * @param tagBits Number of bits for each tag in the BTB. 66 * @param instShiftAmt Offset amount for instructions to ignore alignment. 67 */ 68 DefaultBTB(unsigned numEntries, unsigned tagBits, |
69 unsigned instShiftAmt, unsigned numThreads); | 69 unsigned instShiftAmt); |
70 71 void reset(); 72 73 /** Looks up an address in the BTB. Must call valid() first on the address. 74 * @param inst_PC The address of the branch to look up. 75 * @param tid The thread id. 76 * @return Returns the target of the branch. 77 */ --- 14 unchanged lines hidden (view full) --- 92 void update(Addr instPC, const TheISA::PCState &targetPC, 93 ThreadID tid); 94 95 private: 96 /** Returns the index into the BTB, based on the branch's PC. 97 * @param inst_PC The branch to look up. 98 * @return Returns the index into the BTB. 99 */ | 70 71 void reset(); 72 73 /** Looks up an address in the BTB. Must call valid() first on the address. 74 * @param inst_PC The address of the branch to look up. 75 * @param tid The thread id. 76 * @return Returns the target of the branch. 77 */ --- 14 unchanged lines hidden (view full) --- 92 void update(Addr instPC, const TheISA::PCState &targetPC, 93 ThreadID tid); 94 95 private: 96 /** Returns the index into the BTB, based on the branch's PC. 97 * @param inst_PC The branch to look up. 98 * @return Returns the index into the BTB. 99 */ |
100 inline unsigned getIndex(Addr instPC, ThreadID tid); | 100 inline unsigned getIndex(Addr instPC); |
101 102 /** Returns the tag bits of a given address. 103 * @param inst_PC The branch's address. 104 * @return Returns the tag bits. 105 */ 106 inline Addr getTag(Addr instPC); 107 108 /** The actual BTB. */ --- 11 unchanged lines hidden (view full) --- 120 /** The tag mask. */ 121 unsigned tagMask; 122 123 /** Number of bits to shift PC when calculating index. */ 124 unsigned instShiftAmt; 125 126 /** Number of bits to shift PC when calculating tag. */ 127 unsigned tagShiftAmt; | 101 102 /** Returns the tag bits of a given address. 103 * @param inst_PC The branch's address. 104 * @return Returns the tag bits. 105 */ 106 inline Addr getTag(Addr instPC); 107 108 /** The actual BTB. */ --- 11 unchanged lines hidden (view full) --- 120 /** The tag mask. */ 121 unsigned tagMask; 122 123 /** Number of bits to shift PC when calculating index. */ 124 unsigned instShiftAmt; 125 126 /** Number of bits to shift PC when calculating tag. */ 127 unsigned tagShiftAmt; |
128 129 /** Log2 NumThreads used for hashing threadid */ 130 unsigned log2NumThreads; | |
131}; 132 133#endif // __CPU_PRED_BTB_HH__ | 128}; 129 130#endif // __CPU_PRED_BTB_HH__ |