14#ifndef SIMICS_SYSTEMC_SIMICS2TLM_GASKET_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_GASKET_H
17#include <simics/cc-api.h>
29#include <tlm_utils/simple_initiator_socket.h>
53template<
unsigned int BUSWIDTH = 32,
54 typename TYPES = tlm::tlm_base_protocol_types>
55class Gasket :
public sc_core::sc_module,
59 Gasket(sc_core::sc_module_name,
const ConfObjectRef &obj);
76 tlm::tlm_generic_payload &
payload()
override;
83 template <
typename Socket>
85 initiator_socket_.bind(sock);
86 target_socket_ = &sock;
90 void invalidate_direct_mem_ptr(sc_dt::uint64 start_range,
91 sc_dt::uint64 end_range);
96 tlm::tlm_generic_payload *payload_before_send);
106 class ThreadData :
public Thread {
109 : transaction_(NULL), must_call_sc_pause_(false),
110 must_reset_extension_(false),
111 simulation_(NULL), internal_(NULL) {}
115 transaction_ = *transaction;
116 must_call_sc_pause_ =
false;
117 must_reset_extension_ =
false;
118 simulation_ = simulation;
119 internal_ = internal;
121 const char *thread_name()
override {
122 return sc_core::sc_gen_unique_name(
"on_transaction");
125 iface::Transaction transaction_;
126 bool must_call_sc_pause_;
127 bool must_reset_extension_;
128 iface::SimulationInterface *simulation_;
129 InternalInterface *internal_;
132 ConfObjectRef simics_obj_;
133 iface::Transaction *transaction_;
135 sc_core::sc_object* target_socket_;
136 tlm_utils::simple_initiator_socket<Gasket, BUSWIDTH, TYPES>
138 DmiDataTable dmi_data_table_;
140 ThreadPool<ThreadData> thread_pool_;
141 iface::SimulationInterface *simulation_;
142 InternalInterface *internal_;
143 iface::TransactionPool pool_;
146 tlm::tlm_generic_payload deprecated_payload_;
147 iface::Transaction deprecated_transaction_;
Definition: class_type.h:23
Definition: internal_interface.h:23
Definition: thread_pool.h:31
Definition: thread_pool.h:42
Definition: thread_pool.h:55
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
Definition: transaction_extension.h:54
Class that encapsulates a generic_payload and returns it to the TransactionPool when the Transaction ...
Definition: transaction.h:29
Definition: dmi_data_table.h:27
Interface used by simics2tlm gaskets, implemented by Gasket base class.
Definition: gasket_interface.h:33
Core helper for sending a TLM2 transaction over a socket.
Definition: gasket.h:57
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:84
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.