20#ifndef __SIMPLE_LT_TARGET1_H__
21#define __SIMPLE_LT_TARGET1_H__
71 assert(address < 400);
75 std::cout <<
name() <<
": Received write request: A = 0x"
76 << std::hex << (
unsigned int)address
77 <<
", D = 0x" <<
data << std::dec
80 *
reinterpret_cast<unsigned int*
>(&
mMem[address]) =
data;
84 std::cout <<
name() <<
": Received read request: A = 0x"
85 << std::hex << (
unsigned int)address << std::dec
88 data = *
reinterpret_cast<unsigned int*
>(&
mMem[address]);
99 if (r.get_address() >= 400)
return 0;
101 unsigned int tmp = (int)r.get_address();
102 unsigned int num_bytes;
103 if (tmp + r.get_data_length() >= 400) {
104 num_bytes = 400 - tmp;
107 num_bytes = r.get_data_length();
110 for (
unsigned int i = 0; i < num_bytes; ++i) {
111 r.get_data_ptr()[i] =
mMem[i + tmp];
115 for (
unsigned int i = 0; i < num_bytes; ++i) {
116 mMem[i + tmp] = r.get_data_ptr()[i];
149 socket->invalidate_direct_mem_ptr(start_address, end_address);
target_socket_type socket
tlm::tlm_generic_payload transaction_type
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
sc_core::sc_time m_invalidate_dmi_time
tlm::tlm_sync_enum sync_enum_type
void b_transport(transaction_type &trans, sc_core::sc_time &t)
unsigned int transport_dbg(transaction_type &r)
tlm::tlm_bw_transport_if bw_interface_type
tlm::tlm_fw_transport_if fw_interface_type
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
SimpleLTTarget1(sc_core::sc_module_name name, bool invalidate=false)
void invalidate_dmi_method()
tlm::tlm_phase phase_type
sc_core::sc_event m_invalidate_dmi_event
SC_HAS_PROCESS(SimpleLTTarget1)
tlm::tlm_target_socket< 32 > target_socket_type
const char * name() const
void set_write_latency(sc_core::sc_time t)
void set_dmi_ptr(unsigned char *p)
void set_start_address(sc_dt::uint64 addr)
void set_end_address(sc_dt::uint64 addr)
void set_read_latency(sc_core::sc_time t)
unsigned char * get_data_ptr() const
void set_dmi_allowed(bool dmi_allowed)
void set_response_status(const tlm_response_status response_status)
sc_dt::uint64 get_address() const
tlm_command get_command() const
const sc_time & sc_time_stamp()