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/*
2 © 2017 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_CONNECTION_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_TOOL_CONNECTION_SIMICS_ADAPTER_H
16
17#include <systemc-provider-interfaces.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27namespace instrumentation {
28
29template<typename TBase, typename TInterface =
30 systemc::instrumentation::ToolConnectionInterface>
32 : public SimicsAdapter<sc_tool_connection_interface_t> {
33 public:
35 : SimicsAdapter<sc_tool_connection_interface_t>(
36 SC_TOOL_CONNECTION_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static attr_value_t tool(conf_object_t *obj) {
41 return SIM_make_attr_object(adapter<TBase, TInterface>(obj)->tool());
42 }
43 static attr_value_t controller(conf_object_t *obj) {
44 return SIM_make_attr_object(
45 adapter<TBase, TInterface>(obj)->controller());
46 }
47
48 private:
49 std::vector<std::string> description(conf_object_t *obj,
50 DescriptionType type) override {
51 return descriptionBase<TBase, TInterface>(obj, type);
52 }
53 sc_tool_connection_interface_t init_iface() {
54 sc_tool_connection_interface_t iface = {};
55 iface.tool = tool;
56 iface.controller = controller;
57 return iface;
58 }
59};
60
61} // namespace instrumentation
62} // namespace iface
63} // namespace systemc
64} // namespace simics
65
66#endif
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
Definition: tool_connection_simics_adapter.h:32
static attr_value_t tool(conf_object_t *obj)
Definition: tool_connection_simics_adapter.h:40
ToolConnectionSimicsAdapter()
Definition: tool_connection_simics_adapter.h:34
static attr_value_t controller(conf_object_t *obj)
Definition: tool_connection_simics_adapter.h:43
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79