#include <Retirer.h>
Onikiri::Retirerに対する継承グラフ
typedef PipelineNodeBase Onikiri::Retirer::BaseType [protected] |
typedef pool_list< OpIterator > Onikiri::Retirer::CommitingOps [protected] |
Retirer::~Retirer | ( | ) | [virtual] |
Retirer.cpp の 90 行で定義されています。
参照先 Onikiri::PhysicalResourceNode::ReleaseParam().
00091 { 00092 ReleaseParam(); 00093 }
関数の呼び出しグラフ:
Onikiri::Retirer::BEGIN_PARAM_PATH | ( | GetParamPath() | ) |
bool Retirer::CanCommitInsn | ( | OpIterator | op | ) | [protected] |
Retirer.cpp の 281 行で定義されています。
参照先 ASSERT・CanCommitOp()・Onikiri::InorderList::GetFrontOpOfSamePC()・Onikiri::OpInfo::GetMicroOpNum()・Onikiri::InorderList::GetNextIndexOp()・Onikiri::OpIterator::IsNull().
参照元 EvaluateCommit().
00282 { 00283 OpInfo* opInfo = op->GetOpInfo(); 00284 InorderList* inorderList = op->GetInorderList(); 00285 00286 int microOps = opInfo->GetMicroOpNum(); 00287 OpIterator cur = inorderList->GetFrontOpOfSamePC( op ); 00288 00289 for( int i = 0; i < microOps; i++ ){ 00290 ASSERT( cur->GetNo() == i, "Micro op indices mismatch." ); 00291 if( cur.IsNull() || !CanCommitOp( cur ) ){ 00292 return false; 00293 } 00294 cur = inorderList->GetNextIndexOp( cur ); 00295 } 00296 00297 return true; 00298 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
bool Retirer::CanCommitOp | ( | OpIterator | op | ) | [protected] |
Retirer.cpp の 243 行で定義されています。
参照先 Onikiri::Retirer::CommitDecisionHookParam::canCommit・HOOK_SECTION_OP_PARAM・Onikiri::OpClass::IsStore()・m_committableStatus・m_evaluated・s_commitDecisionHook・Onikiri::Retirer::Evaluated::storePortFull.
参照元 CanCommitInsn().
00244 { 00245 CommitDecisionHookParam param = { op, false }; 00246 HOOK_SECTION_OP_PARAM( s_commitDecisionHook, op, param ) 00247 { 00248 param.canCommit = true; 00249 00250 if( op->GetException().exception ){ 00251 // Exception occurs. 00252 param.canCommit = false; 00253 } 00254 else{ 00255 // An op can commit if the state of 'op' is 00256 // after than FINISHED or COMPLETED. 00257 if( op->GetStatus() < m_committableStatus ){ 00258 param.canCommit = false; 00259 } 00260 else{ 00261 // Store 00262 const OpClass& opClass = op->GetOpClass(); 00263 if( opClass.IsStore() ){ 00264 ExecUnitIF* execUnit = op->GetExecUnit(); 00265 if( execUnit->CanReserve( op, 0 ) ){ 00266 execUnit->Reserve( op, 0 ); 00267 } 00268 else{ 00269 param.canCommit = false; 00270 m_evaluated.storePortFull = true; 00271 } 00272 } 00273 } 00274 } 00275 } 00276 00277 return param.canCommit; 00278 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::CheckCommitCounters | ( | int | retiredOps, | |
InorderList * | inorderList | |||
) | [protected] |
Retirer.cpp の 395 行で定義されています。
参照先 Onikiri::InorderList::GetCommittedFrontOp()・Onikiri::InorderList::GetFrontOp()・Onikiri::InorderList::IsEmpty()・Onikiri::OpIterator::IsNull()・m_noCommitLimit・m_noCommittedCycle・m_numCommittedOps・THROW_RUNTIME_ERROR.
参照元 EvaluateCommit().
00396 { 00397 if( m_noCommittedCycle >= m_noCommitLimit ) { 00398 OpIterator uncommitted = inorderList->GetFrontOp(); 00399 if( uncommitted.IsNull() ) { 00400 if( inorderList->IsEmpty() ){ 00401 THROW_RUNTIME_ERROR( 00402 "InOrderList is empty and no op commits while %d cycle(numRetiredOp = %d). ", 00403 m_noCommittedCycle, m_numCommittedOps 00404 ); 00405 } 00406 else{ 00407 THROW_RUNTIME_ERROR( 00408 "No op committed while %d cycle. A next retireable op( the front of InOrderList ) is %s", 00409 m_noCommittedCycle, inorderList->GetCommittedFrontOp()->ToString(6).c_str() 00410 ); 00411 } 00412 } 00413 else { 00414 THROW_RUNTIME_ERROR( 00415 "No op committed while %d cycle. Next committable op( the front of InOrderList ) is %s", 00416 m_noCommittedCycle, uncommitted->ToString(6).c_str() 00417 ); 00418 } 00419 } 00420 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::Commit | ( | OpIterator | op | ) | [protected, virtual] |
Onikiri::PipelineNodeBaseを再定義しています。
Retirer.cpp の 328 行で定義されています。
参照先 Onikiri::EmulatorIF::Commit()・Onikiri::PooledIntrusivePtrObject< T, PtrT >::Construct()・FinishThread()・Onikiri::PipelineNodeBase::GetLowerPipeline()・HOOK_SECTION_OP・m_commitLatency・m_emulator・m_fixCommitLatency・m_forwardEmulator・Onikiri::ForwardEmulator::OnCommit()・s_commitHook.
参照元 UpdateCommit().
00329 { 00330 HOOK_SECTION_OP( s_commitHook, op ) 00331 { 00332 // Simulation is finished when a committed 'op' is a branch 00333 // that jumps to an address 0. 00334 if( op->GetOpClass().IsBranch() && op->GetTakenPC().address == 0 ) { 00335 FinishThread( op->GetThread() ); 00336 } 00337 00338 m_forwardEmulator->OnCommit( op ); 00339 m_emulator->Commit( &(*op), op->GetOpInfo() ); 00340 op->GetInorderList()->Commit( op ); 00341 00342 // Decide the latency of commit and register a retire event. 00343 int commitLatency = m_commitLatency; 00344 if( !m_fixCommitLatency && op->GetOpClass().IsStore() ){ 00345 // The cache access of a store is done in MemOrderManager::Commit and 00346 // its result is set to an op. 00347 int storeLatency = op->GetCacheAccessResult().latency; 00348 commitLatency = std::max( storeLatency, commitLatency ); 00349 } 00350 EventPtr retireEvent( OpRetireEvent::Construct( op, this ) ); 00351 op->AddEvent( retireEvent, GetLowerPipeline(), commitLatency ); 00352 } 00353 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::Evaluate | ( | ) | [virtual] |
Onikiri::ClockedResourceBaseを再定義しています。
Retirer.cpp の 109 行で定義されています。
参照先 Onikiri::ClockedResourceBase::Evaluate()・EvaluateCommit()・m_evaluated・Onikiri::Retirer::Evaluated::Reset().
00110 { 00111 m_evaluated.Reset(); 00112 EvaluateCommit(); 00113 PipelineNodeBase::Evaluate(); 00114 }
関数の呼び出しグラフ:
void Retirer::EvaluateCommit | ( | ) | [protected] |
Retirer.cpp の 117 行で定義されています。
参照先 CanCommitInsn()・CheckCommitCounters()・Onikiri::Retirer::Evaluated::committing・Onikiri::Retirer::Evaluated::evaluated・Onikiri::Retirer::Evaluated::exceptionCauser・Onikiri::Retirer::Evaluated::exceptionOccur・GetCommitableThread()・Onikiri::InorderList::GetFrontOp()・Onikiri::Thread::GetInorderList()・Onikiri::InorderList::GetNextIndexOp()・Onikiri::OpIterator::IsNull()・m_commitWidth・m_evaluated・m_numCommittedInsns・m_numSimulationEndInsns・m_numStorePortFullStalledCycles・Onikiri::Retirer::Evaluated::storePortFull.
参照元 Evaluate().
00118 { 00119 Thread* thread = GetCommitableThread(); 00120 if( !thread ){ 00121 m_evaluated.evaluated = true; 00122 return; 00123 } 00124 00125 InorderList* inorderList = thread->GetInorderList(); 00126 00127 int comittedOps = 0; 00128 00129 OpIterator headOp = inorderList->GetFrontOp(); 00130 if( !headOp.IsNull() && headOp->GetException().exception ){ 00131 m_evaluated.exceptionOccur = true; 00132 m_evaluated.exceptionCauser = headOp; 00133 00134 // Sanity checking for commitment 00135 CheckCommitCounters( 0, inorderList ); 00136 m_evaluated.evaluated = true; 00137 return; 00138 } 00139 00140 // Check head ops in an in-order list and retire completed ops. 00141 for( OpIterator op = inorderList->GetFrontOp(); 00142 !op.IsNull() && CanCommitInsn( op ) ; 00143 // Blank 00144 ){ 00145 if( m_numSimulationEndInsns != 0 && 00146 m_numCommittedInsns + comittedOps >= m_numSimulationEndInsns 00147 ){ 00148 break; 00149 } 00150 00151 int microOpNum = op->GetOpInfo()->GetMicroOpNum(); 00152 if( comittedOps + microOpNum > m_commitWidth ){ 00153 break; 00154 } 00155 00156 // Commit ops. 00157 for( int i = 0; i < microOpNum; i++ ){ 00158 m_evaluated.committing.push_back( op ); 00159 op = inorderList->GetNextIndexOp( op ); 00160 comittedOps++; 00161 } 00162 } 00163 00164 // Sanity checking for commitment 00165 CheckCommitCounters( comittedOps, inorderList ); 00166 00167 m_evaluated.evaluated = true; 00168 if( m_evaluated.storePortFull ){ 00169 m_numStorePortFullStalledCycles++; 00170 } 00171 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::FinishThread | ( | Thread * | tread | ) | [protected] |
Retirer.cpp の 423 行で定義されています。
参照先 Onikiri::Thread::Activate()・Onikiri::PipelineNodeBase::GetCore()・Onikiri::Core::GetThread()・Onikiri::Core::GetThreadCount()・Onikiri::Thread::IsActive()・m_endOfProgram.
参照元 Commit().
00424 { 00425 tread->Activate( false ); 00426 Core* core = GetCore(); 00427 00428 // Search unfinished threads. 00429 bool active = false; 00430 for( int i = 0; i < core->GetThreadCount(); i++ ){ 00431 if( core->GetThread(i)->IsActive() ){ 00432 active = true; 00433 } 00434 } 00435 00436 m_endOfProgram = !active; 00437 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::Flush | ( | OpIterator | op | ) | [virtual] |
Onikiri::PipelineNodeBaseを再定義しています。
Retirer.cpp の 223 行で定義されています。
参照先 ASSERT・Onikiri::Retirer::Evaluated::committing・m_evaluated.
参照元 Onikiri::InorderList::NotifyFlush().
00224 { 00225 #if ONIKIRI_DEBUG 00226 CommitingOps* committing = &m_evaluated.committing; 00227 for( CommitingOps::iterator i = committing->begin(); i != committing->end(); ){ 00228 // Committing ops must not be flushed. 00229 // This may occur when a wrong recovery policy is set. 00230 ASSERT( op != *i, "A committing op is flushed.\n%s", op->ToString().c_str() ); 00231 ++i; 00232 } 00233 /* 00234 ASSERT( 00235 !(m_evaluated.exceptionOccur && m_evaluated.exceptionCauser == op ), 00236 "A exception causing op is flushed." 00237 ); 00238 */ 00239 #endif 00240 }
Here is the caller graph for this function:
Thread * Retirer::GetCommitableThread | ( | ) | [protected] |
Retirer.cpp の 301 行で定義されています。
参照先 HOOK_SECTION_PARAM・m_currentRetireThread・Onikiri::PipelineNodeBase::m_thread・s_commitSteeringHook・Onikiri::Retirer::CommitSteeringHookParam::targetThread・THROW_RUNTIME_ERROR.
参照元 EvaluateCommit().
00302 { 00303 CommitSteeringHookParam param = { &m_thread, NULL }; 00304 HOOK_SECTION_PARAM( s_commitSteeringHook, param ) 00305 { 00306 int index; 00307 int count = 0; 00308 int threadSize = m_thread.GetSize(); 00309 do{ 00310 index = m_currentRetireThread; 00311 m_currentRetireThread++; 00312 if( m_currentRetireThread >= threadSize ){ 00313 m_currentRetireThread = 0; 00314 } 00315 00316 count++; 00317 if( count > threadSize ){ 00318 THROW_RUNTIME_ERROR( "No thread can retire." ); 00319 } 00320 } 00321 while( !m_thread[index]->IsActive() ); 00322 00323 param.targetThread = m_thread[index]; 00324 } 00325 return param.targetThread; 00326 }
Here is the caller graph for this function:
s64 Onikiri::Retirer::GetNumRetiredInsns | ( | ) | const [inline] |
s64 Onikiri::Retirer::GetNumRetiredOp | ( | ) | const [inline] |
void Retirer::Initialize | ( | InitPhase | phase | ) | [virtual] |
Onikiri::PipelineNodeBaseを再定義しています。
Retirer.cpp の 95 行で定義されています。
参照先 Onikiri::PipelineNodeBase::DisableLatch()・Onikiri::PhysicalResourceNode::INIT_POST_CONNECTION・Onikiri::PhysicalResourceNode::INIT_PRE_CONNECTION・Onikiri::PipelineNodeBase::Initialize()・Onikiri::ParamExchange::LoadParam()・Onikiri::RP_COMMIT・Onikiri::ClockedResourceBase::SetPriority().
00096 { 00097 PipelineNodeBase::Initialize( phase ); 00098 00099 if( phase == INIT_PRE_CONNECTION ){ 00100 SetPriority( RP_COMMIT ); 00101 LoadParam(); 00102 } 00103 else if( phase == INIT_POST_CONNECTION ){ 00104 DisableLatch(); 00105 } 00106 00107 }
関数の呼び出しグラフ:
bool Onikiri::Retirer::IsEndOfProgram | ( | ) | const [inline] |
void Retirer::Retire | ( | OpIterator | op | ) | [virtual] |
Onikiri::PipelineNodeBaseを再定義しています。
Retirer.cpp の 209 行で定義されています。
参照先 HOOK_SECTION_OP・m_numRetiredInsns・m_numRetiredOps・s_retireHook.
参照元 Onikiri::OpRetireEvent::Update().
00210 { 00211 HOOK_SECTION_OP( s_retireHook, op ) 00212 { 00213 op->GetInorderList()->Retire( op ); 00214 00215 if( op->GetNo() == 0 ) { 00216 m_numRetiredInsns++; 00217 } 00218 m_numRetiredOps++; 00219 } 00220 }
Here is the caller graph for this function:
Retirer.cpp の 197 行で定義されています。
参照先 m_numCommittedInsns・m_numCommittedOps・m_numRetiredInsns・m_numRetiredOps・m_numSimulationEndInsns.
00198 { 00199 m_numCommittedInsns = numInsns; 00200 m_numCommittedOps = numOp; 00201 00202 m_numRetiredInsns = numInsns; 00203 m_numRetiredOps = numOp; 00204 00205 m_numSimulationEndInsns = simulationEndInsns; 00206 }
void Retirer::Transition | ( | ) | [virtual] |
Onikiri::ClockedResourceBaseを再定義しています。
Retirer.cpp の 173 行で定義されています。
参照先 Onikiri::ClockedResourceBase::IsStalledThisCycle()・m_evaluated・Onikiri::Retirer::Evaluated::Reset()・Onikiri::ClockedResourceBase::Transition().
00174 { 00175 BaseType::Transition(); 00176 00177 // On a stalled cycle, evaluated results must be cleared, because 00178 // the evaluated results may appear to be illegally flushed. 00179 if( IsStalledThisCycle() ){ 00180 m_evaluated.Reset(); 00181 } 00182 }
関数の呼び出しグラフ:
void Retirer::Update | ( | ) | [virtual] |
Onikiri::ClockedResourceBaseを再定義しています。
Retirer.cpp の 185 行で定義されています。
参照先 m_numRetiredInsns・m_numSimulationEndInsns・THROW_RUNTIME_ERROR・UpdateCommit()・UpdateException().
00186 { 00187 if( m_numSimulationEndInsns != 0 && m_numRetiredInsns > m_numSimulationEndInsns ){ 00188 THROW_RUNTIME_ERROR( "Simulation was done in excess of 'System/@SimulationInsns'" ); 00189 } 00190 00191 UpdateException(); 00192 UpdateCommit(); 00193 }
関数の呼び出しグラフ:
void Retirer::UpdateCommit | ( | ) | [protected] |
Retirer.cpp の 355 行で定義されています。
参照先 Commit()・Onikiri::Retirer::Evaluated::committing・m_evaluated・m_noCommittedCycle・m_numCommittedInsns・m_numCommittedOps.
参照元 Update().
00356 { 00357 int committedOps = 0; 00358 for( CommitingOps::iterator i = m_evaluated.committing.begin(); i != m_evaluated.committing.end(); i++ ){ 00359 00360 OpIterator op = *i; 00361 00362 // Commit an op. 00363 Commit( op ); 00364 00365 ++m_numCommittedOps; 00366 ++committedOps; 00367 00368 // The number of committed instructions are incremented when a head 00369 // op of an instruction is committed because multiple ops may be 00370 // generated from a instruction. 00371 if( op->GetNo() == 0 ) { 00372 ++m_numCommittedInsns; 00373 } 00374 } 00375 00376 // Count cycles from a cycle when a last op is retired. 00377 if( committedOps > 0 ) { 00378 m_noCommittedCycle = 0; 00379 } else { 00380 ++m_noCommittedCycle; 00381 } 00382 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Retirer::UpdateException | ( | ) | [protected] |
Retirer.cpp の 384 行で定義されています。
参照先 Onikiri::Retirer::Evaluated::exceptionCauser・Onikiri::Retirer::Evaluated::exceptionOccur・m_evaluated・Onikiri::Recoverer::RecoverException().
参照元 Update().
00385 { 00386 if( m_evaluated.exceptionOccur ){ 00387 OpIterator causer = m_evaluated.exceptionCauser; 00388 Recoverer* recoverer = causer->GetThread()->GetRecoverer(); 00389 recoverer->RecoverException( causer ); 00390 m_evaluated.exceptionOccur = false; 00391 } 00392 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
int Onikiri::Retirer::m_commitLatency [protected] |
OpStatus Onikiri::Retirer::m_committableStatus [protected] |
int Onikiri::Retirer::m_commitWidth [protected] |
int Onikiri::Retirer::m_currentRetireThread [protected] |
EmulatorIF* Onikiri::Retirer::m_emulator [protected] |
bool Onikiri::Retirer::m_endOfProgram [protected] |
struct Onikiri::Retirer::Evaluated
Onikiri::Retirer::m_evaluated [protected] |
bool Onikiri::Retirer::m_fixCommitLatency [protected] |
ForwardEmulator* Onikiri::Retirer::m_forwardEmulator [protected] |
int Onikiri::Retirer::m_noCommitLimit [protected] |
int Onikiri::Retirer::m_noCommittedCycle [protected] |
s64 Onikiri::Retirer::m_numCommittedInsns [protected] |
s64 Onikiri::Retirer::m_numCommittedOps [protected] |
s64 Onikiri::Retirer::m_numRetiredInsns [protected] |
s64 Onikiri::Retirer::m_numRetiredOps [protected] |
s64 Onikiri::Retirer::m_numSimulationEndInsns [protected] |
s64 Onikiri::Retirer::m_numStorePortFullStalledCycles [protected] |
int Onikiri::Retirer::m_retireWidth [protected] |