#include <BTB.h>
Onikiri::BTBに対する継承グラフ
Public メソッド | |
BTB () | |
void | Initialize (InitPhase phase) |
BTBPredict | Predict (const PC &pc) |
void | Update (const OpIterator &op, const BTBPredict &predict) |
virtual | ~BTB () |
BTB::BTB | ( | ) |
BTB::~BTB | ( | ) | [virtual] |
参照先 Onikiri::PhysicalResourceNode::ReleaseParam().
00056 { 00057 if(m_table != 0) 00058 delete m_table; 00059 00060 m_numEntries = (1 << m_numEntryBits); // entry count 00061 ReleaseParam(); 00062 }
関数の呼び出しグラフ:
void BTB::Initialize | ( | InitPhase | phase | ) |
参照先 Onikiri::PhysicalResourceNode::INIT_PRE_CONNECTION・Onikiri::ParamExchange::LoadParam().
00065 { 00066 if(phase == INIT_PRE_CONNECTION){ 00067 LoadParam(); 00068 m_table = 00069 new SetAssocTableType( HasherType(m_numEntryBits), m_numWays); 00070 } 00071 }
関数の呼び出しグラフ:
BTBPredict BTB::Predict | ( | const PC & | pc | ) |
参照先 Onikiri::Addr::address・Onikiri::BT_NON・shttl::setassoc_table< PairType, Hasher, Replacer, Strage >::end()・Onikiri::BTBPredict::hit・shttl::setassoc_table< PairType, Hasher, Replacer, Strage >::read().
参照元 Onikiri::BPred::Predict().
00075 { 00076 BTBPredict pred = {pc, pc, BT_NON ,false}; 00077 ++m_numPred; 00078 00079 // BTBPredict::hit is determined by a result of reading the table. 00080 // Cannot use a result of reading the table. 00081 pred.hit = m_table->read( pc.address, &pred ) != m_table->end(); 00082 if( pred.hit ){ 00083 m_numTableHit++; 00084 } 00085 else{ 00086 m_numTableMiss++; 00087 } 00088 00089 return pred; 00090 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void BTB::Update | ( | const OpIterator & | op, | |
const BTBPredict & | predict | |||
) |
参照先 Onikiri::Addr::address・ASSERT・Onikiri::BT_NON・Onikiri::BTBPredict::dirPredict・Onikiri::BTBPredict::hit・Onikiri::OpClass::IsConditionalBranch()・Onikiri::BranchTypeUtility::OpClassToBranchType()・Onikiri::BTBPredict::predIndexPC・Onikiri::BTBPredict::target・Onikiri::BTBPredict::type・shttl::setassoc_table< PairType, Hasher, Replacer, Strage >::write().
00094 { 00095 if(!op->GetTaken()) 00096 return; 00097 00098 00099 const OpClass& opClass = op->GetOpClass(); 00100 bool conditinal = opClass.IsConditionalBranch(); 00101 BranchTypeUtility util; 00102 00103 // Branch result 00104 BTBPredict result; 00105 result.predIndexPC = predict.predIndexPC; 00106 result.hit = true; 00107 result.target = op->GetTakenPC(); 00108 result.dirPredict = conditinal; 00109 result.type = util.OpClassToBranchType( opClass ); 00110 00111 ASSERT( result.type != BT_NON, "BTB must be updated by branch op." ); 00112 00113 // 00114 // Update table if 'op' is branch and branch is taken. 00115 // (Unconditional branch is always 'taken'. 00116 // 00117 m_table->write(result.predIndexPC.address, result); 00118 ++m_numUpdate; 00119 00120 // 00121 // BTB hit rate calculated from : 00122 // total : count of updating BTB 00123 // hit : count of predicting correct target address 00124 // 00125 if(predict.hit && result.target == predict.target) 00126 ++m_numHit; 00127 else 00128 ++m_numMiss; 00129 00130 }
関数の呼び出しグラフ:
Here is the caller graph for this function: