16#ifndef SIMICS_SYSTEMC_ADAPTER_H
17#define SIMICS_SYSTEMC_ADAPTER_H
21#include <simics/conf-object.h>
63#include <systemc-kernel-compiler-version-check.h>
64#include <systemc-library-version-checks.h>
66#if INTC_EXT && USE_SIMICS_CCI
67#include <cci_utils/broker.h>
88#if INTC_EXT && USE_SIMICS_CHECKPOINTING
143 template <
typename C>
145#if INTC_EXT && USE_SIMICS_CHECKPOINTING
147 conf_class->add(checkpoint_simics_adapter);
150 conf_class->add(simcontext_simics_adapter);
152 memory_profiler_control_simics_adapter;
153 conf_class->add(memory_profiler_control_simics_adapter);
156 conf_class->add(ppc_simics_adapter);
158 conf_class->add(version_simics_adapter);
159#if INTC_EXT && USE_SIMICS_CHECKPOINTING
161 conf_class->add(temporal_simics_adapter);
164 conf_class->add(event_delta_simics_adapter);
166 conf_class->add(execute_simics_adapter);
168 conf_class->add(frequency_simics_adapter);
170 concurrency_group_simics_adapter;
171 conf_class->add(concurrency_group_simics_adapter);
173 concurrency_mode_simics_adapter;
174 conf_class->add(concurrency_mode_simics_adapter);
176 execute_control_simics_adapter;
177 conf_class->add(execute_control_simics_adapter);
179 conf_class->add(gasket_info_simics_adapter);
181 if (std::is_base_of<simics2tlm::IoMemoryGasketAdapter, C>::value &&
182 std::is_base_of<iface::RegisterViewInterface, C>::value) {
184 register_view_simics_adapter;
185 conf_class->add(register_view_simics_adapter);
189 initScAttributes(conf_class);
190 conf_class_t *cls = *conf_class;
203 Invoker invoker{cls};
206 const char *
const log_groups[] = {
214 SIM_log_register_groups(cls, log_groups);
217 if (SIM_clear_exception() != SimExc_No_Exception) {
218 FATAL_ERROR(
"Adapter::initClass: %s", SIM_last_error());
220 SIM_extend_class(cls, clock);
222 SIM_register_notifier(cls, Sim_Notify_Frequency_Change, NULL);
225 if (SIM_clear_exception() != SimExc_No_Exception) {
226 FATAL_ERROR(
"Adapter::initClass: %s", SIM_last_error());
228 SIM_register_port(cls,
"engine", co_execute,
"executor");
232#ifdef REGISTER_SYSTEMC_GASKET_CLASSES
243 return &proxy_builder_;
253 static awareness::TlmSpyFactoryRegistry *spy_factory_registry() {
254 static awareness::TlmSpyFactoryRegistry registry;
266 bool allowUnconnectedPorts()
const;
267 void setAllowUnconnectedPorts(
const bool &val);
268 bool createProxyObjects()
const;
269 void setCreateProxyObjects(
const bool &val);
270 void set_argv(
const std::vector<std::string> &val);
271 std::vector<std::string> get_argv()
const;
272 void set_cci_preset_values(
273 const std::vector<std::pair<std::string, std::string>> &attr);
274 simics::ConfObjectRef get_same_cell_as()
const;
276 conf_object_t *createObject(conf_class_t *cls,
277 std::string full_name);
278 void createGaskets(
const std::vector<simics::ConfObjectRef> &objs);
280 static void initOnce();
281 static void initScAttributes(ConfClass *conf_class);
283 bool allow_unconnected_ports_;
284 bool create_proxy_objects_;
286 LateBinder late_binder_;
289 std::map<sc_core::sc_object *, awareness::ProxyInterface *> links_;
291 conf_object_t *dynamic_events_object_;
292 conf_object_t *dynamic_processes_object_;
299 awareness::TlmSpyFactoryRegistry spy_factory_registry_;
301#if INTC_EXT && USE_SIMICS_CCI
302 cci_utils::broker broker_;
303 conf_object_t *cci_global_;
Entry point for creating a Simics conf-object that adapts a SystemC model to Simics,...
Definition: adapter.h:97
virtual void elaborate()
Override this method to elaborate the SystemC hierarchy.
Definition: adapter.h:110
InternalInterface * internal()
Definition: adapter.h:247
virtual void finalize()
Called during the finalize phase.
static SimulationInterface & simulation_from_conf_obj(conf_object_t *obj)
virtual void tagGaskets(simics::systemc::GasketTagInterface *gasket_tag)
Override this method to create tag based gaskets.
Definition: adapter.h:118
virtual void bindGaskets()
Override this method to bind Simics interfaces to SystemC after elaboration.
Definition: adapter.h:128
static awareness::ProxyBuilder * proxy_builder()
Definition: adapter.h:242
std::vector< simics::ConfObjectRef > gaskets_
Definition: adapter.h:259
static void initClassInternal(ConfClass *conf_class)
Definition: adapter.h:144
Adapter * is_systemc_adapter
Definition: adapter.h:99
Definition: checkpoint.h:34
Definition: gasket_info.h:29
This interface provides the means to create gaskets encapsulated in Simics objects.
Definition: gasket_tag.h:33
Definition: gasket_tag.h:68
Definition: internal_interface.h:25
Definition: internal.h:27
static void set_module_name(const char *module_name)
Definition: process_profiler_control.h:25
static Registry< T > * instance()
Definition: registry.h:69
Definition: sc_memory_profiler_control.h:24
Definition: sc_signal_access.h:24
Provides the interface to the SystemC simulation context.
Definition: simcontext.h:30
Provides the interface to the SystemC kernel.
Definition: simulation.h:54
Definition: state_handler.h:26
Definition: attributes.h:28
Definition: proxy_builder.h:50
Adapter for Simics checkpoint interface.
Definition: checkpoint_simics_adapter.h:32
Adapter for concurrency mode interface.
Definition: concurrency_group_simics_adapter.h:33
Adapter for concurrency mode interface.
Definition: concurrency_mode_simics_adapter.h:33
Definition: event_delta_simics_adapter.h:32
Adapter for concurrency group interface.
Definition: execute_control_simics_adapter.h:33
Definition: execute_simics_adapter.h:32
Definition: frequency_simics_adapter.h:32
Definition: register_view_simics_adapter.h:34
Definition: sc_gasket_info_simics_adapter.h:36
Definition: sc_memory_profiler_control_simics_adapter.h:33
Definition: sc_process_profiler_control_simics_adapter.h:35
Definition: sc_version_simics_adapter.h:35
Adapter for Simics simulation context interface.
Definition: simcontext_simics_adapter.h:34
Definition: simics_adapter_interface.h:29
virtual void set_map_adapter(bool map)=0
virtual void set_simics_class(conf_class_t *conf_class)=0
virtual bool map_adapter() const =0
Definition: temporal_state_simics_adapter.h:32
conf_class_t * SIM_get_class(const char *NOTNULL name)
void initGasketClasses(const char *module_name)
Definition: pci_bus_interface.h:24