本文整理汇总了C++中tlm::tlm_generic_payload::is_response_error方法的典型用法代码示例。如果您正苦于以下问题:C++ tlm_generic_payload::is_response_error方法的具体用法?C++ tlm_generic_payload::is_response_error怎么用?C++ tlm_generic_payload::is_response_error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlm::tlm_generic_payload
的用法示例。
在下文中一共展示了tlm_generic_payload::is_response_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void leon3_funcat_trap::TLMMemory::peq_cb( tlm::tlm_generic_payload & trans, const \
tlm::tlm_phase & phase ){
// Payload event queue callback to handle transactions from target
// Transaction could have arrived through return path or backward path
if (phase == tlm::END_REQ || (&trans == request_in_progress && phase == tlm::BEGIN_RESP)){
// The end of the BEGIN_REQ phase
request_in_progress = NULL;
end_request_event.notify();
}
else if (phase == tlm::BEGIN_REQ || phase == tlm::END_RESP){
SC_REPORT_FATAL("TLM-2", "Illegal transaction phase received by initiator");
}
if (phase == tlm::BEGIN_RESP){
if (trans.is_response_error()){
SC_REPORT_ERROR("TLM-2", ("Transaction returned with error, response status = " + \
trans.get_response_string()).c_str());
}
// Send final phase transition to target
tlm::tlm_phase fw_phase = tlm::END_RESP;
sc_time delay = SC_ZERO_TIME;
initSocket->nb_transport_fw(trans, fw_phase, delay);
if (trans.is_response_error()){
SC_REPORT_ERROR("TLM-2", ("Transaction returned with error, response status = " + \
trans.get_response_string()).c_str());
}
this->end_response_event.notify(delay);
}
}
示例2: b_transport
//Method used for receiving acknowledgements of interrupts; the ack consists of
//uninteresting data and the address corresponds to the interrupt signal to
//be lowered
//As a response, I lower the interrupt by sending a NULL pointer on the init_socket
void b_transport(tlm::tlm_generic_payload& trans, sc_time& delay) {
if(this->lastIrq < 0) {
THROW_EXCEPTION("Error, lowering an interrupt which hasn't been raised yet!!");
}
tlm::tlm_command cmd = trans.get_command();
sc_dt::uint64 adr = trans.get_address();
unsigned char* ptr = trans.get_data_ptr();
if(trans.get_command() == tlm::TLM_READ_COMMAND) {
THROW_EXCEPTION("Error, the read request is not currently supported by external PINs");
}
else if(cmd == tlm::TLM_WRITE_COMMAND) {
if(this->lastIrq != adr) {
THROW_EXCEPTION("Error, lowering interrupt " << std::hex << std::showbase << (unsigned)adr << " while " << std::hex << std::showbase << this->lastIrq << " was raised");
}
else {
//finally I can really lower the interrupt: I send 0 on
//the initSocked
unsigned char data = 0;
trans.set_data_ptr(&data);
trans.set_dmi_allowed(false);
trans.set_response_status( tlm::TLM_INCOMPLETE_RESPONSE );
sc_time delay;
this->init_socket->b_transport(trans, delay);
if(trans.is_response_error()) {
std::string errorStr("Error in b_transport of PIN, response status = " + trans.get_response_string());
SC_REPORT_ERROR("TLM-2", errorStr.c_str());
}
this->lastIrq = -1;
}
}
trans.set_response_status(tlm::TLM_OK_RESPONSE);
}
示例3: check_transaction
// Called on receiving BEGIN_RESP or TLM_COMPLETED
void check_transaction(tlm::tlm_generic_payload& trans)
{
if ( trans.is_response_error() )
{
char txt[100];
sprintf(txt, "Transaction returned with error, response status = %s",
trans.get_response_string().c_str());
SC_REPORT_ERROR("TLM-2", txt);
}
tlm::tlm_command cmd = trans.get_command();
sc_dt::uint64 adr = trans.get_address();
int* ptr = reinterpret_cast<int*>( trans.get_data_ptr() );
fout << hex << adr << " " << name() << " check, cmd=" << (cmd ? 'W' : 'R')
<< ", data=" << hex << *ptr << " at time " << sc_time_stamp() << endl;
// Allow the memory manager to free the transaction object
trans.release();
}