クラス Onikiri::Fetcher

#include <Fetcher.h>

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

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

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

Public メソッド

 BEGIN_PARAM_PATH (GetResultPath()) RESULT_RATE_ENTRY("@AverageFetchGroupSize"
 BEGIN_PARAM_PATH (GetParamPath()) PARAM_ENTRY("@FetchWidth"
virtual void Commit (OpIterator op)
virtual void Evaluate ()
m_numFetchGroup Fetcher ()
virtual void Finalize ()
void Finished (OpIterator op)
BPredGetBPred () const
EmulatorIFGetEmulator () const
const int GetFetchWidth () const
virtual void Initialize (InitPhase phase)
 PARAM_ENTRY ("@CheckLatencyMismatch", m_checkLatencyMismatch)
 PARAM_ENTRY ("@IdealMode", m_idealMode)
 PARAM_ENTRY ("@FetchLatency", m_fetchLatency)
void SetInitialNumFetchedOp (u64 num)
virtual void Update ()
virtual ~Fetcher ()

Public 変数

 m_fetchWidth
 m_numFetchedPC

Static Public 変数

static HookPoint< Fetcher,
BranchPredictionHookParam
s_branchPredictionHook
static HookPoint< Fetcher,
FetchDecisionHookParam
s_fetchDecisionHook
static HookPoint< Fetcher,
FetchHookParam
s_fetchHook
static HookPoint< Fetcher,
SteeringHookParam
s_fetchSteeringHook

Protected 型

typedef PipelineNodeBase BaseType
typedef fixed_sized_buffer<
OpIterator, SimISAInfo::MAX_OP_INFO_COUNT_PER_PC,
Fetcher
FetchedOpArray

Protected メソッド

void BackupOnCheckpoint (OpIterator op, bool before)
bool CanFetch (Thread *thread, PC pc, OpInfo **infoArray, int numOp)
void CanFetchBody (FetchDecisionHookParam *param)
void CreateCheckpoint (OpIterator op)
void EnterPipeline (OpIterator op, int nextEventCycle)
void Fetch (Thread *thread, FetchedOpArray &fetchedOp, PC pc, OpInfo **infoArray, int numOp)
void ForEachOp (FetchedOpArray &c, int size, void(Fetcher::*func)(OpIterator))
template<typename T1>
void ForEachOpArg1 (FetchedOpArray &c, int size, T1 arg1, void(Fetcher::*func)(OpIterator, T1))
ThreadGetFetchThread (bool Update)
const int GetICacheReadLatency (const PC &pc)
bool IsSerializingRequired (Thread *thread) const
bool IsSerializingRequired (OpIterator op) const
bool IsSerializingRequired (const OpInfo *const info) const
void PredictNextPC (OpIterator op, PC fetchGroupPC)
void PredictNextPCBody (BranchPredictionHookParam *param)

Protected 変数

BPredm_bpred
CacheSystemm_cacheSystem
bool m_checkLatencyMismatch
int m_currentFetchThread
EmulatorIFm_emulator
Onikiri::Fetcher::Evaluated m_evaluated
int m_fetchLatency
FetchThreadSteererIFm_fetchThreadSteerer
int m_fetchWidth
ForwardEmulatorm_forwardEmulator
GlobalClockm_globalClock
bool m_idealMode
int m_numBranchInFetchGroup
u64 m_numFetchedOp
u64 m_numFetchedPC
u64 m_numFetchGroup
Onikiri::Fetcher::StallCycles m_stallCycles

Static Protected 変数

static const int m_maxBranchInFetchGroup = 1

構成

struct  BranchPredictionHookParam
struct  Evaluated
struct  FetchDecisionHookParam
struct  FetchHookParam
struct  StallCycles
struct  SteeringHookParam

説明

Fetcher.h66 行で定義されています。


型定義

typedef PipelineNodeBase Onikiri::Fetcher::BaseType [protected]

Fetcher.h185 行で定義されています。

typedef fixed_sized_buffer< OpIterator, SimISAInfo::MAX_OP_INFO_COUNT_PER_PC, Fetcher > Onikiri::Fetcher::FetchedOpArray [protected]

Fetcher.h190 行で定義されています。


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

Fetcher::Fetcher (  ) 

Fetcher.cpp75 行で定義されています。

00075                  :
00076     m_fetchWidth(0),    
00077     m_fetchLatency(0),
00078     m_numFetchedOp(0),
00079     m_numFetchedPC(0),
00080     m_numFetchGroup(0),
00081     m_numBranchInFetchGroup(0),
00082     m_idealMode(false),
00083     m_checkLatencyMismatch(false),
00084     m_currentFetchThread(0),
00085     m_bpred(0),
00086     m_cacheSystem(0),
00087     m_emulator(0),
00088     m_globalClock(0),
00089     m_forwardEmulator(0),
00090     m_fetchThreadSteerer(0)
00091 {
00092 }

Fetcher::~Fetcher (  )  [virtual]

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

00095 {
00096 }


関数

void Fetcher::BackupOnCheckpoint ( OpIterator  op,
bool  before 
) [protected]

Fetcher.cpp348 行で定義されています。

参照先 Onikiri::CheckpointMaster::Backup()Onikiri::PipelineNodeBase::GetCore()Onikiri::CheckpointMaster::SLOT_FETCH.

参照元 Update().

00349 {
00350     const PC& pc = op->GetPC();
00351     OpInfo* const opInfo = op->GetOpInfo();
00352 
00353     if( before && GetCore()->IsRequiredCheckpointBefore(pc, opInfo) ) {
00354         CheckpointMaster* master = op->GetThread()->GetCheckpointMaster();
00355         master->Backup(op->GetBeforeCheckpoint(), CheckpointMaster::SLOT_FETCH);
00356     }
00357 
00358     if( !before && GetCore()->IsRequiredCheckpointAfter( pc, opInfo ) ) {
00359         CheckpointMaster* master = op->GetThread()->GetCheckpointMaster();
00360         master->Backup(op->GetAfterCheckpoint(), CheckpointMaster::SLOT_FETCH);
00361     }
00362 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

Onikiri::Fetcher::BEGIN_PARAM_PATH ( GetResultPath()   ) 

Onikiri::Fetcher::BEGIN_PARAM_PATH ( GetParamPath()   ) 

bool Fetcher::CanFetch ( Thread thread,
PC  pc,
OpInfo **  infoArray,
int  numOp 
) [protected]

Fetcher.cpp187 行で定義されています。

参照先 Onikiri::InorderList::CanAllocate()Onikiri::CheckpointMaster::CanCreate()Onikiri::Fetcher::FetchDecisionHookParam::canFetchOnikiri::Fetcher::StallCycles::checkpointOnikiri::Fetcher::StallCycles::currentSyscallOnikiri::Thread::GetCheckpointMaster()Onikiri::PipelineNodeBase::GetCore()Onikiri::Thread::GetInorderList()HOOK_SECTION_PARAMOnikiri::Fetcher::StallCycles::inorderListOnikiri::InorderList::IsEmpty()Onikiri::Fetcher::Evaluated::isInorderListEmptyIsSerializingRequired()m_evaluatedm_idealModem_maxBranchInFetchGroupm_numBranchInFetchGroupm_stallCyclesOnikiri::Fetcher::StallCycles::nextSyscalls_fetchDecisionHook.

参照元 Update().

00188 {
00189     FetchDecisionHookParam param = { thread, pc, infoArray, numOp, false };
00190 
00191     HOOK_SECTION_PARAM( s_fetchDecisionHook, param )
00192     {
00193         // RAXg[
00194         // In serializing state.
00195         if( IsSerializingRequired( thread ) ){
00196             ++m_stallCycles.currentSyscall;
00197             param.canFetch = false;
00198             return param.canFetch;
00199         }
00200 
00201         // The number of required checkpoints for this fetch group.
00202         int numCheckpointReq = 0;
00203     
00204         // 
00205         bool reqSerializing = false;
00206 
00207         for( int k = 0; k < numOp; ++k ) {
00208             OpInfo* info = infoArray[k];
00209 
00210             if( IsSerializingRequired(info) ) {
00211                 reqSerializing = true;
00212             }
00213 
00214             // tFb`O[v
00215             if( !m_idealMode && info->GetOpClass().IsBranch() ) {
00216                 if( m_numBranchInFetchGroup >= m_maxBranchInFetchGroup ){
00217                     param.canFetch = false;
00218                     return param.canFetch;
00219                 }
00220                 ++m_numBranchInFetchGroup;
00221             }
00222 
00223             if( GetCore()->IsRequiredCheckpointBefore(pc, info) ) {
00224                 ++numCheckpointReq;
00225             }
00226 
00227             if( GetCore()->IsRequiredCheckpointAfter(pc, info) ) {
00228                 ++numCheckpointReq;
00229             }
00230         }
00231 
00232         // checkpointMaster `FbN
00233         if( !thread->GetCheckpointMaster()->CanCreate( numCheckpointReq ) ) {
00234             ++m_stallCycles.checkpoint;
00235             param.canFetch = false;
00236             return param.canFetch;
00237         }
00238 
00239         if( !thread->GetInorderList()->CanAllocate( numOp ) ){
00240             ++m_stallCycles.inorderList;
00241             param.canFetch = false;
00242             return param.canFetch;
00243         }
00244 
00245         // 
00246         if( reqSerializing ){
00247             // A
00248             InorderList* inorderList = thread->GetInorderList();
00249             if( m_evaluated.isInorderListEmpty && inorderList->IsEmpty() ){
00250                 param.canFetch = true;
00251                 return param.canFetch;
00252             }
00253             else {
00254                 ++m_stallCycles.nextSyscall;
00255                 param.canFetch = false;
00256                 return param.canFetch;
00257             }
00258         }
00259 
00260         param.canFetch = true;
00261     }
00262     return param.canFetch;
00263 
00264 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::CanFetchBody ( FetchDecisionHookParam param  )  [protected]

Fetcher.cpp182 行で定義されています。

00183 {
00184 }

void Fetcher::Commit ( OpIterator  op  )  [virtual]

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

Fetcher.cpp424 行で定義されています。

参照先 Onikiri::BPred::Commit()GetBPred().

参照元 Onikiri::InorderList::NotifyCommit().

00425 {
00426     GetBPred()->Commit(op);
00427 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::CreateCheckpoint ( OpIterator  op  )  [protected]

Fetcher.cpp330 行で定義されています。

参照先 Onikiri::CheckpointMaster::CreateCheckpoint()Onikiri::PipelineNodeBase::GetCore().

参照元 Update().

00331 {
00332     const PC& pc = op->GetPC();
00333     OpInfo* const opInfo = op->GetOpInfo();
00334 
00335     if( GetCore()->IsRequiredCheckpointBefore(pc, opInfo) ){
00336         CheckpointMaster* master = op->GetThread()->GetCheckpointMaster();
00337         Checkpoint* newCheckpoint = master->CreateCheckpoint();
00338         op->SetBeforeCheckpoint( newCheckpoint );
00339     }
00340 
00341     if( GetCore()->IsRequiredCheckpointAfter(pc, opInfo) ){
00342         CheckpointMaster* master = op->GetThread()->GetCheckpointMaster();
00343         Checkpoint* newCheckpoint = master->CreateCheckpoint();
00344         op->SetAfterCheckpoint( newCheckpoint );
00345     }
00346 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::EnterPipeline ( OpIterator  op,
int  nextEventCycle 
) [protected]

Fetcher.cpp409 行で定義されています。

参照先 Onikiri::Pipeline::EnterPipeline()Onikiri::PipelineNodeBase::GetLowerPipeline()Onikiri::PipelineNodeBase::GetLowerPipelineNode()Onikiri::OpStatus::OS_FETCH.

参照元 Update().

00410 {
00411     GetLowerPipeline()->EnterPipeline( 
00412         op, 
00413         nextEventCycle, 
00414         GetLowerPipelineNode() 
00415     );
00416     op->SetStatus( OpStatus::OS_FETCH );
00417 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::Evaluate (  )  [virtual]

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

Fetcher.cpp429 行で定義されています。

参照先 Onikiri::ClockedResourceBase::Evaluate()Onikiri::Fetcher::Evaluated::fetchPCOnikiri::Fetcher::Evaluated::fetchThreadOnikiri::Thread::GetFetchPC()GetFetchThread()Onikiri::Thread::GetInorderList()Onikiri::InorderList::IsEmpty()Onikiri::Fetcher::Evaluated::isInorderListEmptyIsSerializingRequired()m_evaluatedOnikiri::Fetcher::Evaluated::reqSerializing.

00430 {
00431     // Actually fetched ops in this cycle are determined with 'updated'.
00432     Evaluated updated;
00433     updated.fetchThread = GetFetchThread( false );
00434     
00435     if( updated.fetchThread ){
00436         updated.fetchPC = updated.fetchThread->GetFetchPC();
00437 
00438         // In serializing state.
00439         InorderList* inorderList = updated.fetchThread->GetInorderList();
00440         updated.isInorderListEmpty = inorderList->IsEmpty();
00441         updated.reqSerializing = 
00442             ( !updated.isInorderListEmpty && IsSerializingRequired( updated.fetchThread ) );
00443     }
00444 
00445     m_evaluated = updated;
00446     BaseType::Evaluate();
00447 }

関数の呼び出しグラフ:

void Fetcher::Fetch ( Thread thread,
FetchedOpArray fetchedOp,
PC  pc,
OpInfo **  infoArray,
int  numOp 
) [protected]

Fetcher.cpp290 行で定義されています。

参照先 Onikiri::GlobalClock::AddInsnID()Onikiri::fixed_sized_buffer< T, SIZE, Tag >::clear()Onikiri::InorderList::ConstructOp()Onikiri::DS_FETCHOnikiri::Dumper::Dump()Onikiri::g_dumperOnikiri::PipelineNodeBase::GetCore()Onikiri::Thread::GetInorderList()Onikiri::GlobalClock::GetInsnID()Onikiri::Thread::GetOpRetiredID()Onikiri::Thread::GetOpSerialID()HOOK_SECTION_PARAMm_forwardEmulatorm_globalClockOnikiri::ForwardEmulator::OnFetch()Onikiri::fixed_sized_buffer< T, SIZE, Tag >::push_back()Onikiri::InorderList::PushBack()s_fetchHook.

参照元 Update().

00291 {
00292     InorderList* InorderList = thread->GetInorderList();
00293     Core* core = GetCore();
00294 
00295     u64 baseSerialID = thread->GetOpSerialID();
00296     u64 baseRetireID = thread->GetOpRetiredID();
00297 
00298     fetchedOp.clear();
00299     for( int mopIndex = 0; mopIndex < numOp; ++mopIndex ) {
00300 
00301         FetchHookParam param;
00302         HOOK_SECTION_PARAM( s_fetchHook, param ){
00303             OpInitArgs args = 
00304             {
00305                 &pc,                        // PC*      pc;
00306                 infoArray[ mopIndex ],      // OpInfo* opInfo;
00307                 mopIndex,                   // int      no;
00308                 m_globalClock->GetInsnID(), // u64      globalSerialID;
00309                 baseSerialID + mopIndex,    // u64      serialID;
00310                 baseRetireID + mopIndex,    // u64      retireID;
00311                 core,                       // Core*        core;
00312                 thread                      // Thread*  thread;
00313             };
00314 
00315             OpIterator op = InorderList->ConstructOp( args );
00316             param.op = op;
00317 
00318             g_dumper.Dump( DS_FETCH, op );
00319 
00320             fetchedOp.push_back( op );
00321             InorderList->PushBack( op );
00322 
00323             m_globalClock->AddInsnID( 1 );
00324             m_forwardEmulator->OnFetch( op );
00325         }   // HOOK_SECTION_PARAM( s_fetchHook, param ){
00326 
00327     }   // for( int mopIndex = 0; mopIndex < numOp; ++mopIndex ) {
00328 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::Finalize (  )  [virtual]

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

Fetcher.cpp135 行で定義されています。

参照先 Onikiri::Fetcher::StallCycles::checkpointOnikiri::Fetcher::StallCycles::currentSyscallOnikiri::ClockedResourceBase::GetStalledCycles()Onikiri::Fetcher::StallCycles::inorderListm_stallCyclesOnikiri::Fetcher::StallCycles::nextSyscallOnikiri::Fetcher::StallCycles::othersOnikiri::PhysicalResourceNode::ReleaseParam()Onikiri::Fetcher::StallCycles::total.

00136 {
00137     m_stallCycles.others = GetStalledCycles();
00138 
00139     m_stallCycles.total = m_stallCycles.others;
00140     // These stalls are not implemented by using ClockedResource sytem.
00141     m_stallCycles.total +=
00142         m_stallCycles.currentSyscall +  
00143         m_stallCycles.nextSyscall +
00144         m_stallCycles.checkpoint +
00145         m_stallCycles.inorderList;
00146 
00147     ReleaseParam();
00148 }

関数の呼び出しグラフ:

void Fetcher::Finished ( OpIterator  op  ) 

Fetcher.cpp419 行で定義されています。

参照先 Onikiri::BPred::Finished()GetBPred().

参照元 Onikiri::OpFinishEvent::Update().

00420 {
00421     GetBPred()->Finished(op);
00422 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::ForEachOp ( FetchedOpArray c,
int  size,
void(Fetcher::*)(OpIterator func 
) [inline, protected]

Fetcher.cpp267 行で定義されています。

参照元 Update().

00271 {
00272     for( int i = 0; i < size; i++ ){
00273         (this->*func)(c[i]);
00274     }
00275 }

Here is the caller graph for this function:

template<typename T1>
void Fetcher::ForEachOpArg1 ( FetchedOpArray c,
int  size,
T1  arg1,
void(Fetcher::*)(OpIterator, T1)  func 
) [inline, protected]

Fetcher.cpp278 行で定義されています。

参照元 Update().

00283 {
00284     for( int i = 0; i < size; i++ ){
00285         (this->*func)(c[i], arg1);
00286     }
00287 }

Here is the caller graph for this function:

BPred* Onikiri::Fetcher::GetBPred (  )  const [inline]

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

参照先 m_bpred.

参照元 Commit()Finished()PredictNextPCBody()Onikiri::InorderSystem::Run().

00161 { return m_bpred;       }

Here is the caller graph for this function:

EmulatorIF* Onikiri::Fetcher::GetEmulator (  )  const [inline]

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

参照先 m_emulator.

00162 { return m_emulator;    }

Thread * Fetcher::GetFetchThread ( bool  Update  )  [protected]

Fetcher.cpp587 行で定義されています。

参照先 HOOK_SECTION_PARAMm_fetchThreadSteererOnikiri::PipelineNodeBase::m_threads_fetchSteeringHookOnikiri::FetchThreadSteererIF::SteerThread()Onikiri::Fetcher::SteeringHookParam::targetThread.

参照元 Evaluate()Update().

00588 {
00589     SteeringHookParam hookParam = { NULL, &m_thread, update };
00590     
00591     HOOK_SECTION_PARAM( s_fetchSteeringHook, hookParam ){
00592         hookParam.targetThread = m_fetchThreadSteerer->SteerThread(update);
00593     }
00594 
00595 
00596     return hookParam.targetThread;
00597 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

const int Onikiri::Fetcher::GetFetchWidth (  )  const [inline]

Fetcher.h160 行で定義されています。

参照元 Onikiri::MemOrderManager::Initialize()Onikiri::InorderList::Initialize()Update().

00160 { return m_fetchWidth;}

Here is the caller graph for this function:

const int Fetcher::GetICacheReadLatency ( const PC pc  )  [protected]

Fetcher.cpp599 行で定義されています。

参照先 Onikiri::MemAccess::addressOnikiri::CacheSystem::GetFirstLevelInsnCache()Onikiri::CacheAccessResult::latencym_cacheSystemOnikiri::CacheAccess::opOnikiri::CacheAccess::OT_READOnikiri::Cache::Read()Onikiri::CacheAccess::type.

参照元 Update().

00600 {
00601     // LbVANZXL
00602     // pANZX
00603     CacheAccess access;
00604     access.address = pc;
00605     access.type = CacheAccess::OT_READ;
00606     access.op = OpIterator();   // Todo: add a valid op
00607     CacheAccessResult result = 
00608         m_cacheSystem->GetFirstLevelInsnCache()->Read( access, NULL );
00609     return result.latency;
00610 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

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

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

Fetcher.cpp98 行で定義されています。

参照先 Onikiri::PhysicalResourceNode::CheckNodeInitialized()Onikiri::PipelineNodeBase::DisableLatch()Onikiri::CacheSystem::GetFirstLevelInsnCache()Onikiri::PipelineNodeBase::GetLowerPipelineNode()Onikiri::Cache::GetStaticLatency()Onikiri::PhysicalResourceNode::INIT_POST_CONNECTIONOnikiri::PhysicalResourceNode::INIT_PRE_CONNECTIONOnikiri::PipelineNodeBase::Initialize()Onikiri::ParamExchange::LoadParam()m_bpredm_cacheSystemm_checkLatencyMismatchm_emulatorm_fetchLatencym_globalClockTHROW_RUNTIME_ERROR.

00099 {
00100     PipelineNodeBase::Initialize(phase);
00101 
00102     if(phase == INIT_PRE_CONNECTION){
00103         LoadParam();
00104     }
00105     else if(phase == INIT_POST_CONNECTION){
00106 
00107         // Check whether the member variables are set correctly.
00108         CheckNodeInitialized( "emulator", m_emulator );
00109         CheckNodeInitialized( "bpred",    m_bpred );
00110         CheckNodeInitialized( "cacheSystem",   m_cacheSystem );
00111         CheckNodeInitialized( "globalClock",   m_globalClock );
00112 
00113         int iCacheLatency = m_cacheSystem->GetFirstLevelInsnCache()->GetStaticLatency();
00114         if( m_checkLatencyMismatch && m_fetchLatency != iCacheLatency ){
00115             THROW_RUNTIME_ERROR( 
00116                 "'@FetchLatency' and the latency of the L1 I-cache do not match. "
00117                 "If this configuration is intended, disable '@CheckLatencyMismatch'."
00118             );
00119         }
00120 
00121         if( m_fetchLatency < iCacheLatency ){
00122             THROW_RUNTIME_ERROR( 
00123                 "'@FetchLatency' is shorter than the latency of the L1 I-cache." 
00124             );
00125         }
00126 
00127         if( GetLowerPipelineNode() == NULL ){
00128             THROW_RUNTIME_ERROR( "Renamer is not connected." );
00129         }
00130 
00131         DisableLatch();
00132     }
00133 }

関数の呼び出しグラフ:

bool Fetcher::IsSerializingRequired ( Thread thread  )  const [protected]

Fetcher.cpp161 行で定義されています。

参照先 Onikiri::InorderList::GetCommittedFrontOp()Onikiri::InorderList::GetFrontOp()Onikiri::Thread::GetInorderList()Onikiri::InorderList::IsEmpty()Onikiri::OpIterator::IsNull()IsSerializingRequired().

00162 {
00163     // RAXg[
00164     InorderList* inorderList = thread->GetInorderList();
00165     OpIterator frontCommittedOp = inorderList->GetCommittedFrontOp();
00166     OpIterator frontOp          = inorderList->GetFrontOp();
00167 
00168     // In serializing state.
00169     if( !inorderList->IsEmpty() &&
00170         ( ( !frontOp.IsNull() && IsSerializingRequired( frontOp ) ) ||
00171           ( !frontCommittedOp.IsNull() && IsSerializingRequired( frontCommittedOp ) ) )
00172     ){
00173         return true;
00174     }
00175     else{
00176         return false;
00177     }
00178 }

関数の呼び出しグラフ:

bool Fetcher::IsSerializingRequired ( OpIterator  op  )  const [protected]

Fetcher.cpp156 行で定義されています。

参照先 IsSerializingRequired().

00157 {
00158     return IsSerializingRequired( op->GetOpInfo() );
00159 }

関数の呼び出しグラフ:

bool Fetcher::IsSerializingRequired ( const OpInfo *const   info  )  const [protected]

Fetcher.cpp151 行で定義されています。

参照先 Onikiri::OpInfo::GetOpClass()Onikiri::OpClass::IsSyscall().

参照元 CanFetch()Evaluate()IsSerializingRequired().

00152 {
00153     return info->GetOpClass().IsSyscall();
00154 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

Onikiri::Fetcher::PARAM_ENTRY ( "@CheckLatencyMismatch"  ,
m_checkLatencyMismatch   
)

Onikiri::Fetcher::PARAM_ENTRY ( "@IdealMode"  ,
m_idealMode   
)

Onikiri::Fetcher::PARAM_ENTRY ( "@FetchLatency"  ,
m_fetchLatency   
)

void Fetcher::PredictNextPC ( OpIterator  op,
PC  fetchGroupPC 
) [protected]

Fetcher.cpp396 行で定義されています。

参照先 Onikiri::Fetcher::BranchPredictionHookParam::fetchGroupPCOnikiri::HookEntry()Onikiri::Fetcher::BranchPredictionHookParam::opPredictNextPCBody()s_branchPredictionHook.

参照元 Update().

00397 {
00398     BranchPredictionHookParam param;
00399     param.fetchGroupPC = fetchGroupPC;
00400     param.op = op;
00401 
00402     HookEntry( this, &Fetcher::PredictNextPCBody, &s_branchPredictionHook, &param);
00403 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::PredictNextPCBody ( BranchPredictionHookParam param  )  [protected]

Fetcher.cpp365 行で定義されています。

参照先 Onikiri::Fetcher::BranchPredictionHookParam::fetchGroupPCGetBPred()Onikiri::Fetcher::BranchPredictionHookParam::opOnikiri::LogicalData::pidOnikiri::BPred::Predict()Onikiri::LogicalData::tid.

参照元 PredictNextPC().

00366 {
00367     PC predPC;
00368 
00369     PC fetchGroupPC = param->fetchGroupPC;
00370     OpIterator op = param->op;
00371     // {tFb`O[v1BTB
00372     // tFb`O[vBTB
00373     if (op->GetOpClass().IsBranch()) {
00374         predPC = GetBPred()->Predict( op, fetchGroupPC );
00375 
00376         // BTB/RAS Gg CPID
00377         predPC.pid = fetchGroupPC.pid;
00378         predPC.tid = fetchGroupPC.tid;
00379     }
00380     else {
00381         SimPC pc(op->GetPC());
00382         predPC = pc.Next();
00383     }
00384 
00385     op->SetPredPC( predPC );
00386 /*
00387     ASSERT(
00388         op->GetPC().pid == op->GetPredPC().pid,
00389         "predicted pid not match."
00390     );
00391 */
00392 
00393 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Fetcher::SetInitialNumFetchedOp ( u64  num  ) 

Fetcher.cpp612 行で定義されています。

参照先 m_numFetchedOp.

00613 {
00614     m_numFetchedOp = num;
00615     // Todo: thread retireID lR[h
00616 }

void Fetcher::Update (  )  [virtual]

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

Fetcher.cpp450 行で定義されています。

参照先 Onikiri::Thread::AddOpRetiredID()Onikiri::Thread::AddOpSerialID()Onikiri::Addr::addressASSERTBackupOnCheckpoint()CanFetch()CreateCheckpoint()Onikiri::Fetcher::StallCycles::currentSyscallEnterPipeline()Fetch()Onikiri::Fetcher::Evaluated::fetchPCOnikiri::Fetcher::Evaluated::fetchThreadForEachOp()ForEachOpArg1()Onikiri::Thread::GetFetchPC()GetFetchThread()GetFetchWidth()Onikiri::CacheSystem::GetFirstLevelInsnCache()GetICacheReadLatency()Onikiri::Cache::GetOffsetBitSize()Onikiri::EmulatorIF::GetOp()m_cacheSystemm_emulatorm_evaluatedm_fetchLatencym_idealModem_numBranchInFetchGroupm_numFetchedOpm_numFetchedPCm_numFetchGroupm_stallCyclesPredictNextPC()Onikiri::Fetcher::Evaluated::reqSerializingOnikiri::Thread::SetFetchPC()Onikiri::PipelineNodeBase::StallNextCycle().

00451 {
00452 
00453     const int cacheOffsetBitSize = 
00454         m_cacheSystem->GetFirstLevelInsnCache()->GetOffsetBitSize();
00455 
00456     // tFb`O[v (CanFetchgp) 
00457     m_numBranchInFetchGroup = 0;
00458 
00459     Thread* fetchThread = GetFetchThread( true );
00460     if( !fetchThread ){
00461         // RASXbhI
00462         return;
00463     }
00464     if( m_evaluated.reqSerializing ){
00465         ++m_stallCycles.currentSyscall;
00466         return;
00467     }
00468 
00469     ASSERT( m_evaluated.fetchThread == fetchThread );
00470 
00471     PC fetchGroupPC = fetchThread->GetFetchPC();
00472     if( fetchGroupPC != m_evaluated.fetchPC ){
00473         // Branch prediction miss recovery is done 
00474         return;
00475     }
00476 
00477     int numFetchedPC = 0;
00478 
00479     for(int i = 0; i < GetFetchWidth(); ++i) {
00480         // emu
00481         const SimPC pc = fetchThread->GetFetchPC();
00482 
00483         if( m_idealMode )
00484             fetchGroupPC = pc;
00485 
00486         if( pc.address == 0 )
00487             break;
00488 
00489         // LbVCEtFb`I
00490         if( !m_idealMode &&
00491             (fetchGroupPC.address >> cacheOffsetBitSize) != 
00492             (pc.address >> cacheOffsetBitSize)
00493         ){
00494             break;
00495         }
00496 
00497         pair<OpInfo**, int> ops = m_emulator->GetOp(pc);
00498 
00499         OpInfo** opArray = ops.first;
00500         int numOp = ops.second;
00501 
00502         // emulator nPCI
00503         if( opArray == 0 || opArray[0] == 0)
00504             break;
00505 
00506         // tFb`tFb`I
00507         if( !CanFetch(fetchThread, pc, opArray, numOp) ) {
00508             break;
00509         }
00510 
00511         /*
00512         for( int k = 0; k < numOp; ++k ) {
00513         // fetch
00514         // checkpoint at decode
00515         ...
00516         // next pc update
00517         // checkpoint at dispatch
00518         // dispatch
00519         }
00520         `R
00521 
00522         PCOp11APCr
00523         `FbN|Cg\
00524         AtFb`PCPsA
00525         XVPCPs
00526 
00527         F
00528         PCrタsNextPC
00529         \~XolKv
00530         */
00531 
00532         // fetch
00533         FetchedOpArray fetchedOp;
00534         Fetch( fetchThread, fetchedOp, pc, opArray, numOp );
00535 
00536         // Kv`FbN|Cg
00537         ForEachOp( fetchedOp, numOp, &Fetcher::CreateCheckpoint );
00538         ForEachOpArg1( fetchedOp, numOp, true/*before*/, &Fetcher::BackupOnCheckpoint );
00539 
00540         fetchThread->AddOpSerialID( numOp );
00541         fetchThread->AddOpRetiredID( numOp );
00542 
00543         // update serialID & retireID
00544         m_numFetchedOp              += numOp;
00545         numFetchedPC++;
00546 
00547         // bpred
00548         ForEachOpArg1( fetchedOp, numOp, fetchGroupPC, &Fetcher::PredictNextPC );
00549 
00550         // next pc update
00551         fetchThread->SetFetchPC( fetchedOp[numOp - 1]->GetPredPC() );
00552         
00553         ForEachOpArg1( fetchedOp, numOp, false/*before*/, &Fetcher::BackupOnCheckpoint );
00554 
00555         // Register the fetched ops to the fetch pipeline.
00556         // Delay of I-Cache miss is implemented in the following stall process.
00557         ForEachOpArg1( fetchedOp, numOp, m_fetchLatency - 1, &Fetcher::EnterPipeline );
00558 
00559         // I-Cache Hit/miss decision
00560         int iCacheReadLatency = GetICacheReadLatency(pc);
00561 
00562         // -1 CTCN
00563         int stallCycles = iCacheReadLatency - m_fetchLatency - 1;   
00564         if( stallCycles > 0 ) {
00565             StallNextCycle( stallCycles );
00566         }
00567 
00568         // <TODO> tFb`O[vuwKE\
00569         // takentFb`O[vI
00570         if( !m_idealMode && 
00571             fetchedOp[numOp - 1]->GetPredPC() != pc.Next() 
00572         ){
00573             break;
00574         }
00575     }
00576 
00577     // 1tFb`tFb`O[v
00578     if( numFetchedPC > 0 ){
00579         m_numFetchGroup++;
00580     }
00581 
00582     m_numFetchedPC += numFetchedPC;
00583 }

関数の呼び出しグラフ:


変数

BPred* Onikiri::Fetcher::m_bpred [protected]

Fetcher.h236 行で定義されています。

参照元 GetBPred()Initialize().

CacheSystem* Onikiri::Fetcher::m_cacheSystem [protected]

Fetcher.h239 行で定義されています。

参照元 GetICacheReadLatency()Initialize()Update().

bool Onikiri::Fetcher::m_checkLatencyMismatch [protected]

Fetcher.h208 行で定義されています。

参照元 Initialize().

int Onikiri::Fetcher::m_currentFetchThread [protected]

Fetcher.h210 行で定義されています。

EmulatorIF* Onikiri::Fetcher::m_emulator [protected]

Fetcher.h242 行で定義されています。

参照元 GetEmulator()Initialize()Update().

struct Onikiri::Fetcher::Evaluated Onikiri::Fetcher::m_evaluated [protected]

参照元 CanFetch()Evaluate()Update().

int Onikiri::Fetcher::m_fetchLatency [protected]

Fetcher.h193 行で定義されています。

参照元 Initialize()Update().

FetchThreadSteererIF* Onikiri::Fetcher::m_fetchThreadSteerer [protected]

Fetcher.h251 行で定義されています。

参照元 GetFetchThread().

int Onikiri::Fetcher::m_fetchWidth [protected]

Fetcher.h192 行で定義されています。

Onikiri::Fetcher::m_fetchWidth

Fetcher.h109 行で定義されています。

ForwardEmulator* Onikiri::Fetcher::m_forwardEmulator [protected]

Fetcher.h248 行で定義されています。

参照元 Fetch().

GlobalClock* Onikiri::Fetcher::m_globalClock [protected]

Fetcher.h245 行で定義されています。

参照元 Fetch()Initialize().

bool Onikiri::Fetcher::m_idealMode [protected]

Fetcher.h206 行で定義されています。

参照元 CanFetch()Update().

const int Onikiri::Fetcher::m_maxBranchInFetchGroup = 1 [static, protected]

Fetcher.h204 行で定義されています。

参照元 CanFetch().

int Onikiri::Fetcher::m_numBranchInFetchGroup [protected]

Fetcher.h202 行で定義されています。

参照元 CanFetch()Update().

u64 Onikiri::Fetcher::m_numFetchedOp [protected]

Fetcher.h196 行で定義されています。

参照元 SetInitialNumFetchedOp()Update().

u64 Onikiri::Fetcher::m_numFetchedPC [protected]

Fetcher.h198 行で定義されています。

Onikiri::Fetcher::m_numFetchedPC

Fetcher.h128 行で定義されています。

参照元 Update().

u64 Onikiri::Fetcher::m_numFetchGroup [protected]

Fetcher.h200 行で定義されています。

参照元 Update().

struct Onikiri::Fetcher::StallCycles Onikiri::Fetcher::m_stallCycles [protected]

参照元 CanFetch()Finalize()Update().

HookPoint< Fetcher, Fetcher::BranchPredictionHookParam > Onikiri::Fetcher::s_branchPredictionHook [static]

Fetcher.h182 行で定義されています。

参照元 PredictNextPC().

HookPoint< Fetcher, Fetcher::FetchDecisionHookParam > Onikiri::Fetcher::s_fetchDecisionHook [static]

Fetcher.h178 行で定義されています。

参照元 CanFetch().

HookPoint< Fetcher, Fetcher::FetchHookParam > Onikiri::Fetcher::s_fetchHook [static]

Fetcher.h170 行で定義されています。

参照元 Fetch()Onikiri::SampleHookModule::Initialize().

HookPoint< Fetcher, Fetcher::SteeringHookParam > Onikiri::Fetcher::s_fetchSteeringHook [static]

Fetcher.h174 行で定義されています。

参照元 GetFetchThread().


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