SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
tool_connection_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2017 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_CONNECTION_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_TOOL_CONNECTION_SIMICS_ADAPTER_H
18
19#include <systemc-provider-interfaces.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29namespace instrumentation {
30
31template<typename TBase, typename TInterface =
32 systemc::instrumentation::ToolConnectionInterface>
34 : public SimicsAdapter<sc_tool_connection_interface_t> {
35 public:
37 : SimicsAdapter<sc_tool_connection_interface_t>(
38 SC_TOOL_CONNECTION_INTERFACE, init_iface()) {
39 }
40
41 protected:
42 static attr_value_t tool(conf_object_t *obj) {
43 return SIM_make_attr_object(adapter<TBase, TInterface>(obj)->tool());
44 }
45 static attr_value_t controller(conf_object_t *obj) {
46 return SIM_make_attr_object(
47 adapter<TBase, TInterface>(obj)->controller());
48 }
49
50 private:
51 std::vector<std::string> description(conf_object_t *obj,
52 DescriptionType type) {
53 return descriptionBase<TBase, TInterface>(obj, type);
54 }
55 sc_tool_connection_interface_t init_iface() {
56 sc_tool_connection_interface_t iface = {};
57 iface.tool = tool;
58 iface.controller = controller;
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:47
Definition: tool_connection_simics_adapter.h:34
static attr_value_t tool(conf_object_t *obj)
Definition: tool_connection_simics_adapter.h:42
ToolConnectionSimicsAdapter()
Definition: tool_connection_simics_adapter.h:36
static attr_value_t controller(conf_object_t *obj)
Definition: tool_connection_simics_adapter.h:45
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24