SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_export_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2015 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14#ifndef SIMICS_SYSTEMC_IFACE_SC_EXPORT_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_EXPORT_SIMICS_ADAPTER_H
16
19
20#include <systemc-interfaces.h>
21
22#include <string>
23#include <vector>
24
25namespace simics {
26namespace systemc {
27namespace iface {
28
30template<typename TBase, typename TInterface = ScExportInterface>
31class ScExportSimicsAdapter : public SimicsAdapter<sc_export_interface_t> {
32 public:
33 ScExportSimicsAdapter() : SimicsAdapter<sc_export_interface_t>(
34 SC_EXPORT_INTERFACE, init_iface()) {
35 }
36
37 protected:
38 static attr_value_t export_to_proxy(conf_object_t *obj) {
39 return SIM_make_attr_object(
40 adapter<TBase, TInterface>(obj)->export_to_proxy());
41 }
42 static const char *if_typename(conf_object_t *obj) {
43 return adapter<TBase, TInterface>(obj)->if_typename();
44 }
45
46 private:
47 std::vector<std::string> description(conf_object_t *obj,
48 DescriptionType type) override {
49 return descriptionBase<TBase, TInterface>(obj, type);
50 }
51 sc_export_interface_t init_iface() {
52 sc_export_interface_t iface = {};
53 iface.export_to_proxy = export_to_proxy;
54 iface.if_typename = if_typename;
55 return iface;
56 }
57};
58
59} // namespace iface
60} // namespace systemc
61} // namespace simics
62
63#endif
Definition: sc_export_simics_adapter.h:31
static attr_value_t export_to_proxy(conf_object_t *obj)
Definition: sc_export_simics_adapter.h:38
static const char * if_typename(conf_object_t *obj)
Definition: sc_export_simics_adapter.h:42
ScExportSimicsAdapter()
Definition: sc_export_simics_adapter.h:33
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79