SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_gasket_info_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2020 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_GASKET_INFO_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_GASKET_INFO_SIMICS_ADAPTER_H
16
17#include <simics/attribute-traits.h>
18
21
22#include <systemc-interfaces.h>
23
24#include <string>
25#include <vector>
26
27namespace simics {
28namespace systemc {
29namespace iface {
30
32template<typename TBase, typename TInterface = ScGasketInfoInterface>
34 : public SimicsAdapter<sc_gasket_info_interface_t> {
35 public:
36 ScGasketInfoSimicsAdapter() : SimicsAdapter<sc_gasket_info_interface_t>(
37 SC_GASKET_INFO_INTERFACE, init_iface()) {
38 }
39
40 protected:
41 static attr_value_t simics2tlm(conf_object_t *obj) {
42 return vec2list(adapter<TBase, TInterface>(obj)->simics2tlm());
43 }
44 static attr_value_t tlm2simics(conf_object_t *obj) {
45 return vec2list(adapter<TBase, TInterface>(obj)->tlm2simics());
46 }
47 static attr_value_t simics2systemc(conf_object_t *obj) {
48 return vec2list(adapter<TBase, TInterface>(obj)->simics2systemc());
49 }
50 static attr_value_t systemc2simics(conf_object_t *obj) {
51 return vec2list(adapter<TBase, TInterface>(obj)->systemc2simics());
52 }
53 static attr_value_t vec2list(
54 const std::vector<std::vector<std::string> > *v) {
55 return simics::std_to_attr(*v);
56 }
57
58 private:
59 std::vector<std::string> description(conf_object_t *obj,
60 DescriptionType type) override {
61 return descriptionBase<TBase, TInterface>(obj, type);
62 }
63 sc_gasket_info_interface_t init_iface() {
64 sc_gasket_info_interface_t iface = {};
65 iface.simics2tlm = simics2tlm;
66 iface.tlm2simics = tlm2simics;
67 iface.simics2systemc = simics2systemc;
68 iface.systemc2simics = systemc2simics;
69 return iface;
70 }
71};
72
73} // namespace iface
74} // namespace systemc
75} // namespace simics
76
77#endif
Definition: sc_gasket_info_simics_adapter.h:34
ScGasketInfoSimicsAdapter()
Definition: sc_gasket_info_simics_adapter.h:36
static attr_value_t vec2list(const std::vector< std::vector< std::string > > *v)
Definition: sc_gasket_info_simics_adapter.h:53
static attr_value_t tlm2simics(conf_object_t *obj)
Definition: sc_gasket_info_simics_adapter.h:44
static attr_value_t simics2tlm(conf_object_t *obj)
Definition: sc_gasket_info_simics_adapter.h:41
static attr_value_t systemc2simics(conf_object_t *obj)
Definition: sc_gasket_info_simics_adapter.h:50
static attr_value_t simics2systemc(conf_object_t *obj)
Definition: sc_gasket_info_simics_adapter.h:47
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