32 #ifndef __SIMPLE_LT_INITIATOR2_DMI_H__ 33 #define __SIMPLE_LT_INITIATOR2_DMI_H__ 36 #include "tlm_utils/simple_initiator_socket.h" 58 unsigned int nrOfTransactions = 0x5,
59 unsigned int baseAddress = 0x0) :
107 std::cout <<
name() <<
": Send write request: A = 0x" 109 <<
", D = 0x" <<
mData << std::dec
113 std::cout <<
name() <<
": Send read request: A = 0x" 114 << std::hex << (
unsigned int)trans.
get_address() << std::dec
122 std::cout <<
name() <<
": Received error response @ " 126 std::cout <<
name() <<
": Received ok response";
128 std::cout <<
": D = 0x" << std::hex <<
mData << std::dec;
146 transaction_type trans;
168 if((trans.
get_address() < dmi_data.first.get_start_address()) ||
169 (trans.
get_address() > dmi_data.first.get_end_address()) )
173 socket->get_direct_mem_ptr(trans,
178 if (dmi_data.second &&
179 (trans.
get_address() >= dmi_data.first.get_start_address()) &&
180 (trans.
get_address() <= dmi_data.first.get_end_address()) )
189 *(
unsigned int*)&dmi_data.first.get_dmi_ptr()[tmp] =
mData;
193 mData = *(
unsigned int*)&dmi_data.first.get_dmi_ptr()[tmp];
200 wait(dmi_data.first.get_write_latency());
203 wait(dmi_data.first.get_read_latency());
208 socket->b_transport(trans, t);
237 std::cout <<
name() <<
", <<SimpleLTInitiator1>>:" << std::endl
239 unsigned char data[32];
241 transaction_type trans;
247 unsigned int n = socket->transport_dbg(trans);
249 std::cout <<
"Mem @" << std::hex <<
mBaseAddress << std::endl;
266 for (
unsigned int i=0;
i<
n;
i+=4)
268 for (
int k=e_start;
k!=e_end;
k+=e_increment)
270 std::cout << std::setw(2) << std::setfill(
'0')
275 std::cout << std::endl;
284 std::cout <<
"OK: debug transaction didn't give data." << std::endl;
286 std::cout << std::dec << std::endl;
sc_core::sc_event mEndEvent
void set_response_status(const tlm_response_status response_status)
std::pair< dmi_type, bool > & getDMIData(const transaction_type &trans)
void set_streaming_width(const unsigned int streaming_width)
void register_invalidate_direct_mem_ptr(MODULE *mod, void(MODULE::*cb)(sc_dt::uint64, sc_dt::uint64))
tlm::tlm_sync_enum sync_enum_type
void logEndTransaction(transaction_type &trans)
const char * name() const
bool initTransaction(transaction_type &trans)
sc_dt::uint64 get_address() const
SimpleLTInitiator2_dmi(sc_core::sc_module_name name, unsigned int nrOfTransactions=0x5, unsigned int baseAddress=0x0)
unsigned int mNrOfTransactions
initiator_socket_type socket
void set_address(const sc_dt::uint64 address)
unsigned int mBaseAddress
std::pair< dmi_type, bool > mDMIDataReads
std::pair< dmi_type, bool > mDMIDataWrites
bool host_has_little_endianness()
void set_data_ptr(unsigned char *data)
unsigned int mTransactionCount
void logStartTransation(transaction_type &trans)
tlm::tlm_generic_payload transaction_type
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
const sc_time & sc_time_stamp()
tlm_response_status get_response_status() const
const sc_time SC_ZERO_TIME
void set_dmi_allowed(bool dmi_allowed)
tlm_command get_command() const
void set_command(const tlm_command command)
tlm::tlm_phase phase_type
tlm_utils::simple_initiator_socket< SimpleLTInitiator2_dmi > initiator_socket_type
void set_data_length(const unsigned int length)
SC_HAS_PROCESS(SimpleLTInitiator2_dmi)