20#ifndef __SIMPLEBUSLT_H__
21#define __SIMPLEBUSLT_H__
26#include "tlm_utils/simple_target_socket.h"
27#include "tlm_utils/simple_initiator_socket.h"
29template <
int NR_OF_INITIATORS,
int NR_OF_TARGETS>
48 for (
unsigned int i = 0; i < NR_OF_INITIATORS; ++i) {
53 for (
unsigned int i = 0; i < NR_OF_TARGETS; ++i) {
66 return (
unsigned int)address >> 28;
101 assert(portId < NR_OF_TARGETS);
105 (*decodeSocket)->b_transport(trans, t);
112 assert(portId < NR_OF_TARGETS);
116 return (*decodeSocket)->transport_dbg(trans);
124 if (low > addressMask) {
129 low += addressOffset;
130 if (high > addressMask) {
131 high = addressOffset + addressMask;
134 high += addressOffset;
145 unsigned int portId =
decode(address);
146 assert(portId < NR_OF_TARGETS);
153 (*decodeSocket)->get_direct_mem_ptr(trans, dmi_data);
181 if (!
limitRange(port_id, start_range, end_range)) {
186 for (
unsigned int i = 0; i < NR_OF_INITIATORS; ++i) {
187 (
target_socket[i])->invalidate_direct_mem_ptr(start_range, end_range);
tlm::tlm_phase phase_type
unsigned int getPortId(const sc_dt::uint64 &address)
target_socket_type target_socket[NR_OF_INITIATORS]
bool getDMIPointer(int SocketId, transaction_type &trans, tlm::tlm_dmi &dmi_data)
tlm::tlm_sync_enum sync_enum_type
initiator_socket_type initiator_socket[NR_OF_TARGETS]
tlm_utils::simple_initiator_socket_tagged< SimpleBusLT > initiator_socket_type
unsigned int decode(const sc_dt::uint64 &address)
SimpleBusLT(sc_core::sc_module_name name)
void initiatorBTransport(int SocketId, transaction_type &trans, sc_core::sc_time &t)
sc_dt::uint64 getAddressMask(unsigned int portId)
SC_HAS_PROCESS(SimpleBusLT)
tlm_utils::simple_target_socket_tagged< SimpleBusLT > target_socket_type
sc_dt::uint64 getAddressOffset(unsigned int portId)
tlm::tlm_generic_payload transaction_type
bool limitRange(unsigned int portId, sc_dt::uint64 &low, sc_dt::uint64 &high)
unsigned int transportDebug(int SocketId, transaction_type &trans)
void invalidateDMIPointers(int port_id, sc_dt::uint64 start_range, sc_dt::uint64 end_range)
const char * name() const
sc_dt::uint64 get_start_address() const
sc_dt::uint64 get_end_address() const
void set_start_address(sc_dt::uint64 addr)
void set_end_address(sc_dt::uint64 addr)
void set_address(const sc_dt::uint64 address)
sc_dt::uint64 get_address() const
void register_invalidate_direct_mem_ptr(MODULE *mod, void(MODULE::*cb)(int, sc_dt::uint64, sc_dt::uint64), int id)
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(int id, transaction_type &), int id)
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(int id, transaction_type &, tlm::tlm_dmi &), int id)
void register_b_transport(MODULE *mod, void(MODULE::*cb)(int id, transaction_type &, sc_core::sc_time &), int id)