本文整理汇总了C++中tlm::tlm_generic_payload::is_response_ok方法的典型用法代码示例。如果您正苦于以下问题:C++ tlm_generic_payload::is_response_ok方法的具体用法?C++ tlm_generic_payload::is_response_ok怎么用?C++ tlm_generic_payload::is_response_ok使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlm::tlm_generic_payload
的用法示例。
在下文中一共展示了tlm_generic_payload::is_response_ok方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: b_transport
virtual void b_transport( int id, tlm::tlm_generic_payload& trans, sc_time& delay )
{
int target_nr = 0;
sc_dt::uint64 address = trans.get_address();
sc_dt::uint64 read_address = 0;
sc_dt::uint64 write_address = 0 ;
decode_address( address, read_address, write_address, id, startAdr[id]);
if(id == 0){//Writer
writeAllowed = true;
trans.set_address(write_address);
(*init_socket[target_nr])->b_transport(trans, delay);
cout << "\tID is: " << id << " - After calling b_transport in Switch: " << endl;
if(trans.is_response_ok() && writerCounter < startAdr[id + 1])
writerCounter = writerCounter + 8; // Change since now 8-bit words.
if(trans.is_response_ok() && writerCounter >= startAdr[id + 1]){
writeAllowed = false;
mtfAllowed = true;
}
}
else if(id == 1){//mtf
if(mtfAllowed == true){
if(trans.get_command() == tlm::TLM_WRITE_COMMAND)
trans.set_address( write_address );
if(trans.get_command() == tlm::TLM_READ_COMMAND)
trans.set_address(read_address);
(*init_socket[target_nr])->b_transport(trans, delay);
cout << "\tID is: " << id << " - After calling b_transport in Switch: " << endl;
if(trans.is_response_ok() && MTFCounter < startAdr[id + 1])
MTFCounter = MTFCounter + 8; // Change since now 8-bit words.
if(trans.is_response_ok() && MTFCounter >= startAdr[id + 1]){
runAllowed.write(true);
}
}
}
else if(id == 2){//runL
if(runAllowed == true){
if(trans.get_command() == tlm::TLM_WRITE_COMMAND)
trans.set_address( write_address );
if(trans.get_command() == tlm::TLM_READ_COMMAND)
trans.set_address(read_address);
(*init_socket[target_nr])->b_transport(trans, delay);
//cout << "\tID is: " << id << " - After calling b_transport in Switch: " << endl;
if(trans.is_response_ok() && runCounter < startAdr[id + 1])
runCounter = runCounter + 8; // Change since now 8-bit words.
if(trans.is_response_ok() && runCounter >= startAdr[id + 1]- startAdr[id]){
readAllowed.write(true);
}
}
}
else if(id == 3){//Reader
if(readAllowed == true){
if(trans.get_command() == tlm::TLM_READ_COMMAND)
trans.set_address(read_address );
(*init_socket[target_nr])->b_transport(trans, delay);
//cout << "\tID is: " << id << " - After calling b_transport in Switch: " << endl;
if(readCounter <= startAdr[id]- startAdr[id - 1]){
readCounter = readCounter + 8; // Change since now 8-bit words.
trans.set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
}
else if(readCounter > startAdr[id]- startAdr[id - 1]){
trans.set_response_status(tlm::TLM_OK_RESPONSE);
}
}
else
trans.set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
}
}