16#ifndef SIMICS_SYSTEMC_SIMICS2TLM_GASKET_CLASS_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_GASKET_CLASS_H
22#include <simics/simulator/sim-get-class.h>
37template<
class TGasket,
39 template<
class,
class>
class TSimicsAdapter,
40 class TGasketInterface>
47 : ConfObject(o), TGasketAdapter(&gasket_, this) {}
50 SIM_set_object_configured(obj());
53 simulation_ref_.require();
67 gasket_.gasket()->set_dmi(enable);
70 return gasket_.gasket()->is_dmi_enabled();
74 gasket_.gasket()->get_dmi_data_table()->print().c_str());
79 if (SIM_clear_exception() == SimExc_No_Exception) {
83 auto new_cls = make_class<GasketClass>(
85 "model of SystemC simics2tlm gasket class",
86 "Class for binding Simics interface to SystemC Gasket.");
89 TSimicsAdapter<GasketClass, TGasketInterface>>());
92 new_cls->add(Attribute(
"target",
"s",
93 "Name of the target socket the gasket is"
97 new_cls->add(Attribute(
"simulation",
"o",
98 "Simics object implementing the SystemC"
99 " Simulation interface.",
103 return *new_cls.get();
107 std::string socket_name_;
108 ConfObjectRef simulation_ref_;
Definition: gasket_class_interface.h:28
Interface to the SystemC simulation.
Definition: simulation_interface_proxy.h:27
void setSimulation(iface::SimulationInterface *simulation)
Definition: simulation_interface_proxy.h:32
virtual ConfObjectRef simics_object() const
Definition: simulation_interface_proxy.h:49
Definition: sc_initiator_gasket_interface.h:24
Definition: sc_initiator_gasket_simics_adapter.h:35
Definition: sc_version_interface.h:27
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: gasket_class.h:44
static conf_class_t * registerGasketClass(const char *class_name)
Definition: gasket_class.h:77
virtual void finalize()
Definition: gasket_class.h:48
GasketClass(ConfObjectRef o)
Definition: gasket_class.h:46
virtual iface::ScVersionInterface * version()
Definition: gasket_class.h:57
virtual void createGasket(iface::SimulationInterface *simulation)
Definition: gasket_class.h:60
virtual void set_dmi(bool enable)
Definition: gasket_class.h:66
virtual bool is_dmi_enabled()
Definition: gasket_class.h:69
virtual char * print_dmi_table()
Definition: gasket_class.h:72
GasketInterface::Ptr createGasketByName(std::string socket_name, const simics::ConfObjectRef &simics_obj)
Factory for creating a Gasket and bind it to a target socket.
InterfaceSimicsAdapter & createAdapter()
Create a SimicsAdapter that can be registered with a ConfClass.
Definition: simics_adapter.h:172
conf_class_t * SIM_get_class(const char *NOTNULL name)
Definition: pci_bus_interface.h:24