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];
tlm::tlm_sync_enum sync_enum_type
target_socket_type socket
void myBTransport(transaction_type &trans, sc_core::sc_time &t)
SimpleLTTarget2(sc_core::sc_module_name name)
unsigned int transport_dbg(transaction_type &r)
sync_enum_type myNBTransport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
bool myGetDMIPtr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
tlm::tlm_phase phase_type
tlm_utils::passthrough_target_socket< SimpleLTTarget2 > target_socket_type
tlm::tlm_generic_payload transaction_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
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(transaction_type &, tlm::tlm_dmi &))
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(transaction_type &, phase_type &, sc_core::sc_time &))
void register_b_transport(MODULE *mod, void(MODULE::*cb)(transaction_type &, sc_core::sc_time &))
const sc_time & sc_time_stamp()