Go to the documentation of this file.
20 #ifndef __SIMPLE_LT_TARGET1_H__
21 #define __SIMPLE_LT_TARGET1_H__
71 assert(address < 400);
73 unsigned int&
data = *
reinterpret_cast<unsigned int*
>(trans.get_data_ptr());
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]);
94 trans.set_dmi_allowed(
true);
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);
152 unsigned char mMem[400];
target_socket_type socket
SimpleLTTarget1(sc_core::sc_module_name name, bool invalidate=false)
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
SC_HAS_PROCESS(SimpleLTTarget1)
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
tlm::tlm_target_socket< 32 > target_socket_type
void set_end_address(sc_dt::uint64 addr)
void set_read_latency(sc_core::sc_time t)
tlm::tlm_generic_payload transaction_type
sc_core::sc_event m_invalidate_dmi_event
unsigned int transport_dbg(transaction_type &r)
tlm::tlm_sync_enum sync_enum_type
tlm::tlm_phase phase_type
void set_write_latency(sc_core::sc_time t)
const char * name() const
void b_transport(transaction_type &trans, sc_core::sc_time &t)
tlm::tlm_fw_transport_if fw_interface_type
void set_dmi_ptr(unsigned char *p)
void set_start_address(sc_dt::uint64 addr)
void invalidate_dmi_method()
const sc_time & sc_time_stamp()
sc_core::sc_time m_invalidate_dmi_time
tlm::tlm_bw_transport_if bw_interface_type
Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17