クラス Onikiri::Recoverer

#include <Recoverer.h>

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

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

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

Public 型

typedef DataPredMissRecovery Recovery

Public メソッド

 BEGIN_PARAM_PATH (GetParamPath()) BEGIN_PARAM_PATH(GetResultPath()) Recoverer()
virtual void Finalize ()
virtual void Initialize (InitPhase phase)
void RecoverBPredMiss (OpIterator branch)
int RecoverByRefetch (OpIterator missedOp, OpIterator startOp)
int RecoverByRescheduleAll (OpIterator missedOp, OpIterator startOp)
int RecoverByRescheduleNotFinished (OpIterator missedOp, OpIterator startOp)
int RecoverByRescheduleSelective (OpIterator producerOp, Recovery::From from)
int RecoverDataPredMiss (OpIterator producer, OpIterator consumer, const DataPredMissRecovery &recovery)
int RecoverDataPredMiss (OpIterator producer, OpIterator consumer, DataPredMissRecovery::Type dataPredType)
void RecoverException (OpIterator causer)
virtual ~Recoverer ()

Protected メソッド

OpIterator GetRecoveryStartOp (OpIterator producer, OpIterator consumer, Recovery::From from)
void RecoverCheckpoint (Checkpoint *checkpoint)
int RescheduleConsumers (OpIterator producer)
void UpdateRecoveryStatistics (int recoveredInsns, Recovery::Type dataPredType)

Protected 変数

s64 m_addrPredRecoveryCount
s64 m_addrPredRecoveryOps
s64 m_brPredRecoveryCount
int m_brPredRecoveryLatency
s64 m_brPredRecoveryOps
CheckpointMasterm_checkpointMaster
Corem_core
s64 m_exceptionRecoveryCount
int m_exceptionRecoveryLatency
s64 m_exceptionRecoveryOps
InorderListm_inorderList
s64 m_latPredRecoveryCount
s64 m_latPredRecoveryOps
s64 m_partialReadRecoveryCount
s64 m_partialReadRecoveryOps
Threadm_thread
s64 m_valuePredRecoveryCount
s64 m_valuePredRecoveryOps

説明

Recoverer.h50 行で定義されています。


型定義

typedef DataPredMissRecovery Onikiri::Recoverer::Recovery

Recoverer.h53 行で定義されています。


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

Recoverer::~Recoverer (  )  [virtual]

Recoverer.cpp73 行で定義されています。

00074 {
00075 }


関数

Onikiri::Recoverer::BEGIN_PARAM_PATH ( GetParamPath()   ) 

void Recoverer::Finalize (  )  [virtual]

Onikiri::PhysicalResourceNodeを再定義しています。

Recoverer.cpp94 行で定義されています。

参照先 Onikiri::PhysicalResourceNode::ReleaseParam().

00095 {
00096     ReleaseParam();
00097 }

関数の呼び出しグラフ:

OpIterator Recoverer::GetRecoveryStartOp ( OpIterator  producer,
OpIterator  consumer,
Recovery::From  from 
) [protected]

Recoverer.cpp412 行で定義されています。

参照先 ASSERTOnikiri::DataPredMissRecovery::FROM_CONSUMEROnikiri::DataPredMissRecovery::FROM_NEXT_OF_PRODUCEROnikiri::DataPredMissRecovery::FROM_PRODUCEROnikiri::InorderList::GetNextPCOp()Onikiri::OpIterator::IsNull()m_inorderList.

参照元 RecoverDataPredMiss().

