#include <PerfectMemDepPred.h>
Onikiri::PerfectMemDepPredに対する継承グラフ
Public メソッド | |
virtual void | Allocate (OpIterator op) |
virtual bool | CanAllocate (OpIterator *infoArray, int numOp) |
virtual void | Commit (OpIterator op) |
virtual void | Flush (OpIterator op) |
virtual void | Initialize (InitPhase phase) |
virtual void | OrderConflicted (OpIterator producer, OpIterator consumer) |
PerfectMemDepPred () | |
virtual void | Resolve (OpIterator op) |
virtual | ~PerfectMemDepPred () |
Protected 変数 | |
ForwardEmulator * | m_fwdEmulator |
InorderList * | m_inorderList |
SharedPtrObjectPool< MemDependency > | m_memDepPool |
MemOrderOperations | m_memOperations |
PerfectMemDepPred.h の 46 行で定義されています。
PerfectMemDepPred::PerfectMemDepPred | ( | ) |
PerfectMemDepPred.cpp の 44 行で定義されています。
00044 : 00045 m_fwdEmulator( NULL ), 00046 m_inorderList( NULL ) 00047 { 00048 00049 }
PerfectMemDepPred::~PerfectMemDepPred | ( | ) | [virtual] |
PerfectMemDepPred.cpp の 51 行で定義されています。
参照先 Onikiri::PhysicalResourceNode::ReleaseParam().
00052 { 00053 ReleaseParam(); 00054 }
関数の呼び出しグラフ:
void PerfectMemDepPred::Allocate | ( | OpIterator | op | ) | [virtual] |
Onikiri::MemDepPredIFを実装しています。
PerfectMemDepPred.cpp の 149 行で定義されています。
参照先 m_memDepPool.
00150 { 00151 if( !op->GetOpClass().IsMem() ) { 00152 return; 00153 } 00154 00155 // Allocate and assign a memory dependency. 00156 if( op->GetDstMem(0) == NULL ) { 00157 MemDependencyPtr tmpMem( 00158 m_memDepPool.construct( op->GetCore()->GetNumScheduler() ) 00159 ); 00160 tmpMem->Clear(); 00161 op->SetDstMem( 0, tmpMem ); 00162 } 00163 }
bool PerfectMemDepPred::CanAllocate | ( | OpIterator * | infoArray, | |
int | numOp | |||
) | [virtual] |
void PerfectMemDepPred::Commit | ( | OpIterator | op | ) | [virtual] |
void PerfectMemDepPred::Flush | ( | OpIterator | op | ) | [virtual] |
void PerfectMemDepPred::Initialize | ( | InitPhase | phase | ) | [virtual] |
PerfectMemDepPred.cpp の 56 行で定義されています。
参照先 Onikiri::PhysicalResourceNode::CheckNodeInitialized()・Onikiri::ForwardEmulator::GetEmulator()・Onikiri::EmulatorIF::GetISAInfo()・Onikiri::ISAInfoIF::GetMaxMemoryAccessByteSize()・Onikiri::PhysicalResourceNode::INIT_POST_CONNECTION・Onikiri::PhysicalResourceNode::INIT_PRE_CONNECTION・Onikiri::ForwardEmulator::IsEnabled()・Onikiri::ISAInfoIF::IsLittleEndian()・Onikiri::ParamExchange::LoadParam()・m_fwdEmulator・m_inorderList・m_memOperations・Onikiri::MemOrderOperations::SetAlignment()・Onikiri::MemOrderOperations::SetTargetEndian()・THROW_RUNTIME_ERROR.
00057 { 00058 // Do not call "Initialize()" of a proxy target object, 00059 // because the "Initialize()" is called by the resource system. 00060 00061 if( phase == INIT_PRE_CONNECTION ){ 00062 LoadParam(); 00063 } 00064 else if( phase == INIT_POST_CONNECTION ){ 00065 CheckNodeInitialized( "forwardEmulator", m_fwdEmulator ); 00066 CheckNodeInitialized( "inorderList", m_inorderList ); 00067 00068 // Set endian information to the memory operation object. 00069 ISAInfoIF* isa = m_fwdEmulator->GetEmulator()->GetISAInfo(); 00070 m_memOperations.SetTargetEndian( isa->IsLittleEndian() ); 00071 m_memOperations.SetAlignment( isa->GetMaxMemoryAccessByteSize() ); 00072 00073 if( !m_fwdEmulator->IsEnabled() ){ 00074 THROW_RUNTIME_ERROR( 00075 "A perfect memory dependency predictor requires that a forawrd emulator is enabled." 00076 ); 00077 } 00078 } 00079 }
関数の呼び出しグラフ:
void PerfectMemDepPred::OrderConflicted | ( | OpIterator | producer, | |
OpIterator | consumer | |||
) | [virtual] |
Onikiri::MemDepPredIFを実装しています。
PerfectMemDepPred.cpp の 175 行で定義されています。
参照先 ASSERT.
00176 { 00177 ASSERT( 00178 false, 00179 "A perfect memory dependency predictor must not predict incorrect dependencies. \n\n" 00180 "Conflicted producer:\n %s\n\nConflicted consumer:\n%s\n", 00181 producer->ToString(6).c_str(), 00182 consumer->ToString(6).c_str() 00183 ); 00184 }
void PerfectMemDepPred::Resolve | ( | OpIterator | op | ) | [virtual] |
Onikiri::MemDepPredIFを実装しています。
PerfectMemDepPred.cpp の 81 行で定義されています。
参照先 ASSERT・Onikiri::ForwardEmulator::GetMemoryAccessResult()・Onikiri::InorderList::GetPrevIndexOp()・Onikiri::ForwardEmulator::IsInMissPredictedPath()・Onikiri::OpClass::IsLoad()・Onikiri::OpClass::IsMem()・Onikiri::OpIterator::IsNull()・Onikiri::MemOrderOperations::IsOverlapped()・Onikiri::MemOrderOperations::IsOverlappedInAligned()・Onikiri::OpClass::IsStore()・m_fwdEmulator・m_inorderList・m_memDepPool・m_memOperations・Onikiri::MemAccess::ToString().
00082 { 00083 const OpClass& opClass = op->GetOpClass(); 00084 00085 if( !opClass.IsMem() ){ 00086 // Not loads/stores ops do not have memory dependencies. 00087 return; 00088 } 00089 00090 if( m_fwdEmulator->IsInMissPredictedPath( op ) ){ 00091 if( opClass.IsLoad() ){ 00092 // If an op is in a mis-predicted path, 00093 // a dummy dependency that is never satisfied is set. 00094 MemDependencyPtr tmpMem( 00095 m_memDepPool.construct( op->GetCore()->GetNumScheduler() ) 00096 ); 00097 tmpMem->Clear(); 00098 op->SetSrcMem( 0, tmpMem ); 00099 } 00100 // It is no problem that sores are executed. 00101 return; 00102 } 00103 00104 00105 // Check memory addresses executed in a forward emulator, and 00106 // set a dependency to an actually dependent op. 00107 00108 const MemAccess* consumer = m_fwdEmulator->GetMemoryAccessResult( op ); 00109 //if( !consumer ) return; 00110 ASSERT( consumer != NULL, "Could not get a pre-executed memory access result. %s", op->ToString(6).c_str() ); 00111 00112 bool consumerIsStore = opClass.IsStore(); 00113 00114 OpIterator i = m_inorderList->GetPrevIndexOp( op ); 00115 00116 // Search a dependent store from 'op'. 00117 while( !i.IsNull() ){ 00118 00119 if( !i->GetOpClass().IsStore() ){ 00120 i = m_inorderList->GetPrevIndexOp( i ); 00121 continue; 00122 } 00123 00124 const MemAccess* producer = m_fwdEmulator->GetMemoryAccessResult( i ); 00125 //if( !producer ) return; 00126 ASSERT( producer != NULL, "Could not get a pre-executed memory access result. %s", op->ToString(6).c_str() ); 00127 00128 00129 if( consumerIsStore ){ 00130 // A store is dependent to a store with the same aligned address, 00131 // because the predictor cannot determine which store is a producer 00132 // of a load when partial read occurs. 00133 if( m_memOperations.IsOverlappedInAligned( *consumer, *producer ) ){ 00134 op->SetSrcMem( 0, i->GetDstMem(0) ); 00135 break; 00136 } 00137 } 00138 else{ 00139 if( m_memOperations.IsOverlapped( *consumer, *producer ) ){ 00140 op->SetSrcMem( 0, i->GetDstMem(0) ); 00141 break; 00142 } 00143 } 00144 00145 i = m_inorderList->GetPrevIndexOp( i ); 00146 } 00147 }
関数の呼び出しグラフ:
ForwardEmulator* Onikiri::PerfectMemDepPred::m_fwdEmulator [protected] |
InorderList* Onikiri::PerfectMemDepPred::m_inorderList [protected] |