Go to the documentation of this file.
20 #ifndef __SYSTEMC_EXT_TLM_UTILS_SIMPLE_TARGET_SOCKET_H__
21 #define __SYSTEMC_EXT_TLM_UTILS_SIMPLE_TARGET_SOCKET_H__
23 #include "../core/sc_event.hh"
24 #include "../core/sc_module.hh"
25 #include "../core/sc_port.hh"
26 #include "../core/sc_spawn.hh"
27 #include "../tlm_core/2/generic_payload/gp.hh"
28 #include "../tlm_core/2/interfaces/fw_bw_ifs.hh"
29 #include "../tlm_core/2/sockets/initiator_socket.hh"
30 #include "../tlm_core/2/sockets/target_socket.hh"
31 #include "../utils/sc_report_handler.hh"
38 template <
typename MODULE,
unsigned int BUSWIDTH,
typename TYPES,
40 class simple_target_socket_b :
42 protected simple_socket_base
48 typedef typename TYPES::tlm_phase_type
phase_type;
110 base_type::start_of_simulation();
158 it->second->notify(
t);
214 "non-blocking callback already registered");
227 "blocking callback already registered");
252 "get DMI pointer callback already registered");
304 "no non-blocking transport callback registered");
323 mm_end_event_ext mm_ext;
324 const bool mm_added = !trans.has_mm();
328 trans.set_auto_extension(&mm_ext);
341 if (trans.get_ref_count()) {
351 "no blocking transport callback registered");
385 class process_handle_class
397 class process_handle_list
406 end =
v.end(); it != end; ++it) {
411 process_handle_class *
416 for (it =
v.begin(); it !=
v.end(); it++) {
417 if ((*it)->m_suspend) {
419 (*it)->m_trans = trans;
420 (*it)->m_suspend =
false;
491 it->second->notify(
t);
525 it->second->notify(
t);
546 mm_end_event_ext *
ext =
547 trans->template get_extension<mm_end_event_ext>();
570 peq_with_get<transaction_type>
m_peq;
586 template <
typename MODULE,
unsigned int BUSWIDTH=32,
597 template <
typename MODULE,
unsigned int BUSWIDTH=32,
601 sc_core::SC_ZERO_OR_MORE_BOUND>
613 template <
typename MODULE,
unsigned int BUSWIDTH,
typename TYPES,
693 base_type::start_of_simulation();
739 it->second->notify(
t);
808 "non-blocking callback already registered");
821 "blocking callback already registered");
834 "debug callback already registered");
847 "get DMI pointer callback already registered");
871 process_handle_class *ph =
901 "no non-blocking transport callback registered");
920 mm_end_event_ext mm_ext;
921 const bool mm_added = !trans.has_mm();
925 trans.set_auto_extension(&mm_ext);
938 if (trans.get_ref_count()) {
993 class process_handle_list
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;
1023 void put_handle(process_handle_class *ph) {
v.push_back(ph); }
1061 h->m_suspend =
true;
1086 it->second->notify(
t);
1121 it->second->notify(
t);
1142 mm_end_event_ext *
ext =
1143 trans->template get_extension<mm_end_event_ext>();
1186 template <
typename MODULE,
unsigned int BUSWIDTH=32,
1197 template <
typename MODULE,
unsigned int BUSWIDTH=32,
1201 sc_core::SC_ZERO_OR_MORE_BOUND>
void set_get_direct_mem_ptr(MODULE *mod, GetDirectMemPtr p)
bool m_response_in_progress
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(int id, transaction_type &), int id)
transaction_type * get_next_transaction()
simple_target_socket_tagged_b * m_owner
TransportDbgPtr m_transport_dbg_ptr
int m_nb_transport_user_id
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
void set_transport_dbg_ptr(MODULE *mod, TransportDbgPtr p)
bool(MODULE::* GetDirectMemPtr)(transaction_type &, tlm::tlm_dmi &)
void invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
void free(tlm::tlm_generic_payload *trans)
sync_enum_type(MODULE::* NBTransportPtr)(int id, transaction_type &, phase_type &, sc_core::sc_time &)
GetDirectMemPtr m_get_direct_mem_ptr
sync_enum_type bw_nb_transport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void copy_from(tlm::tlm_extension_base const &)
tlm::tlm_extension_base * clone() const
void register_b_transport(MODULE *mod, void(MODULE::*cb)(transaction_type &, sc_core::sc_time &))
void set_sensitivity(const sc_event *)
static const char * default_name()
process_handle_class * get_handle(transaction_type *trans)
transaction_type * m_current_transaction
void(MODULE::* BTransportPtr)(transaction_type &, sc_core::sc_time &)
void nb2b_thread(process_handle_class *h)
GetDirectMemPtr m_get_direct_mem_ptr
int mod(int val, int mod)
tlm::tlm_bw_transport_if< TYPES > bw_interface_type
tlm::tlm_extension_base * clone() const
std::map< transaction_type *, sc_core::sc_event * > m_pending_trans
sc_core::sc_event m_end_response
process_handle_class(transaction_type *trans)
tlm::tlm_sync_enum sync_enum_type
const sc_core::sc_object * get_socket() const
TYPES::tlm_payload_type transaction_type
simple_target_socket_tagged_b< MODULE, BUSWIDTH, TYPES > socket_b
void start_of_simulation()
unsigned int transport_dbg(transaction_type &trans)
void set_nb_transport_ptr(MODULE *mod, NBTransportPtr p)
const sc_time SC_ZERO_TIME
std::map< transaction_type *, sc_core::sc_event * > m_pending_trans
NBTransportPtr m_nb_transport_ptr
static const char * default_name()
void notify(transaction_type &trans, const sc_core::sc_time &t)
bool m_response_in_progress
void display_warning(const char *msg) const
simple_target_socket_tagged_b< MODULE, BUSWIDTH, TYPES, sc_core::SC_ZERO_OR_MORE_BOUND > socket_b
void register_transport_dbg(MODULE *mod, unsigned int(MODULE::*cb)(transaction_type &))
void b_transport(transaction_type &trans, sc_core::sc_time &t)
process_handle_class(transaction_type *trans)
TYPES::tlm_phase_type phase_type
TransportDbgPtr m_transport_dbg_ptr
std::vector< process_handle_class * > v
NBTransportPtr m_nb_transport_ptr
void start_of_simulation()
simple_target_socket_b(const char *n=default_name())
void set_nb_transport_user_id(int id)
void b_transport(transaction_type &trans, sc_core::sc_time &t)
TYPES::tlm_phase_type phase_type
sc_core::sc_event & get_event()
void elaboration_check(const char *action) const
void set_end_address(sc_dt::uint64 addr)
simple_target_socket_b< MODULE, BUSWIDTH, TYPES, sc_core::SC_ZERO_OR_MORE_BOUND > socket_b
bw_process(simple_target_socket_b *p_own)
std::vector< process_handle_class * > v
fw_process(simple_target_socket_tagged_b *p_own)
void set_b_transport_user_id(int id)
int m_b_transport_user_id
process_handle_list m_process_handle
transaction_type * m_trans
void display_error(const char *msg) const
void set_transport_dbg_user_id(int id)
tlm::tlm_bw_transport_if< TYPES > * operator->()
void put_handle(process_handle_class *ph)
BTransportPtr m_b_transport_ptr
simple_target_socket_b * m_owner
simple_target_socket_b * m_owner
void nb2b_thread(process_handle_class *h)
void set_b_transport_ptr(MODULE *mod, BTransportPtr p)
void invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
tlm::tlm_bw_transport_if< TYPES > * operator->()
void set_b_transport_ptr(MODULE *mod, BTransportPtr p)
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(transaction_type &, tlm::tlm_dmi &))
sc_core::sc_event m_end_request
sync_enum_type nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
const char * sc_gen_unique_name(const char *seed)
void put_handle(process_handle_class *ph)
simple_target_socket_tagged()
TYPES::tlm_payload_type transaction_type
bool(MODULE::* GetDirectMemPtr)(int id, transaction_type &, tlm::tlm_dmi &)
bw_interface_type * operator->()
int m_transport_dbg_user_id
simple_target_socket_tagged_optional()
const std::string & name()
tlm::tlm_fw_transport_if< TYPES > fw_interface_type
sync_enum_type nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
void set_transport_dbg_ptr(MODULE *mod, TransportDbgPtr p)
const sc_core::sc_object * get_socket() const
tlm::tlm_bw_transport_if< TYPES > bw_interface_type
bool get_direct_mem_ptr(transaction_type &trans, tlm::tlm_dmi &dmi_data)
virtual tlm_sync_enum nb_transport_bw(TRANS &trans, PHASE &phase, sc_core::sc_time &t)=0
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
process_handle_list m_process_handle
void bw_invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
BTransportPtr m_b_transport_ptr
void start_of_simulation()
simple_target_socket_tagged_b(const char *n=default_name())
void register_b_transport(MODULE *mod, void(MODULE::*cb)(int id, transaction_type &, sc_core::sc_time &), int id)
void copy_from(tlm::tlm_extension_base const &)
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 set_nb_transport_ptr(MODULE *mod, NBTransportPtr p)
bw_process(simple_target_socket_tagged_b *p_own)
fw_process(simple_target_socket_b *p_own)
simple_target_socket_b< MODULE, BUSWIDTH, TYPES > socket_b
simple_target_socket_optional()
transaction_type * m_current_transaction
sc_process_handle sc_spawn(T object, const char *name_p=nullptr, const sc_spawn_options *opt_p=nullptr)
sync_enum_type nb_transport_fw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
tlm::tlm_sync_enum sync_enum_type
peq_with_get< transaction_type > m_peq
virtual void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)=0
sync_enum_type(MODULE::* NBTransportPtr)(transaction_type &, phase_type &, sc_core::sc_time &)
void(MODULE::* BTransportPtr)(int id, transaction_type &, sc_core::sc_time &)
void bw_invalidate_direct_mem_ptr(sc_dt::uint64 s, sc_dt::uint64 e)
void set_start_address(sc_dt::uint64 addr)
sc_core::sc_event m_end_response
sync_enum_type bw_nb_transport(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
unsigned int transport_dbg(transaction_type &trans)
unsigned int(MODULE::* TransportDbgPtr)(int id, transaction_type &)
sc_core::sc_event m_end_request
tlm::tlm_fw_transport_if< TYPES > fw_interface_type
void set_get_dmi_user_id(int id)
void register_get_direct_mem_ptr(MODULE *mod, bool(MODULE::*cb)(int id, transaction_type &, tlm::tlm_dmi &), int id)
void set_get_direct_mem_ptr(MODULE *mod, GetDirectMemPtr p)
tlm::tlm_target_socket< BUSWIDTH, TYPES, 1, POL > base_type
virtual void bind(base_initiator_socket_type &s)
process_handle_class * get_handle(transaction_type *trans)
transaction_type * m_trans
auto sc_bind(F &&f, Args &&...args) -> decltype(std::bind(std::forward< F >(f), std::forward< Args >(args)...))
void start_of_simulation()
void free(tlm::tlm_generic_payload *trans)
simple_target_socket_tagged_b * m_owner
void register_nb_transport_fw(MODULE *mod, sync_enum_type(MODULE::*cb)(transaction_type &, phase_type &, sc_core::sc_time &))
tlm::tlm_target_socket< BUSWIDTH, TYPES, 1, POL > base_type
peq_with_get< transaction_type > m_peq
unsigned int(MODULE::* TransportDbgPtr)(transaction_type &)
Generated on Wed Sep 30 2020 14:02:16 for gem5 by doxygen 1.8.17