Go to the documentation of this file.
20 #ifndef __SIMPLE_LT_TARGET2_H__
21 #define __SIMPLE_LT_TARGET2_H__
24 #include "tlm_utils/passthrough_target_socket.h"
59 assert(address < 400);
63 std::cout <<
name() <<
": Received write request: A = 0x"
64 << std::hex << (
unsigned int)address
65 <<
", D = 0x" <<
data << std::dec
68 *
reinterpret_cast<unsigned int*
>(&
mMem[address]) =
data;
72 std::cout <<
name() <<
": Received read request: A = 0x"
73 << std::hex << (
unsigned int)address << std::dec
76 data = *
reinterpret_cast<unsigned int*
>(&
mMem[address]);
101 if (
r.get_address() >= 400)
return 0;
103 unsigned int tmp = (int)
r.get_address();
104 unsigned int num_bytes;
105 if (tmp +
r.get_data_length() >= 400) {
106 num_bytes = 400 - tmp;
109 num_bytes =
r.get_data_length();
112 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
113 r.get_data_ptr()[
i] =
mMem[
i + tmp];
117 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
118 mMem[
i + tmp] =
r.get_data_ptr()[
i];
146 unsigned char mMem[400];
void myBTransport(transaction_type &trans, sc_core::sc_time &t)
void set_dmi_allowed(bool dmi_allowed)
target_socket_type socket
void set_end_address(sc_dt::uint64 addr)
tlm_command get_command() const
bool myGetDMIPtr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
sync_enum_type myNBTransport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
tlm::tlm_generic_payload transaction_type
void set_read_latency(sc_core::sc_time t)
void register_b_transport(MODULE *mod, void(MODULE::*cb)(transaction_type &, sc_core::sc_time &))
unsigned int transport_dbg(transaction_type &r)
tlm::tlm_sync_enum sync_enum_type
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(transaction_type &, tlm::tlm_dmi &))
void set_write_latency(sc_core::sc_time t)
tlm_utils::passthrough_target_socket< SimpleLTTarget2 > target_socket_type
const char * name() const
SimpleLTTarget2(sc_core::sc_module_name name)
void set_dmi_ptr(unsigned char *p)
tlm::tlm_phase phase_type
void set_start_address(sc_dt::uint64 addr)
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(transaction_type &, phase_type &, sc_core::sc_time &))
sc_dt::uint64 get_address() const
const sc_time & sc_time_stamp()
unsigned char * get_data_ptr() const
void set_response_status(const tlm_response_status response_status)
Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17