Go to the documentation of this file.
20 #ifndef __SIMPLE_LT_TARGET2_H__
21 #define __SIMPLE_LT_TARGET2_H__
24 #include "tlm_utils/simple_target_socket.h"
71 std::cout <<
name() <<
": ERROR, extension not present" << std::endl;
75 std::cout <<
name() <<
": OK, extension data = "
76 << tmp_ext->
m_data << std::endl;
83 std::cout <<
name() <<
": Received write request: A = 0x"
84 << std::hex << (
unsigned int)address
85 <<
", D = 0x" <<
data << std::dec
88 *
reinterpret_cast<unsigned int*
>(&
mMem[address]) =
data;
92 std::cout <<
name() <<
": Received read request: A = 0x"
93 << std::hex << (
unsigned int)address << std::dec
96 data = *
reinterpret_cast<unsigned int*
>(&
mMem[address]);
112 if (
r.get_address() >= 400)
return 0;
114 unsigned int tmp = (int)
r.get_address();
115 unsigned int num_bytes;
116 if (tmp +
r.get_data_length() >= 400) {
117 num_bytes = 400 - tmp;
120 num_bytes =
r.get_data_length();
123 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
124 r.get_data_ptr()[
i] =
mMem[
i + tmp];
128 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
129 mMem[
i + tmp] =
r.get_data_ptr()[
i];
144 trans.get_extension(tmp_ext);
147 std::cout <<
name() <<
": get_direct_mem_ptr OK, extension data = "
148 <<tmp_ext->
m_data << std::endl;
152 std::cout <<
name() <<
", get_direct_mem_ptr ERROR: "
153 <<
"didn't get pointer to extension"
156 if (trans.get_address() < 400) {
178 socket->invalidate_direct_mem_ptr(start_address, end_address);
181 unsigned char mMem[400];
tlm::tlm_sync_enum sync_enum_type
target_socket_type socket
bool myGetDMIPtr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
sc_core::sc_time m_invalidate_dmi_time
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(transaction_type &))
void set_dmi_allowed(bool dmi_allowed)
sc_core::sc_event m_invalidate_dmi_event
void set_end_address(sc_dt::uint64 addr)
tlm_command get_command() const
tlm::tlm_generic_payload transaction_type
void set_read_latency(sc_core::sc_time t)
SimpleLTTarget_ext(sc_core::sc_module_name name, sc_core::sc_time invalidate_dmi_time=sc_core::sc_time(25, sc_core::SC_NS))
sync_enum_type myNBTransport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(transaction_type &, tlm::tlm_dmi &))
void get_extension(T *&ext) const
tlm_utils::simple_target_socket< SimpleLTTarget_ext, 32, my_extended_payload_types > target_socket_type
void invalidate_dmi_method()
void set_write_latency(sc_core::sc_time t)
tlm::tlm_phase phase_type
const char * name() const
void set_dmi_ptr(unsigned char *p)
void set_start_address(sc_dt::uint64 addr)
unsigned int transport_dbg(transaction_type &r)
SC_HAS_PROCESS(SimpleLTTarget_ext)
sc_dt::uint64 get_address() const
const sc_time & sc_time_stamp()
unsigned char * get_data_ptr() const
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(transaction_type &, phase_type &, sc_core::sc_time &))
void set_response_status(const tlm_response_status response_status)
Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17