Go to the documentation of this file.
20 #ifndef __EXPLICIT_LT_TARGET_H__
21 #define __EXPLICIT_LT_TARGET_H__
24 #include "tlm_utils/simple_target_socket.h"
56 assert(address < 400);
60 std::cout <<
name() <<
": Received write request: A = 0x"
61 << std::hex << (
unsigned int)address <<
", D = 0x" <<
data
65 *
reinterpret_cast<unsigned int*
>(&
mMem[address]) =
data;
75 *
reinterpret_cast<unsigned int*
>(&
mMem[address]);
78 std::cout <<
name() <<
": Received read request: A = 0x"
79 << std::hex << (
unsigned int)address
83 data = *
reinterpret_cast<unsigned int*
>(&
mMem[address]);
94 if (
r.get_address() >= 400)
return 0;
96 unsigned int tmp = (int)
r.get_address();
97 unsigned int num_bytes;
98 if (tmp +
r.get_data_length() >= 400) {
99 num_bytes = 400 - tmp;
102 num_bytes =
r.get_data_length();
104 if (!
r.is_read() && !
r.is_write()) {
108 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
113 for (
unsigned int i = 0;
i < num_bytes; ++
i) {
114 mMem[
i + tmp] =
r.get_data_ptr()[
i];
121 unsigned char mMem[400];
void register_b_transport(MODULE *mod, void(MODULE::*cb)(transaction_type &, sc_core::sc_time &))
target_socket_type socket
const sc_time SC_ZERO_TIME
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(transaction_type &))
ExplicitLTTarget(sc_core::sc_module_name name)
tlm::tlm_generic_payload transaction_type
void myBTransport(transaction_type &trans, sc_core::sc_time &t)
tlm::tlm_phase phase_type
tlm_command get_command() const
tlm::tlm_sync_enum sync_enum_type
unsigned int transport_dbg(transaction_type &r)
const char * name() const
tlm_utils::simple_target_socket< ExplicitLTTarget > target_socket_type
SC_HAS_PROCESS(ExplicitLTTarget)
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