32 #ifndef __SIMPLE_LT_INITIATOR3_DMI_H__
33 #define __SIMPLE_LT_INITIATOR3_DMI_H__
36 #include "tlm_utils/simple_initiator_socket.h"
57 unsigned int nrOfTransactions = 0x5,
58 unsigned int baseAddress = 0x0) :
92 trans.set_data_ptr(
reinterpret_cast<unsigned char*
>(&
mData));
93 trans.set_data_length(4);
94 trans.set_streaming_width(4);
95 trans.set_dmi_allowed(
false);
105 std::cout <<
name() <<
": Send write request: A = 0x"
106 << std::hex << (
unsigned int)trans.get_address()
107 <<
", D = 0x" <<
mData << std::dec
111 std::cout <<
name() <<
": Send read request: A = 0x"
112 << std::hex << (
unsigned int)trans.get_address() << std::dec
120 std::cout <<
name() <<
": Received error response @ "
124 std::cout <<
name() <<
": Received ok response";
126 std::cout <<
": D = 0x" << std::hex <<
mData << std::dec;
166 if((trans.get_address() < dmi_data.first.get_start_address()) ||
167 (trans.get_address() > dmi_data.first.get_end_address()) )
171 socket->get_direct_mem_ptr(trans,
173 trans.set_address(address);
176 if (dmi_data.second &&
177 (trans.get_address() >= dmi_data.first.get_start_address()) &&
178 (trans.get_address() <= dmi_data.first.get_end_address()) )
185 sc_dt::uint64 tmp = trans.get_address() - dmi_data.first.get_start_address();
188 *(
unsigned int*)&dmi_data.first.get_dmi_ptr()[tmp] =
mData;
192 mData = *(
unsigned int*)&dmi_data.first.get_dmi_ptr()[tmp];
199 wait(dmi_data.first.get_write_latency());
202 wait(dmi_data.first.get_read_latency());