20#ifndef __SYSTEMC_EXT_TLM_UTILS_SIMPLE_TARGET_SOCKET_H__
21#define __SYSTEMC_EXT_TLM_UTILS_SIMPLE_TARGET_SOCKET_H__
38template <
typename MODULE,
unsigned int BUSWIDTH,
typename TYPES,
142 m_owner->m_pending_trans.find(&trans);
144 if (it ==
m_owner->m_pending_trans.end()) {
146 return m_owner->bw_nb_transport(trans, phase, t);
155 if (
m_owner->m_current_transaction == &trans) {
158 it->second->notify(t);
159 m_owner->m_pending_trans.erase(it);
162 m_owner->display_error(
"invalid phase received");
169 return m_owner->bw_invalidate_direct_mem_ptr(s, e);
214 "non-blocking callback already registered");
227 "blocking callback already registered");
239 m_owner->display_warning(
"debug callback already registered");
252 "get DMI pointer callback already registered");
300 m_owner->display_error(
"invalid phase received");
304 "no non-blocking transport callback registered");
324 const bool mm_added = !trans.has_mm();
328 trans.set_auto_extension(&mm_ext);
334 m_owner->m_pending_trans[&trans] = &end_event;
341 if (trans.get_ref_count()) {
351 "no blocking transport callback registered");
406 end =
v.end(); it != end; ++it) {
416 for (it =
v.begin(); it !=
v.end(); it++) {
417 if ((*it)->m_suspend) {
419 (*it)->m_trans = trans;
420 (*it)->m_suspend =
false;
459 m_owner->bw_nb_transport(*trans, phase, t);
489 m_owner->m_pending_trans.find(trans);
491 it->second->notify(t);
492 m_owner->m_pending_trans.erase(it);
500 m_owner->m_current_transaction = trans;
502 m_owner->m_current_transaction = 0;
524 m_owner->m_pending_trans.end());
525 it->second->notify(t);
526 m_owner->m_pending_trans.erase(it);
531 m_owner->display_error(
"invalid phase received");
536 m_owner->display_error(
"invalid sync value received");
547 trans->template get_extension<mm_end_event_ext>();
586template <
typename MODULE,
unsigned int BUSWIDTH=32,
597template <
typename MODULE,
unsigned int BUSWIDTH=32,
601 sc_core::SC_ZERO_OR_MORE_BOUND>
613template <
typename MODULE,
unsigned int BUSWIDTH,
typename TYPES,
725 m_owner->m_pending_trans.find(&trans);
727 if (it ==
m_owner->m_pending_trans.end()) {
729 return m_owner->bw_nb_transport(trans, phase, t);
736 if (
m_owner->m_current_transaction == &trans) {
739 it->second->notify(t);
740 m_owner->m_pending_trans.erase(it);
743 m_owner->display_error(
"invalid phase received");
750 return m_owner->bw_invalidate_direct_mem_ptr(s, e);
808 "non-blocking callback already registered");
821 "blocking callback already registered");
834 "debug callback already registered");
847 "get DMI pointer callback already registered");
896 m_owner->display_error(
"invalid phase");
901 "no non-blocking transport callback registered");
921 const bool mm_added = !trans.has_mm();
925 trans.set_auto_extension(&mm_ext);
931 m_owner->m_pending_trans[&trans] = &end_event;
938 if (trans.get_ref_count()) {
946 m_owner->display_error(
"no transport callback registered");
1002 end =
v.end(); it != end; ++it) {
1012 for (it =
v.begin(); it !=
v.end(); it++) {
1013 if ((*it)->m_suspend) {
1015 (*it)->m_trans = trans;
1016 (*it)->m_suspend =
false;
1053 m_owner->bw_nb_transport(*trans, phase, t);
1084 m_owner->m_pending_trans.find(trans);
1086 it->second->notify(t);
1087 m_owner->m_pending_trans.erase(it);
1095 m_owner->m_current_transaction = trans;
1097 m_owner->m_current_transaction = 0;
1117 m_owner->m_pending_trans.find(
1120 m_owner->m_pending_trans.end());
1121 it->second->notify(t);
1122 m_owner->m_pending_trans.erase(it);
1127 m_owner->display_error(
"invalid phase received");
1132 m_owner->display_error(
"invalid sync value received");
1143 trans->template get_extension<mm_end_event_ext>();
1186template <
typename MODULE,
unsigned int BUSWIDTH=32,
1197template <
typename MODULE,
unsigned int BUSWIDTH=32,
1201 sc_core::SC_ZERO_OR_MORE_BOUND>
virtual void start_of_simulation()=0
tlm_fw_transport_if< tlm_base_protocol_types > * operator->()
virtual void bind(tlm_fw_transport_if< tlm_base_protocol_types > &i)
void set_sensitivity(const sc_event *)
virtual void bind(base_initiator_socket_type &s)
void set_start_address(sc_dt::uint64 addr)
void set_end_address(sc_dt::uint64 addr)
transaction_type * get_next_transaction()
sc_core::sc_event & get_event()
void notify(transaction_type &trans, const sc_core::sc_time &t)
void elaboration_check(const char *action) const
bw_process(simple_target_socket_b *p_own)
void invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
simple_target_socket_b * m_owner
sync_enum_type nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
process_handle_class(transaction_type *trans)
transaction_type * m_trans
std::vector< process_handle_class * > v
process_handle_class * get_handle(transaction_type *trans)
void put_handle(process_handle_class *ph)
GetDirectMemPtr m_get_direct_mem_ptr
unsigned int transport_dbg(transaction_type &trans)
void start_of_simulation()
sc_core::sc_event m_end_response
BTransportPtr m_b_transport_ptr
void set_get_direct_mem_ptr(MODULE *mod, GetDirectMemPtr p)
void set_transport_dbg_ptr(MODULE *mod, TransportDbgPtr p)
void set_b_transport_ptr(MODULE *mod, BTransportPtr p)
unsigned int(MODULE::* TransportDbgPtr)(transaction_type &)
sync_enum_type(MODULE::* NBTransportPtr)(transaction_type &, phase_type &, sc_core::sc_time &)
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
fw_process(simple_target_socket_b *p_own)
void free(tlm::tlm_generic_payload *trans)
void nb2b_thread(process_handle_class *h)
NBTransportPtr m_nb_transport_ptr
bool(MODULE::* GetDirectMemPtr)(transaction_type &, tlm::tlm_dmi &)
void b_transport(transaction_type &trans, sc_core::sc_time &t)
void set_nb_transport_ptr(MODULE *mod, NBTransportPtr p)
simple_target_socket_b * m_owner
bool m_response_in_progress
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
TransportDbgPtr m_transport_dbg_ptr
process_handle_list m_process_handle
void(MODULE::* BTransportPtr)(transaction_type &, sc_core::sc_time &)
peq_with_get< transaction_type > m_peq
tlm::tlm_bw_transport_if< TYPES > bw_interface_type
simple_target_socket_b(const char *n=default_name())
tlm::tlm_target_socket< BUSWIDTH, TYPES, 1, POL > base_type
void start_of_simulation()
TYPES::tlm_payload_type transaction_type
void register_b_transport(MODULE *mod, void(MODULE::*cb)(transaction_type &, sc_core::sc_time &))
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(transaction_type &, phase_type &, sc_core::sc_time &))
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(transaction_type &, tlm::tlm_dmi &))
TYPES::tlm_phase_type phase_type
sc_core::sc_event m_end_request
sync_enum_type bw_nb_transport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(transaction_type &))
tlm::tlm_fw_transport_if< TYPES > fw_interface_type
tlm::tlm_sync_enum sync_enum_type
void bw_invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
static const char * default_name()
const sc_core::sc_object * get_socket() const
transaction_type * m_current_transaction
tlm::tlm_bw_transport_if< TYPES > * operator->()
std::map< transaction_type *, sc_core::sc_event * > m_pending_trans
simple_target_socket_optional()
simple_target_socket_optional(const char *name)
simple_target_socket_b< MODULE, BUSWIDTH, TYPES, sc_core::SC_ZERO_OR_MORE_BOUND > socket_b
bw_process(simple_target_socket_tagged_b *p_own)
sync_enum_type nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
simple_target_socket_tagged_b * m_owner
transaction_type * m_trans
process_handle_class(transaction_type *trans)
std::vector< process_handle_class * > v
process_handle_class * get_handle(transaction_type *trans)
void put_handle(process_handle_class *ph)
void set_transport_dbg_ptr(MODULE *mod, TransportDbgPtr p)
void set_get_direct_mem_ptr(MODULE *mod, GetDirectMemPtr p)
GetDirectMemPtr m_get_direct_mem_ptr
BTransportPtr m_b_transport_ptr
void nb2b_thread(process_handle_class *h)
void(MODULE::* BTransportPtr)(int id, transaction_type &, sc_core::sc_time &)
void set_transport_dbg_user_id(int id)
void b_transport(transaction_type &trans, sc_core::sc_time &t)
int m_nb_transport_user_id
simple_target_socket_tagged_b * m_owner
bool m_response_in_progress
TransportDbgPtr m_transport_dbg_ptr
void start_of_simulation()
void set_b_transport_user_id(int id)
int m_b_transport_user_id
sync_enum_type(MODULE::* NBTransportPtr)(int id, transaction_type &, phase_type &, sc_core::sc_time &)
void set_b_transport_ptr(MODULE *mod, BTransportPtr p)
int m_transport_dbg_user_id
unsigned int transport_dbg(transaction_type &trans)
fw_process(simple_target_socket_tagged_b *p_own)
void free(tlm::tlm_generic_payload *trans)
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void set_nb_transport_user_id(int id)
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
void set_get_dmi_user_id(int id)
bool(MODULE::* GetDirectMemPtr)(int id, transaction_type &, tlm::tlm_dmi &)
void set_nb_transport_ptr(MODULE *mod, NBTransportPtr p)
sc_core::sc_event m_end_response
NBTransportPtr m_nb_transport_ptr
unsigned int(MODULE::* TransportDbgPtr)(int id, transaction_type &)
peq_with_get< transaction_type > m_peq
process_handle_list m_process_handle
transaction_type * m_current_transaction
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(int id, transaction_type &, phase_type &, sc_core::sc_time &), int id)
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(int id, transaction_type &), int id)
void start_of_simulation()
tlm::tlm_target_socket< BUSWIDTH, TYPES, 1, POL > base_type
std::map< transaction_type *, sc_core::sc_event * > m_pending_trans
sc_core::sc_event m_end_request
tlm::tlm_bw_transport_if< TYPES > * operator->()
sync_enum_type bw_nb_transport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
tlm::tlm_bw_transport_if< TYPES > bw_interface_type
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(int id, transaction_type &, tlm::tlm_dmi &), int id)
tlm::tlm_sync_enum sync_enum_type
TYPES::tlm_payload_type transaction_type
TYPES::tlm_phase_type phase_type
simple_target_socket_tagged_b(const char *n=default_name())
const sc_core::sc_object * get_socket() const
tlm::tlm_fw_transport_if< TYPES > fw_interface_type
void bw_invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
void register_b_transport(MODULE *mod, void(MODULE::*cb)(int id, transaction_type &, sc_core::sc_time &), int id)
static const char * default_name()
simple_target_socket_tagged_optional(const char *name)
simple_target_socket_tagged_b< MODULE, BUSWIDTH, TYPES, sc_core::SC_ZERO_OR_MORE_BOUND > socket_b
simple_target_socket_tagged_optional()
simple_target_socket_tagged()
simple_target_socket_tagged(const char *name)
simple_target_socket_tagged_b< MODULE, BUSWIDTH, TYPES > socket_b
simple_target_socket(const char *name)
simple_target_socket_b< MODULE, BUSWIDTH, TYPES > socket_b
const sc_time SC_ZERO_TIME
sc_process_handle sc_spawn(T object, const char *name_p=nullptr, const sc_spawn_options *opt_p=nullptr)
const char * sc_gen_unique_name(const char *seed)
void copy_from(tlm::tlm_extension_base const &)
tlm::tlm_extension_base * clone() const
void copy_from(tlm::tlm_extension_base const &)
tlm::tlm_extension_base * clone() const
const std::string & name()