// // Cannot use DMI through plug & play devices. This is probably OK for present. // bool getDMIPointer(int SocketId, transaction_type& trans, tlm::tlm_dmi& dmi_data) { Addr address = trans.get_address(); Addr offset; int portId = getPortId(address, offset); Bool result = false; if(portId >= 0) { initiator_socket_type* decodeSocket = &initiator_socket[portId]; // send on the transaction with the new address, adjusted for the decoder offset trans.set_address(offset); result = (*decodeSocket)->get_direct_mem_ptr(trans, dmi_data); // put the address back how it was trans.set_address(address); // Should always succeed Addr start = dmi_data.get_start_address(); Addr end = dmi_data.get_end_address(); if (result) { // Range must contain address assert(start <= offset); assert(end >= offset); } adjustRange(portId, address, start, end); dmi_data.set_start_address(start); dmi_data.set_end_address(end); } return result; }
// // LT protocol // - forward each call to the target/initiator // void initiatorBTransport(int SocketId, transaction_type& trans, sc_core::sc_time& t) { Addr orig = trans.get_address(); Addr offset; int portId = getPortId(orig, offset); if(portId >= 0) { if(m_trace) { icmPrintf("TLM: %s decode:0x" FMT_64x " -> initiator_socket[%d]\n", name(), orig, portId); } // It is a static port ? initiator_socket_type *decodeSocket = &initiator_socket[portId]; trans.set_address(offset); (*decodeSocket)->b_transport(trans, t); } else { // might be a dynamic port, so try each un-set port till one responds int i; for(i = 0; i < NR_OF_TARGETS; i++) { if (!decodes[i]) { initiator_socket_type *decodeSocket = &initiator_socket[i]; (*decodeSocket)->b_transport(trans, t); if (trans.get_response_status() == tlm::TLM_OK_RESPONSE) { if(m_trace) { icmPrintf("TLM: %s dynamic:0x" FMT_64x " -> initiator_socket[%d]\n", name(), orig, i); } break; } } } } }
unsigned int transportDebug(int SocketId, transaction_type& trans) { Addr orig = trans.get_address(); Addr offset; int portId = getPortId(orig, offset); if(portId >= 0) { if(m_trace) { icmPrintf("TLM: %s dbg decode:0x" FMT_64x " -> initiator_socket[%d]\n", name(), orig, portId); } // It is a static port ? initiator_socket_type *decodeSocket = &initiator_socket[portId]; trans.set_address(offset); return (*decodeSocket)->transport_dbg(trans); } else { for(int i = 0; i < NR_OF_TARGETS; i++) { if (!decodes[i]) { initiator_socket_type *decodeSocket = &initiator_socket[i]; int r = (*decodeSocket)->transport_dbg(trans); if (r) { if(m_trace) { icmPrintf("TLM: %s dbg dynamic:0x" FMT_64x " -> initiator_socket[%d]\n", name(), orig, i); } return r; } } } return 0; } }
CIEC_ANY *CBasicFB::getInternalVar(CStringDictionary::TStringId pa_nInternalName){ CIEC_ANY *retVal = 0; if(0 != cm_pstVarInternals){ TPortId unVarId = getPortId(pa_nInternalName, cm_pstVarInternals->m_nNumIntVars, cm_pstVarInternals->m_aunIntVarsNames); if(cg_unInvalidPortId != unVarId){ retVal = getVarInternal(unVarId); } } return retVal; }