Go to the documentation of this file.
20 #ifndef __SIMPLEBUSAT_H__
21 #define __SIMPLEBUSAT_H__
26 #include "tlm_utils/simple_target_socket.h"
27 #include "tlm_utils/simple_initiator_socket.h"
29 #include "tlm_utils/peq_with_get.h"
31 template <
int NR_OF_INITIATORS,
int NR_OF_TARGETS>
52 for (
unsigned int i = 0;
i < NR_OF_INITIATORS; ++
i) {
57 for (
unsigned int i = 0;
i < NR_OF_TARGETS; ++
i) {
74 return (
unsigned int)address >> 28;
107 assert(portId < NR_OF_TARGETS);
114 it->second.to = decodeSocket;
121 switch ((*decodeSocket)->nb_transport_fw(*trans, phase,
t)) {
143 if (it->second.from) {
146 (*it->second.from)->nb_transport_bw(*trans, phase,
t);
185 switch ((*initiatorSocket)->nb_transport_bw(*trans, phase,
t)) {
237 std::cout <<
"ERROR: '" <<
name()
238 <<
"': Illegal phase received from initiator." << std::endl;
239 assert(
false);
exit(1);
251 std::cout <<
"ERROR: '" <<
name()
252 <<
"': Illegal phase received from target." << std::endl;
253 assert(
false);
exit(1);
266 unsigned int portId =
decode(trans.get_address());
267 assert(portId < NR_OF_TARGETS);
269 trans.set_address( trans.get_address() &
getAddressMask(portId) );
271 return (*decodeSocket)->transport_dbg(trans);
279 if (low > addressMask) {
284 low += addressOffset;
285 if (high > addressMask) {
286 high = addressOffset + addressMask;
289 high += addressOffset;
301 unsigned int portId =
decode(address);
302 assert(portId < NR_OF_TARGETS);
306 trans.set_address(maskedAddress);
309 (*decodeSocket)->get_direct_mem_ptr(trans, dmi_data);
337 if ((portId >= 0) && !
limitRange(portId, start_range, end_range)) {
342 for (
unsigned int i = 0;
i < NR_OF_INITIATORS; ++
i) {
343 (
target_socket[
i])->invalidate_direct_mem_ptr(start_range, end_range);
358 struct ConnectionInfo {
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(int id, transaction_type &), int id)
transaction_type * get_next_transaction()
tlm_utils::simple_target_socket_tagged< SimpleBusAT > target_socket_type
void register_invalidate_direct_mem_ptr(MODULE *mod, void(MODULE::*cb)(int, sc_dt::uint64, sc_dt::uint64), int id)
void register_nb_transport_bw(MODULE *mod, sync_enum_type(MODULE::*cb)(int, transaction_type &, phase_type &, sc_core::sc_time &), int id)
tlm_utils::peq_with_get< transaction_type > mRequestPEQ
unsigned int getPortId(const sc_dt::uint64 &address)
bool getDMIPointer(int initiator_id, transaction_type &trans, tlm::tlm_dmi &dmi_data)
sc_core::sc_event mEndRequestEvent
sc_dt::uint64 getAddressMask(unsigned int portId)
sc_core::sc_event mBeginRequestEvent
void invalidateDMIPointers(int portId, sc_dt::uint64 start_range, sc_dt::uint64 end_range)
unsigned int decode(const sc_dt::uint64 &address)
const sc_time SC_ZERO_TIME
tlm::tlm_sync_enum sync_enum_type
void notify(transaction_type &trans, const sc_core::sc_time &t)
sync_enum_type targetNBTransport(int portId, transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
tlm::tlm_generic_payload transaction_type
sc_core::sc_event & get_event()
unsigned int transportDebug(int initiator_id, transaction_type &trans)
void set_end_address(sc_dt::uint64 addr)
target_socket_type * from
PendingTransactions::const_iterator PendingTransactionsConstIterator
sc_dt::uint64 get_end_address() const
target_socket_type target_socket[NR_OF_INITIATORS]
sc_core::sc_event mEndResponseEvent
sc_dt::uint64 get_start_address() const
sync_enum_type initiatorNBTransport(int initiator_id, transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
sc_dt::uint64 getAddressOffset(unsigned int portId)
SC_HAS_PROCESS(SimpleBusAT)
SimpleBusAT(sc_core::sc_module_name name)
tlm_utils::simple_initiator_socket_tagged< SimpleBusAT > initiator_socket_type
tlm_utils::peq_with_get< transaction_type > mResponsePEQ
std::map< transaction_type *, ConnectionInfo > PendingTransactions
bool limitRange(unsigned int portId, sc_dt::uint64 &low, sc_dt::uint64 &high)
initiator_socket_type initiator_socket[NR_OF_TARGETS]
PendingTransactions::iterator PendingTransactionsIterator
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(int id, transaction_type &, phase_type &, sc_core::sc_time &), int id)
const char * name() const
void set_address(const sc_dt::uint64 address)
tlm::tlm_phase phase_type
PendingTransactions mPendingTransactions
void set_start_address(sc_dt::uint64 addr)
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(int id, transaction_type &, tlm::tlm_dmi &), int id)
initiator_socket_type * to
sc_dt::uint64 get_address() const
void addPendingTransaction(transaction_type &trans, initiator_socket_type *to, int initiatorId)
sc_core::sc_event mBeginResponseEvent
Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17