SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
tool_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2016 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_INSTRUMENTATION_TOOL_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_TOOL_SIMICS_ADAPTER_H
16
17#include <simics/base/attr-value.h>
18#include <simics/simulator-iface/instrumentation-tool.h>
21
22#include <string>
23#include <utility>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29namespace instrumentation {
30
31template<typename TBase, typename TInterface = ToolInterface>
33 : public SimicsAdapter<instrumentation_tool_interface_t> {
34 public:
36 : SimicsAdapter<instrumentation_tool_interface_t>(
37 INSTRUMENTATION_TOOL_INTERFACE, init_iface()) {
38 }
39
40 protected:
41 static conf_object_t *connect(conf_object_t *obj, conf_object_t *provider,
42 attr_value_t args) {
43 return adapter<TBase, TInterface>(obj, provider)->connect(provider,
44 args);
45 }
46 static void disconnect(conf_object_t *obj, conf_object_t *conn) {
47 adapter<TBase, TInterface>(obj, conn)->disconnect(conn);
48 }
49
50 private:
51 std::vector<std::string> description(conf_object_t *obj,
52 DescriptionType type) override {
53 return descriptionBase<TBase, TInterface>(obj, type);
54 }
55 instrumentation_tool_interface_t init_iface() {
56 instrumentation_tool_interface_t iface = {};
57 iface.connect = connect;
58 iface.disconnect = disconnect;
59 return iface;
60 }
61};
62
63} // namespace instrumentation
64} // namespace iface
65} // namespace systemc
66} // namespace simics
67
68#endif
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
static conf_object_t * connect(conf_object_t *obj, conf_object_t *provider, attr_value_t args)
Definition: tool_simics_adapter.h:41
static void disconnect(conf_object_t *obj, conf_object_t *conn)
Definition: tool_simics_adapter.h:46
ToolSimicsAdapter()
Definition: tool_simics_adapter.h:35
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79