00413 {
00414     // Select a start point of recovery.
00415     OpIterator startOp(0);
00416     switch( from ){
00417     case Recovery::FROM_PRODUCER:
00418         ASSERT( 
00419             !producer.IsNull(),
00420             "The start point of recovery is specified as 'Producer', but a passed producer is null." 
00421             "This may occur when a producer is already retired when violation is detected."
00422         );
00423         startOp = producer;
00424         break;
00425 
00426     case Recovery::FROM_NEXT_OF_PRODUCER:
00427         ASSERT( 
00428             !producer.IsNull(), 
00429             "The start point of recovery is specified as 'NextOfProducer', but a passed producer is null." 
00430             "This may occur when a producer is already retired when violation is detected."
00431         );
00432         startOp = m_inorderList->GetNextPCOp( producer );
00433         break;
00434 
00435     case Recovery::FROM_CONSUMER:
00436         startOp = consumer;
00437         break;
00438 
00439     default:
00440         ASSERT( 0, "An unknown recovery start point." );
00441         break;
00442     }
00443     return startOp;
00444 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Recoverer::Initialize ( InitPhase  phase  )  [virtual]

Recoverer.cpp77 行で定義されています。

参照先 Onikiri::DataPredMissRecovery::FromNextOfProducer()Onikiri::DataPredMissRecovery::FromProducer()Onikiri::Core::GetPartialLoadRecovery()Onikiri::PhysicalResourceNode::INIT_POST_CONNECTIONOnikiri::PhysicalResourceNode::INIT_PRE_CONNECTIONOnikiri::ParamExchange::LoadParam()m_coreTHROW_RUNTIME_ERROR.

00078 {
00079     if( phase == INIT_PRE_CONNECTION ){
00080         LoadParam();
00081     }
00082     else if( phase == INIT_POST_CONNECTION ){
00083 
00084         // Policy checking.
00085         // Other policy checking is done in Scheduler.
00086         const DataPredMissRecovery& pmr = m_core->GetPartialLoadRecovery();
00087         if( pmr.FromNextOfProducer() || pmr.FromProducer() ){
00088             // Partial load violation may be detected after a producer is committed.
00089             THROW_RUNTIME_ERROR( "Partial load recovery supports only a mode 'from Consumer'." );
00090         }
00091     }
00092 }

関数の呼び出しグラフ:

void Recoverer::RecoverBPredMiss ( OpIterator  branch  ) 

Recoverer.cpp101 行で定義されています。

参照先 Onikiri::InorderList::FlushBackward()Onikiri::Thread::GetCore()Onikiri::Core::GetFetcher()Onikiri::InorderList::GetNextPCOp()m_brPredRecoveryCountm_brPredRecoveryLatencym_brPredRecoveryOpsm_inorderListm_threadRecoverCheckpoint()Onikiri::Thread::SetFetchPC()Onikiri::PipelineNodeBase::StallNextCycle().

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

00102 {
00103     // Recover processor state to a checkpoint after the branch.
00104     RecoverCheckpoint( branch->GetAfterCheckpoint() );
00105 
00106     // Flush backward ops.
00107     m_brPredRecoveryOps +=
00108         m_inorderList->FlushBackward( m_inorderList->GetNextPCOp(branch) );
00109 
00110     // Set a correct branch result.
00111     m_thread->SetFetchPC( branch->GetNextPC() );
00112 
00113     // Stall a fetcher for a recovery latency.
00114     int latency = m_brPredRecoveryLatency;
00115     if( latency > 0 ){
00116         m_thread->GetCore()->GetFetcher()->StallNextCycle( latency );
00117     }
00118 
00119     m_brPredRecoveryCount++;
00120 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RecoverByRefetch ( OpIterator  missedOp,
OpIterator  startOp 
)

Recoverer.cpp244 行で定義されています。

参照先 ASSERTOnikiri::InorderList::FlushBackward()Onikiri::InorderList::GetFrontOpOfSamePC()Onikiri::InorderList::GetPrevPCOp()Onikiri::OpIterator::IsNull()m_inorderListm_threadOnikiri::OpStatus::OS_COMITTINGRecoverCheckpoint()Onikiri::Thread::SetFetchPC()THROW_RUNTIME_ERROR.

参照元 RecoverDataPredMiss()RecoverException().

00245 {
00246     // A pc that fetch is resumed from.
00247     PC fetchPC = startOp->GetPC();
00248     
00249     ASSERT( 
00250         startOp->GetStatus() < OpStatus::OS_COMITTING,
00251         "Cannot re-fetch from this op because this op is already committed. op: %s", 
00252         startOp->ToString(6).c_str()
00253     );
00254 
00255     // Recover the state to 'checkpoint'.
00256     Checkpoint* checkpoint = startOp->GetBeforeCheckpoint();
00257     if( !checkpoint ){
00258         OpIterator prevOp = m_inorderList->GetPrevPCOp( startOp );
00259         if( prevOp.IsNull() ){
00260             THROW_RUNTIME_ERROR( "A necessary checkpoint is not taken. op: %s", startOp->ToString(6).c_str() );
00261         }
00262         checkpoint = m_inorderList->GetFrontOpOfSamePC(prevOp)->GetAfterCheckpoint();
00263         if( !checkpoint ){
00264             THROW_RUNTIME_ERROR( "A necessary checkpoint is not taken. op: %s", startOp->ToString(6).c_str() );
00265         }
00266     }
00267     RecoverCheckpoint( checkpoint );
00268     
00269     // Flush backward ops.
00270     int flushedInsns = 
00271         m_inorderList->FlushBackward( m_inorderList->GetFrontOpOfSamePC( startOp ) );
00272 
00273     // Set a correct branch result.
00274     m_thread->SetFetchPC( fetchPC );
00275 
00276     return flushedInsns;
00277 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RecoverByRescheduleAll ( OpIterator  missedOp,
OpIterator  startOp 
)

Recoverer.cpp281 行で定義されています。

参照先 Onikiri::InorderList::GetNextIndexOp()Onikiri::OpIterator::IsNull()m_inorderList.

参照元 RecoverDataPredMiss().

00282 {
00283     int recoveredInsns = 0;
00284     for( OpIterator i = startOp; !i.IsNull(); i = m_inorderList->GetNextIndexOp( i ) ){
00285         if( i->GetScheduler()->Reschedule( i ) ){
00286             recoveredInsns++;
00287         }
00288     }
00289 
00290     return recoveredInsns;
00291 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RecoverByRescheduleNotFinished ( OpIterator  missedOp,
OpIterator  startOp 
)

Recoverer.cpp294 行で定義されています。

参照先 Onikiri::InorderList::GetNextIndexOp()Onikiri::OpIterator::IsNull()m_inorderListOnikiri::OpStatus::OS_EXECUTING.

参照元 RecoverDataPredMiss().

00295 {
00296     int recoveredInsns = 0;
00297     for( OpIterator i = startOp; !i.IsNull(); i = m_inorderList->GetNextIndexOp( i ) ){
00298         if( i->GetStatus() <= OpStatus::OS_EXECUTING ){
00299             if( i->GetScheduler()->Reschedule( i ) ){
00300                 recoveredInsns++;
00301             }
00302         }
00303     }
00304 
00305     return recoveredInsns;
00306 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RecoverByRescheduleSelective ( OpIterator  producerOp,
Recovery::From  from 
)

Recoverer.cpp309 行で定義されています。

参照先 ASSERTOnikiri::DataPredMissRecovery::FROM_NEXT_OF_PRODUCEROnikiri::DataPredMissRecovery::FROM_PRODUCERRescheduleConsumers().

参照元 RecoverDataPredMiss().

00310 {
00311     ASSERT(
00312         from != Recovery::FROM_NEXT_OF_PRODUCER,
00313         "cannot reschedule selective next of producer"
00314     );
00315 
00316     int recoveredInsns = 0;
00317     if( from == Recovery::FROM_PRODUCER ){
00318         if( producerOp->GetScheduler()->Reschedule( producerOp ) ){
00319             recoveredInsns++;
00320         }
00321     }
00322     //recoveredInsns += producerOp->RescheduleConsumers( producerOp );
00323     RescheduleConsumers( producerOp );
00324 
00325     return recoveredInsns;
00326 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Recoverer::RecoverCheckpoint ( Checkpoint checkpoint  )  [protected]

Recoverer.cpp329 行で定義されています。

参照先 ASSERTm_checkpointMasterOnikiri::CheckpointMaster::Recover().

参照元 RecoverBPredMiss()RecoverByRefetch().

00330 {
00331     ASSERT( checkpoint != 0, "no checkpoint for recovery" );
00332     m_checkpointMaster->Recover( checkpoint );
00333 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RecoverDataPredMiss ( OpIterator  producer,
OpIterator  consumer,
const DataPredMissRecovery recovery 
)

Recoverer.cpp192 行で定義されています。

参照先 ASSERTOnikiri::DataPredMissRecovery::GetFrom()Onikiri::DataPredMissRecovery::GetPolicy()GetRecoveryStartOp()Onikiri::OpIterator::IsNull()Onikiri::DataPredMissRecovery::POLICY_REFETCHOnikiri::DataPredMissRecovery::POLICY_REISSUE_ALLOnikiri::DataPredMissRecovery::POLICY_REISSUE_NOT_FINISHEDOnikiri::DataPredMissRecovery::POLICY_REISSUE_SELECTIVERecoverByRefetch()RecoverByRescheduleAll()RecoverByRescheduleNotFinished()RecoverByRescheduleSelective().

00194  {
00195     // Recovered from:
00196     const Recovery::From& from      = dpmr.GetFrom();
00197 
00198     // Recover policy:
00199     const Recovery::Policy& policy  = dpmr.GetPolicy();
00200 
00201     if( policy == Recovery::POLICY_REISSUE_SELECTIVE ){
00202         // In the case of Recovery::FROM_CONSUMER, 
00203         // multiple consumers must be re-scheduled and 
00204         // the bellow codes including GetFirstConsumer() cannnot treat this.
00205         return RecoverByRescheduleSelective( producer, from );  
00206     }
00207 
00208 
00209     // Select a start point of recovery.
00210     OpIterator startOp = GetRecoveryStartOp( producer, consumer, from );
00211 
00212     // Return if there are no ops recovered...
00213     if( startOp.IsNull() ) {
00214         return 0;
00215     }
00216 
00217     int  recovered = 0;
00218 
00219     switch( policy ){
00220 
00221     case Recovery::POLICY_REFETCH:
00222         recovered = RecoverByRefetch( producer, startOp );
00223         break;
00224 
00225     case Recovery::POLICY_REISSUE_ALL:
00226         recovered = RecoverByRescheduleAll( producer, startOp );
00227         break;
00228     
00229     case Recovery::POLICY_REISSUE_NOT_FINISHED:
00230         recovered = RecoverByRescheduleNotFinished( producer, startOp );
00231         break;
00232 
00233     default:
00234         ASSERT( 0, "Unknown recovery policy." );
00235         break;
00236     }
00237 
00238     return recovered;
00239 
00240 }

関数の呼び出しグラフ:

int Onikiri::Recoverer::RecoverDataPredMiss ( OpIterator  producer,
OpIterator  consumer,
DataPredMissRecovery::Type  dataPredType 
)

参照元 Onikiri::MemOrderManager::DetectAccessOrderViolation()Onikiri::MemOrderManager::DetectPartialLoadViolation()Onikiri::OpDetectLatPredMissEvent::Update().

Here is the caller graph for this function:

void Recoverer::RecoverException ( OpIterator  causer  ) 

Recoverer.cpp123 行で定義されています。

参照先 ASSERTOnikiri::Exception::exceptionOnikiri::Thread::GetCore()Onikiri::Core::GetFetcher()m_exceptionRecoveryCountm_exceptionRecoveryLatencym_exceptionRecoveryOpsm_threadRecoverByRefetch()Onikiri::PipelineNodeBase::StallNextCycle().

参照元 Onikiri::Retirer::UpdateException().

00124 {
00125     ASSERT(
00126         !causer->GetOpClass().IsSyscall(), 
00127         "Exception of a system call is not supported."
00128     );
00129 
00130     m_exceptionRecoveryOps += 
00131         RecoverByRefetch( causer, causer );
00132 
00133     // Clear an exception state
00134     Exception exception = causer->GetException();
00135     exception.exception = false;
00136     causer->SetException( exception );
00137 
00138     // Stall a fetcher for a recovery latency.
00139     int latency = m_exceptionRecoveryLatency;
00140     if( latency > 0 ){
00141         m_thread->GetCore()->GetFetcher()->StallNextCycle( latency );
00142     }
00143 
00144     m_exceptionRecoveryCount++;
00145 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

int Recoverer::RescheduleConsumers ( OpIterator  producer  )  [protected]

Recoverer.cpp372 行で定義されています。

参照先 Onikiri::Thread::GetMemOrderManager()Onikiri::OpIterator::IsNull()m_thread.

参照元 RecoverByRescheduleSelective().

00373 {
00374     int reshceduledInsns = 0;
00375 
00376     // Reschedule consumers.
00377     int depNum = producer->GetDstDepNum();
00378     for( int i = 0; i < depNum; ++i ){
00379         Dependency* dep = producer->GetDstDep(i);
00380         const Dependency::ConsumerListType& consumers = dep->GetConsumers();
00381         for(Dependency::ConsumerListConstIterator j = consumers.begin();
00382             j != consumers.end(); 
00383             ++j
00384         ){
00385             OpIterator consumer = *j;
00386             if( consumer->GetScheduler()->Reschedule( consumer ) ){
00387                 reshceduledInsns++;
00388             }
00389             reshceduledInsns += RescheduleConsumers( consumer );
00390         }
00391     }
00392     
00393     // Rescheduling speculatively executed load instructions.
00394     if( producer->GetOpClass().IsStore() ) {
00395         MemOrderManager* memOrder = m_thread->GetMemOrderManager();
00396         const MemAccess& memAccess = producer->GetMemAccess();
00397         for( int i = 0; ; i++ ){
00398             OpIterator consumer = memOrder->GetConsumerLoad( producer, memAccess, i );
00399             if( consumer.IsNull() )
00400                 break;
00401             if( consumer->GetScheduler()->Reschedule( consumer ) ){
00402                 reshceduledInsns++;
00403             }
00404             reshceduledInsns += RescheduleConsumers( consumer );
00405         }
00406     }
00407 
00408     return reshceduledInsns;
00409 
00410 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Recoverer::UpdateRecoveryStatistics ( int  recoveredInsns,
Recovery::Type  dataPredType 
) [protected]

Recoverer.cpp335 行で定義されています。

参照先 m_addrPredRecoveryCountm_addrPredRecoveryOpsm_latPredRecoveryCountm_latPredRecoveryOpsm_partialReadRecoveryCountm_partialReadRecoveryOpsm_valuePredRecoveryCountm_valuePredRecoveryOpsTHROW_RUNTIME_ERROR.

00338  {
00339     typedef Recovery DPMR;
00340 
00341     switch( dataPredType ){
00342 
00343     case DPMR::TYPE_LATENCY:
00344         m_latPredRecoveryOps += recoveredInsns;
00345         m_latPredRecoveryCount++;
00346         break;
00347 
00348     case DPMR::TYPE_ADDRESS_MATCH:
00349         m_addrPredRecoveryOps += recoveredInsns;
00350         m_addrPredRecoveryCount++;
00351         break;
00352 
00353     case DPMR::TYPE_VALUE:
00354         m_valuePredRecoveryOps += recoveredInsns;
00355         m_valuePredRecoveryCount++;
00356         break;
00357 
00358     case DPMR::TYPE_PARTIAL_LOAD:
00359         m_partialReadRecoveryOps += recoveredInsns;
00360         m_partialReadRecoveryCount++;
00361         break;
00362 
00363     default:
00364         THROW_RUNTIME_ERROR( "Unknown data prediction type." );
00365         break;
00366 
00367     }
00368 }


変数

s64 Onikiri::Recoverer::m_addrPredRecoveryCount [protected]

Recoverer.h149 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_addrPredRecoveryOps [protected]

Recoverer.h154 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_brPredRecoveryCount [protected]

Recoverer.h158 行で定義されています。

参照元 RecoverBPredMiss().

int Onikiri::Recoverer::m_brPredRecoveryLatency [protected]

Recoverer.h164 行で定義されています。

参照元 RecoverBPredMiss().

s64 Onikiri::Recoverer::m_brPredRecoveryOps [protected]

Recoverer.h159 行で定義されています。

参照元 RecoverBPredMiss().

CheckpointMaster* Onikiri::Recoverer::m_checkpointMaster [protected]

Recoverer.h146 行で定義されています。

参照元 RecoverCheckpoint().

Core* Onikiri::Recoverer::m_core [protected]

Recoverer.h143 行で定義されています。

参照元 Initialize().

s64 Onikiri::Recoverer::m_exceptionRecoveryCount [protected]

Recoverer.h161 行で定義されています。

参照元 RecoverException().

int Onikiri::Recoverer::m_exceptionRecoveryLatency [protected]

Recoverer.h165 行で定義されています。

参照元 RecoverException().

s64 Onikiri::Recoverer::m_exceptionRecoveryOps [protected]

Recoverer.h162 行で定義されています。

参照元 RecoverException().

InorderList* Onikiri::Recoverer::m_inorderList [protected]

Recoverer.h145 行で定義されています。

参照元 GetRecoveryStartOp()RecoverBPredMiss()RecoverByRefetch()RecoverByRescheduleAll()RecoverByRescheduleNotFinished().

s64 Onikiri::Recoverer::m_latPredRecoveryCount [protected]

Recoverer.h148 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_latPredRecoveryOps [protected]

Recoverer.h153 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_partialReadRecoveryCount [protected]

Recoverer.h151 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_partialReadRecoveryOps [protected]

Recoverer.h156 行で定義されています。

参照元 UpdateRecoveryStatistics().

Thread* Onikiri::Recoverer::m_thread [protected]

Recoverer.h144 行で定義されています。

参照元 RecoverBPredMiss()RecoverByRefetch()RecoverException()RescheduleConsumers().

s64 Onikiri::Recoverer::m_valuePredRecoveryCount [protected]

Recoverer.h150 行で定義されています。

参照元 UpdateRecoveryStatistics().

s64 Onikiri::Recoverer::m_valuePredRecoveryOps [protected]

Recoverer.h155 行で定義されています。

参照元 UpdateRecoveryStatistics().


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