16#ifndef SIMICS_SYSTEMC_SIMICS2TLM_GASKET_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_GASKET_H
19#include <simics/cc-api.h>
31#include <tlm_utils/simple_initiator_socket.h>
44template<
unsigned int BUSWIDTH = 32,
45 typename TYPES = tlm::tlm_base_protocol_types>
46class Gasket :
public sc_core::sc_module,
51 Gasket(sc_core::sc_module_name,
const ConfObjectRef &obj);
68 tlm::tlm_generic_payload &
payload()
override;
75 template <
typename Socket>
77 initiator_socket_.bind(sock);
78 target_socket_ = &sock;
82 void invalidate_direct_mem_ptr(sc_dt::uint64 start_range,
83 sc_dt::uint64 end_range);
88 tlm::tlm_generic_payload *payload_before_send);
98 class ThreadData :
public Thread {
101 : transaction_(NULL), must_call_sc_pause_(false),
102 must_reset_extension_(false),
103 simulation_(NULL), internal_(NULL) {}
107 transaction_ = *transaction;
108 must_call_sc_pause_ =
false;
109 must_reset_extension_ =
false;
110 simulation_ = simulation;
111 internal_ = internal;
113 const char *thread_name()
override {
114 return sc_core::sc_gen_unique_name(
"on_transaction");
117 iface::Transaction transaction_;
118 bool must_call_sc_pause_;
119 bool must_reset_extension_;
120 iface::SimulationInterface *simulation_;
121 InternalInterface *internal_;
124 ConfObjectRef simics_obj_;
125 iface::Transaction *transaction_;
127 sc_core::sc_object* target_socket_;
128 tlm_utils::simple_initiator_socket<Gasket, BUSWIDTH, TYPES>
130 DmiDataTable dmi_data_table_;
132 ThreadPool<ThreadData> thread_pool_;
133 iface::SimulationInterface *simulation_;
134 InternalInterface *internal_;
135 iface::TransactionPool pool_;
138 tlm::tlm_generic_payload deprecated_payload_;
139 iface::Transaction deprecated_transaction_;
Definition: class_type.h:25
Definition: internal_interface.h:25
Definition: thread_pool.h:33
Definition: thread_pool.h:44
Definition: thread_pool.h:57
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: transaction_extension.h:56
Class that encapsulates a generic_payload and returns it to the TransactionPool when the Transaction ...
Definition: transaction.h:31
Definition: dmi_data_table.h:30
Interface used by simics2tlm gaskets, implemented by Gasket base class.
Definition: gasket_interface.h:35
Implements core functionality for sending a TLM2 transaction over a socket.
Definition: gasket.h:48
ConfObjectRef & simics_obj() override
sc_core::sc_object * get_target_socket() override
Gasket(sc_core::sc_module_name, const ConfObjectRef &obj)
bool trigger_transaction() override
Deprecated, use the trigger(iface::Transaction *transaction) instead.
bool trigger(iface::Transaction *transaction) override
void init(iface::SimulationInterface *simulation, InternalInterface *internal)
DmiDataTable * get_dmi_data_table() override
ClassType * type() override
tlm::tlm_generic_payload & payload() override
Deprecated, use the TransactionPool::acquire() instead.
void set_type(ClassType *type) override
bool is_dmi_enabled() override
void bind(Socket &sock)
Definition: gasket.h:76
virtual ~Gasket()=default
void set_dmi(bool enable) override
std::string gasket_name() const override
void set_inquiry(bool inquiry) override
Deprecated, use the TransactionExtension::set_transport_debug(bool) instead.
Definition: pci_bus_interface.h:24