クラス Onikiri::BTB

#include <BTB.h>

Onikiri::BTBに対する継承グラフ

Inheritance graph
[凡例]
Onikiri::BTBのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public メソッド

 BTB ()
void Initialize (InitPhase phase)
BTBPredict Predict (const PC &pc)
void Update (const OpIterator &op, const BTBPredict &predict)
virtual ~BTB ()

説明

BTB.h57 行で定義されています。


コンストラクタとデストラクタ

BTB::BTB (  ) 

BTB.cpp40 行で定義されています。

00041 {
00042     m_numEntryBits  = 0;
00043     m_numWays       = 0;
00044 
00045     m_numPred       = 0;
00046     m_numTableHit   = 0;
00047     m_numTableMiss  = 0;
00048     m_numUpdate     = 0;
00049     m_numEntries    = 0;
00050     m_numHit        = 0;
00051     m_numMiss       = 0;
00052     m_table         = 0;
00053 }

BTB::~BTB (  )  [virtual]

BTB.cpp55 行で定義されています。

参照先 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  ) 

BTB.cpp64 行で定義されています。

参照先 Onikiri::PhysicalResourceNode::INIT_PRE_CONNECTIONOnikiri::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  ) 

BTB.cpp74 行で定義されています。

参照先 Onikiri::Addr::addressOnikiri::BT_NONshttl::setassoc_table< PairType, Hasher, Replacer, Strage >::end()Onikiri::BTBPredict::hitshttl::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 
)

BTB.cpp93 行で定義されています。

参照先 Onikiri::Addr::addressASSERTOnikiri::BT_NONOnikiri::BTBPredict::dirPredictOnikiri::BTBPredict::hitOnikiri::OpClass::IsConditionalBranch()Onikiri::BranchTypeUtility::OpClassToBranchType()Onikiri::BTBPredict::predIndexPCOnikiri::BTBPredict::targetOnikiri::BTBPredict::typeshttl::setassoc_table< PairType, Hasher, Replacer, Strage >::write().

参照元 Onikiri::BPred::Commit().

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:


このクラスの説明は次のファイルから生成されました:
Onikiri2に対してTue Jun 18 14:51:46 2013に生成されました。  doxygen 1.4.7