16#ifndef SIMICS_SYSTEMC_AWARENESS_TLM_BW_TRANSPORT_IF_HANDLER_H
17#define SIMICS_SYSTEMC_AWARENESS_TLM_BW_TRANSPORT_IF_HANDLER_H
28#include <unordered_map>
34template <
typename TYPES = tlm::tlm_base_protocol_types>
37 public tlm::tlm_bw_transport_if<TYPES> {
39 typedef tlm::tlm_bw_transport_if<TYPES>
BW_IF;
41 : is_active_(false) {}
50 bw_if()->invalidate_direct_mem_ptr(0,
51 static_cast<sc_dt::uint64
>(-1));
60 sc_dt::uint64 end_range) {
63 invalidate_direct_mem_ptr_pre,
64 proxy(), &start_range, &end_range);
71 bw->invalidate_direct_mem_ptr(start_range, end_range);
75 invalidate_direct_mem_ptr_post,
76 proxy(), &start_range, &end_range);
80 sc_core::sc_time &t) {
84 (&trans)->set_dmi_allowed(
false);
89 proxy(), &trans, &phase, &t);
91 tlm::tlm_sync_enum ret = tlm::TLM_COMPLETED;
95 ret = bw->nb_transport_bw(trans, phase, t);
100 proxy(), &trans, &phase, &t, &ret);
105 sc_core::sc_interface* sc_iface =
iface();
106 if (bw_if_map_.find(sc_iface) == bw_if_map_.end()) {
109 bw_if_map_.emplace(sc_iface,
dynamic_cast<BW_IF*
>(sc_iface));
111 return bw_if_map_[sc_iface];
116 std::unordered_map<sc_core::sc_interface*, BW_IF*> bw_if_map_;
119template <
typename IF_PROVIDER = sc_core::sc_port_base,
120 typename TYPES = tlm::tlm_base_protocol_types>
124 typedef tlm::tlm_bw_transport_if<TYPES>
BW_IF;
129 first_.set_tlm_iface(
new TlmIface(&second_));
134 first_.set_tlm_iface(
new TlmIface(&second_));
135 second_.set_tlm_iface(
new TlmIface(bw_if));
138 tlm_utils::callback_binder_bw<TYPES> *binder_bw)
139 : registry_(binder_bw, this) {
140 first_.set_tlm_iface(
new TlmIface(&second_));
141 second_.set_tlm_iface(
new TlmIface(binder_bw));
145 sc_dt::uint64 end_range) {
146 first_.invalidate_direct_mem_ptr(start_range, end_range);
150 sc_core::sc_time &t) {
151 return first_.nb_transport_bw(trans, phase, t);
Definition: tlm_base_handler.h:68
virtual instrumentation::ToolController * controller()
Definition: tlm_base_handler.h:81
virtual sc_core::sc_interface * iface()
Definition: tlm_base_handler.h:92
virtual ProxyInterface * proxy()
Definition: tlm_base_handler.h:84
Definition: tlm_bw_transport_if_handler.h:37
virtual void enable()
Definition: tlm_bw_transport_if_handler.h:42
TlmBwTransportIfHandlerBase()
Definition: tlm_bw_transport_if_handler.h:40
virtual void disable()
Definition: tlm_bw_transport_if_handler.h:53
tlm::tlm_bw_transport_if< TYPES > BW_IF
Definition: tlm_bw_transport_if_handler.h:39
BW_IF * bw_if()
Definition: tlm_bw_transport_if_handler.h:104
TYPES::tlm_phase_type phase_type
Definition: tlm_bw_transport_if_handler.h:58
TYPES::tlm_payload_type transaction_type
Definition: tlm_bw_transport_if_handler.h:57
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: tlm_bw_transport_if_handler.h:59
tlm::tlm_sync_enum nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: tlm_bw_transport_if_handler.h:78
Definition: tlm_bw_transport_if_handler.h:122
TlmBwTransportIfHandler(IF_PROVIDER *bw_if)
Definition: tlm_bw_transport_if_handler.h:128
virtual TlmHandlerInterface * secondHandler()
Definition: tlm_bw_transport_if_handler.h:157
tlm::tlm_bw_transport_if< TYPES > BW_IF
Definition: tlm_bw_transport_if_handler.h:124
tlm::tlm_sync_enum nb_transport_bw(transaction_type &trans, phase_type &phase, sc_core::sc_time &t)
Definition: tlm_bw_transport_if_handler.h:148
virtual TlmHandlerInterface * firstHandler()
Definition: tlm_bw_transport_if_handler.h:154
TYPES::tlm_phase_type phase_type
Definition: tlm_bw_transport_if_handler.h:126
TYPES::tlm_payload_type transaction_type
Definition: tlm_bw_transport_if_handler.h:125
TlmBwTransportIfHandler(BW_IF *bw_if)
Definition: tlm_bw_transport_if_handler.h:133
void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range)
Definition: tlm_bw_transport_if_handler.h:144
TlmBwTransportIfHandler(tlm_utils::callback_binder_bw< TYPES > *binder_bw)
Definition: tlm_bw_transport_if_handler.h:137
Definition: tlm_handler_interface.h:26
Definition: tlm_base_handler.h:55
Definition: tlm_base_handler.h:39
Definition: tlm_multi_handler_interface.h:25
Definition: tlm_multi_handler_registry.h:30
Definition: tlm_bw_action_interface.h:31
Definition: pci_bus_interface.h:24