#include <Fetcher.h>
Onikiri::Fetcherに対する継承グラフ
typedef PipelineNodeBase Onikiri::Fetcher::BaseType [protected] |
typedef fixed_sized_buffer< OpIterator, SimISAInfo::MAX_OP_INFO_COUNT_PER_PC, Fetcher > Onikiri::Fetcher::FetchedOpArray [protected] |
Fetcher::Fetcher | ( | ) |
Fetcher.cpp の 75 行で定義されています。
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] |
void Fetcher::BackupOnCheckpoint | ( | OpIterator | op, | |
bool | before | |||
) | [protected] |
Fetcher.cpp の 348 行で定義されています。
参照先 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() | ) |
Fetcher.cpp の 187 行で定義されています。
参照先 Onikiri::InorderList::CanAllocate()・Onikiri::CheckpointMaster::CanCreate()・Onikiri::Fetcher::FetchDecisionHookParam::canFetch・Onikiri::Fetcher::StallCycles::checkpoint・Onikiri::Fetcher::StallCycles::currentSyscall・Onikiri::Thread::GetCheckpointMaster()・Onikiri::PipelineNodeBase::GetCore()・Onikiri::Thread::GetInorderList()・HOOK_SECTION_PARAM・Onikiri::Fetcher::StallCycles::inorderList・Onikiri::InorderList::IsEmpty()・Onikiri::Fetcher::Evaluated::isInorderListEmpty・IsSerializingRequired()・m_evaluated・m_idealMode・m_maxBranchInFetchGroup・m_numBranchInFetchGroup・m_stallCycles・Onikiri::Fetcher::StallCycles::nextSyscall・s_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] |
void Fetcher::Commit | ( | OpIterator | op | ) | [virtual] |
Onikiri::PipelineNodeBaseを再定義しています。
Fetcher.cpp の 424 行で定義されています。
参照先 Onikiri::BPred::Commit()・GetBPred().
参照元 Onikiri::InorderList::NotifyCommit().
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Fetcher::CreateCheckpoint | ( | OpIterator | op | ) | [protected] |
Fetcher.cpp の 330 行で定義されています。
参照先 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.cpp の 409 行で定義されています。
参照先 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.cpp の 429 行で定義されています。
参照先 Onikiri::ClockedResourceBase::Evaluate()・Onikiri::Fetcher::Evaluated::fetchPC・Onikiri::Fetcher::Evaluated::fetchThread・Onikiri::Thread::GetFetchPC()・GetFetchThread()・Onikiri::Thread::GetInorderList()・Onikiri::InorderList::IsEmpty()・Onikiri::Fetcher::Evaluated::isInorderListEmpty・IsSerializingRequired()・m_evaluated・Onikiri::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.cpp の 290 行で定義されています。
参照先 Onikiri::GlobalClock::AddInsnID()・Onikiri::fixed_sized_buffer< T, SIZE, Tag >::clear()・Onikiri::InorderList::ConstructOp()・Onikiri::DS_FETCH・Onikiri::Dumper::Dump()・Onikiri::g_dumper・Onikiri::PipelineNodeBase::GetCore()・Onikiri::Thread::GetInorderList()・Onikiri::GlobalClock::GetInsnID()・Onikiri::Thread::GetOpRetiredID()・Onikiri::Thread::GetOpSerialID()・HOOK_SECTION_PARAM・m_forwardEmulator・m_globalClock・Onikiri::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.cpp の 135 行で定義されています。
参照先 Onikiri::Fetcher::StallCycles::checkpoint・Onikiri::Fetcher::StallCycles::currentSyscall・Onikiri::ClockedResourceBase::GetStalledCycles()・Onikiri::Fetcher::StallCycles::inorderList・m_stallCycles・Onikiri::Fetcher::StallCycles::nextSyscall・Onikiri::Fetcher::StallCycles::others・Onikiri::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.cpp の 419 行で定義されています。
参照先 Onikiri::BPred::Finished()・GetBPred().
参照元 Onikiri::OpFinishEvent::Update().
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Fetcher::ForEachOp | ( | FetchedOpArray & | c, | |
int | size, | |||
void(Fetcher::*)(OpIterator) | func | |||
) | [inline, protected] |
void Fetcher::ForEachOpArg1 | ( | FetchedOpArray & | c, | |
int | size, | |||
T1 | arg1, | |||
void(Fetcher::*)(OpIterator, T1) | func | |||
) | [inline, protected] |
BPred* Onikiri::Fetcher::GetBPred | ( | ) | const [inline] |
参照先 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] |
Thread * Fetcher::GetFetchThread | ( | bool | Update | ) | [protected] |
Fetcher.cpp の 587 行で定義されています。
参照先 HOOK_SECTION_PARAM・m_fetchThreadSteerer・Onikiri::PipelineNodeBase::m_thread・s_fetchSteeringHook・Onikiri::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] |
参照元 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.cpp の 599 行で定義されています。
参照先 Onikiri::MemAccess::address・Onikiri::CacheSystem::GetFirstLevelInsnCache()・Onikiri::CacheAccessResult::latency・m_cacheSystem・Onikiri::CacheAccess::op・Onikiri::CacheAccess::OT_READ・Onikiri::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.cpp の 98 行で定義されています。
参照先 Onikiri::PhysicalResourceNode::CheckNodeInitialized()・Onikiri::PipelineNodeBase::DisableLatch()・Onikiri::CacheSystem::GetFirstLevelInsnCache()・Onikiri::PipelineNodeBase::GetLowerPipelineNode()・Onikiri::Cache::GetStaticLatency()・Onikiri::PhysicalResourceNode::INIT_POST_CONNECTION・Onikiri::PhysicalResourceNode::INIT_PRE_CONNECTION・Onikiri::PipelineNodeBase::Initialize()・Onikiri::ParamExchange::LoadParam()・m_bpred・m_cacheSystem・m_checkLatencyMismatch・m_emulator・m_fetchLatency・m_globalClock・THROW_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.cpp の 161 行で定義されています。
参照先 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.cpp の 156 行で定義されています。
00157 { 00158 return IsSerializingRequired( op->GetOpInfo() ); 00159 }
関数の呼び出しグラフ:
bool Fetcher::IsSerializingRequired | ( | const OpInfo *const | info | ) | const [protected] |
Fetcher.cpp の 151 行で定義されています。
参照先 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.cpp の 396 行で定義されています。
参照先 Onikiri::Fetcher::BranchPredictionHookParam::fetchGroupPC・Onikiri::HookEntry()・Onikiri::Fetcher::BranchPredictionHookParam::op・PredictNextPCBody()・s_branchPredictionHook.
参照元 Update().
00397 { 00398 BranchPredictionHookParam param; 00399 param.fetchGroupPC = fetchGroupPC; 00400 param.op = op; 00401 00402 HookEntry( this, &Fetcher::PredictNextPCBody, &s_branchPredictionHook, ¶m); 00403 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
void Fetcher::PredictNextPCBody | ( | BranchPredictionHookParam * | param | ) | [protected] |
Fetcher.cpp の 365 行で定義されています。
参照先 Onikiri::Fetcher::BranchPredictionHookParam::fetchGroupPC・GetBPred()・Onikiri::Fetcher::BranchPredictionHookParam::op・Onikiri::LogicalData::pid・Onikiri::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.cpp の 612 行で定義されています。
参照先 m_numFetchedOp.
00613 { 00614 m_numFetchedOp = num; 00615 // Todo: thread retireID lR[h 00616 }
void Fetcher::Update | ( | ) | [virtual] |
Onikiri::ClockedResourceBaseを再定義しています。
Fetcher.cpp の 450 行で定義されています。
参照先 Onikiri::Thread::AddOpRetiredID()・Onikiri::Thread::AddOpSerialID()・Onikiri::Addr::address・ASSERT・BackupOnCheckpoint()・CanFetch()・CreateCheckpoint()・Onikiri::Fetcher::StallCycles::currentSyscall・EnterPipeline()・Fetch()・Onikiri::Fetcher::Evaluated::fetchPC・Onikiri::Fetcher::Evaluated::fetchThread・ForEachOp()・ForEachOpArg1()・Onikiri::Thread::GetFetchPC()・GetFetchThread()・GetFetchWidth()・Onikiri::CacheSystem::GetFirstLevelInsnCache()・GetICacheReadLatency()・Onikiri::Cache::GetOffsetBitSize()・Onikiri::EmulatorIF::GetOp()・m_cacheSystem・m_emulator・m_evaluated・m_fetchLatency・m_idealMode・m_numBranchInFetchGroup・m_numFetchedOp・m_numFetchedPC・m_numFetchGroup・m_stallCycles・PredictNextPC()・Onikiri::Fetcher::Evaluated::reqSerializing・Onikiri::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] |
CacheSystem* Onikiri::Fetcher::m_cacheSystem [protected] |
bool Onikiri::Fetcher::m_checkLatencyMismatch [protected] |
int Onikiri::Fetcher::m_currentFetchThread [protected] |
EmulatorIF* Onikiri::Fetcher::m_emulator [protected] |
struct Onikiri::Fetcher::Evaluated Onikiri::Fetcher::m_evaluated [protected] |
参照元 CanFetch()・Evaluate()・Update().
int Onikiri::Fetcher::m_fetchLatency [protected] |
int Onikiri::Fetcher::m_fetchWidth [protected] |
ForwardEmulator* Onikiri::Fetcher::m_forwardEmulator [protected] |
GlobalClock* Onikiri::Fetcher::m_globalClock [protected] |
bool Onikiri::Fetcher::m_idealMode [protected] |
const int Onikiri::Fetcher::m_maxBranchInFetchGroup = 1 [static, protected] |
int Onikiri::Fetcher::m_numBranchInFetchGroup [protected] |
u64 Onikiri::Fetcher::m_numFetchedOp [protected] |
u64 Onikiri::Fetcher::m_numFetchedPC [protected] |
u64 Onikiri::Fetcher::m_numFetchGroup [protected] |
struct Onikiri::Fetcher::StallCycles Onikiri::Fetcher::m_stallCycles [protected] |
参照元 CanFetch()・Finalize()・Update().