本文整理汇总了C++中tlm::tlm_generic_payload::set_address方法的典型用法代码示例。如果您正苦于以下问题:C++ tlm_generic_payload::set_address方法的具体用法?C++ tlm_generic_payload::set_address怎么用?C++ tlm_generic_payload::set_address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlm::tlm_generic_payload
的用法示例。
在下文中一共展示了tlm_generic_payload::set_address方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
// Tagged non-blocking transport forward method
virtual tlm::tlm_sync_enum nb_transport_fw(int id,
tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay)
{
assert (id < targ_socket.size());
// Forward path
m_id_map[ &trans ] = id;
sc_dt::uint64 address = trans.get_address();
sc_dt::uint64 masked_address;
unsigned int target_nr = decode_address( address, masked_address);
if (target_nr < init_socket.size())
{
// Modify address within transaction
trans.set_address( masked_address );
// Forward transaction to appropriate target
tlm::tlm_sync_enum status = init_socket[target_nr]->nb_transport_fw(trans, phase, delay);
if (status == tlm::TLM_COMPLETED)
// Put back original address
trans.set_address( address );
return status;
}
else
return tlm::TLM_COMPLETED;
}
示例2:
// Tagged debug transaction method
virtual unsigned int transport_dbg(int id, tlm::tlm_generic_payload& trans)
{
sc_dt::uint64 masked_address;
unsigned int target_nr = decode_address( trans.get_address(), masked_address );
if (target_nr >= init_socket.size())
return 0;
trans.set_address( masked_address );
// Forward debug transaction to appropriate target
return init_socket[target_nr]->transport_dbg( trans );
}
示例3: b_transport
// Tagged TLM-2 blocking transport method
virtual void b_transport( int id, tlm::tlm_generic_payload& trans, sc_time& delay )
{
assert (id < targ_socket.size());
// Forward path
sc_dt::uint64 address = trans.get_address();
sc_dt::uint64 masked_address;
unsigned int target_nr = decode_address( address, masked_address);
if (target_nr < init_socket.size())
{
// Modify address within transaction
trans.set_address( masked_address );
// Forward transaction to appropriate target
init_socket[target_nr]->b_transport(trans, delay);
// Replace original address
trans.set_address( address );
}
}
示例4: b_transport
void FastBus::b_transport(tlm::tlm_generic_payload &trans,
sc_core::sc_time &t) {
ensitlm::addr_t a = trans.get_address();
addr_map_t::iterator it = addr_map.find(addr_range(a, a));
if (it == addr_map.end()) {
std::cerr << name() << ": no target at address "
<< std::showbase << std::hex << a << std::endl;
trans.set_response_status(tlm::TLM_ADDRESS_ERROR_RESPONSE);
return;
}
trans.set_address(a - (*it).first.begin);
initiator[(*it).second]->b_transport(trans, t);
}
示例5: get_direct_mem_ptr
// Tagged TLM-2 forward DMI method
virtual bool get_direct_mem_ptr(int id,
tlm::tlm_generic_payload& trans,
tlm::tlm_dmi& dmi_data)
{
sc_dt::uint64 masked_address;
unsigned int target_nr = decode_address( trans.get_address(), masked_address );
if (target_nr >= init_socket.size())
return false;
trans.set_address( masked_address );
bool status = init_socket[target_nr]->get_direct_mem_ptr( trans, dmi_data );
// Calculate DMI address of target in system address space
dmi_data.set_start_address( compose_address( target_nr, dmi_data.get_start_address() ));
dmi_data.set_end_address ( compose_address( target_nr, dmi_data.get_end_address() ));
return status;
}
示例6: 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);
}
}