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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2016 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_TOOL_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_TOOL_SIMICS_ADAPTER_H
18
19#include <simics/base/attr-value.h>
20#include <simics/simulator-iface/instrumentation-tool.h>
23
24#include <string>
25#include <utility>
26#include <vector>
27
28namespace simics {
29namespace systemc {
30namespace iface {
31namespace instrumentation {
32
33template<typename TBase, typename TInterface = ToolInterface>
35 : public SimicsAdapter<instrumentation_tool_interface_t> {
36 public:
38 : SimicsAdapter<instrumentation_tool_interface_t>(
39 INSTRUMENTATION_TOOL_INTERFACE, init_iface()) {
40 }
41
42 protected:
43 static conf_object_t *connect(conf_object_t *obj, conf_object_t *provider,
44 attr_value_t args) {
45 return adapter<TBase, TInterface>(obj, provider)->connect(provider,
46 args);
47 }
48 static void disconnect(conf_object_t *obj, conf_object_t *conn) {
49 adapter<TBase, TInterface>(obj, conn)->disconnect(conn);
50 }
51
52 private:
53 std::vector<std::string> description(conf_object_t *obj,
54 DescriptionType type) {
55 return descriptionBase<TBase, TInterface>(obj, type);
56 }
57 instrumentation_tool_interface_t init_iface() {
58 instrumentation_tool_interface_t iface = {};
59 iface.connect = connect;
60 iface.disconnect = disconnect;
61 return iface;
62 }
63};
64
65} // namespace instrumentation
66} // namespace iface
67} // namespace systemc
68} // namespace simics
69
70#endif
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
static conf_object_t * connect(conf_object_t *obj, conf_object_t *provider, attr_value_t args)
Definition: tool_simics_adapter.h:43
static void disconnect(conf_object_t *obj, conf_object_t *conn)
Definition: tool_simics_adapter.h:48
ToolSimicsAdapter()
Definition: tool_simics_adapter.h:37
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24