SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_tool.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_TOOLS_SC_TOOL_H
17#define SIMICS_SYSTEMC_TOOLS_SC_TOOL_H
18
19#include <simics/cc-api.h>
20#include <simics/simulator-iface/instrumentation-tool.h>
30
31#include <memory>
32#include <set>
33#include <vector>
34#include <string>
35
36namespace scl = simics::systemc;
37namespace scla = scl::awareness;
38namespace scli = scl::iface::instrumentation;
39
40namespace simics {
41namespace systemc {
42namespace tools {
43
44class ScTool : public simics::ConfObject,
45 public scli::EventActionInterface,
46 public scli::ProcessActionInterface,
47 public scli::SignalActionInterface,
48 public scli::SignalPortActionInterface,
49 public scli::TlmFwActionInterface,
50 public scli::TlmBwActionInterface,
51 public scli::ToolInterface {
52 public:
53 explicit ScTool(simics::ConfObjectRef o)
54 : ConfObject(o) {}
55 // ToolInterface
56 conf_object_t *connect(conf_object_t *controller,
57 attr_value_t args) override;
58 void disconnect(conf_object_t *conn) override;
59
60 // Registers a simics configuration class with all action interfaces.
61 template <class T>
62 static simics::ConfClassPtr register_class(
63 std::string name, std::string long_name, std::string documentation);
64
65 protected:
66 // scli::EventActionInterface
67 void triggered(scla::ProxyInterface *proxy,
68 const char *event_type,
69 const char *class_type,
70 void *object,
71 sc_core::sc_time *timestamp) override {}
72
73 // scli::ProcessActionInterface
74 void process_state_change(scla::ProxyInterface *proxy,
75 const char *event_type,
76 const char *class_type,
77 void *object,
78 sc_core::sc_time *timestamp,
79 bool internal) override {}
80
81 // scli::SignalActionInterface
82 void fired(scla::ProxyInterface *proxy) override {}
83
84 // scli::SignalPortActionInterface
85 void signal_port_value_update(scla::ProxyInterface *proxy,
86 sc_core::sc_object *signal) override {}
87
88 // scli::TlmFwActionInterface
89 void nb_transport_fw_pre(scla::ProxyInterface *proxy,
90 tlm::tlm_generic_payload *trans,
91 tlm::tlm_phase *phase,
92 sc_core::sc_time *delay) override {}
93 void nb_transport_fw_post(scla::ProxyInterface *proxy,
94 tlm::tlm_generic_payload *trans,
95 tlm::tlm_phase *phase,
96 sc_core::sc_time *delay,
97 tlm::tlm_sync_enum *ret) override {}
98 void b_transport_pre(scla::ProxyInterface *proxy,
99 tlm::tlm_generic_payload *trans,
100 sc_core::sc_time *delay) override {}
101 void b_transport_post(scla::ProxyInterface *proxy,
102 tlm::tlm_generic_payload *trans,
103 sc_core::sc_time *delay) override {}
104 void get_direct_mem_ptr_pre(scla::ProxyInterface *proxy,
105 tlm::tlm_generic_payload *trans,
106 tlm::tlm_dmi *dmi_data) override {}
107 void get_direct_mem_ptr_post(scla::ProxyInterface *proxy,
108 tlm::tlm_generic_payload *trans,
109 tlm::tlm_dmi *dmi_data,
110 bool *ret) override {}
111 void transport_dbg_pre(scla::ProxyInterface *proxy,
112 tlm::tlm_generic_payload *trans) override {}
113 void transport_dbg_post(scla::ProxyInterface *proxy,
114 tlm::tlm_generic_payload *trans,
115 unsigned int *ret) override {}
116
117 // scli::TlmBwActionInterface
118 void nb_transport_bw_pre(scla::ProxyInterface *proxy,
119 tlm::tlm_generic_payload *trans,
120 tlm::tlm_phase *phase,
121 sc_core::sc_time *delay) override {}
122 void nb_transport_bw_post(scla::ProxyInterface *proxy,
123 tlm::tlm_generic_payload *trans,
124 tlm::tlm_phase *phase,
125 sc_core::sc_time *delay,
126 tlm::tlm_sync_enum *ret) override {}
127 void invalidate_direct_mem_ptr_pre(scla::ProxyInterface *proxy,
128 uint64 *start_range,
129 uint64 *end_range) override {}
130 void invalidate_direct_mem_ptr_post(scla::ProxyInterface *proxy,
131 uint64 *start_range,
132 uint64 *end_range) override {}
133};
134
135template <class T>
136simics::ConfClassPtr ScTool::register_class(std::string name,
137 std::string long_name,
138 std::string documentation) {
139 auto cls = simics::make_class<T>(name, long_name,
140 documentation,
141 Sim_Class_Kind_Pseudo);
142 cls->add(scl::iface::createAdapter<scli::ToolSimicsAdapter<T>>());
143 return cls;
144}
145
146} // namespace tools
147} // namespace systemc
148} // namespace simics
149
150#endif
Definition: sc_tool.h:51
void transport_dbg_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans) override
Definition: sc_tool.h:111
void signal_port_value_update(scla::ProxyInterface *proxy, sc_core::sc_object *signal) override
Definition: sc_tool.h:85
void disconnect(conf_object_t *conn) override
void nb_transport_bw_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay, tlm::tlm_sync_enum *ret) override
Definition: sc_tool.h:122
void nb_transport_bw_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay) override
Definition: sc_tool.h:118
void invalidate_direct_mem_ptr_post(scla::ProxyInterface *proxy, uint64 *start_range, uint64 *end_range) override
Definition: sc_tool.h:130
void get_direct_mem_ptr_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_dmi *dmi_data) override
Definition: sc_tool.h:104
void b_transport_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, sc_core::sc_time *delay) override
Definition: sc_tool.h:98
void transport_dbg_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, unsigned int *ret) override
Definition: sc_tool.h:113
void process_state_change(scla::ProxyInterface *proxy, const char *event_type, const char *class_type, void *object, sc_core::sc_time *timestamp, bool internal) override
Definition: sc_tool.h:74
void nb_transport_fw_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay) override
Definition: sc_tool.h:89
void nb_transport_fw_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay, tlm::tlm_sync_enum *ret) override
Definition: sc_tool.h:93
conf_object_t * connect(conf_object_t *controller, attr_value_t args) override
void fired(scla::ProxyInterface *proxy) override
Definition: sc_tool.h:82
void b_transport_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, sc_core::sc_time *delay) override
Definition: sc_tool.h:101
static simics::ConfClassPtr register_class(std::string name, std::string long_name, std::string documentation)
Definition: sc_tool.h:136
ScTool(simics::ConfObjectRef o)
Definition: sc_tool.h:53
void triggered(scla::ProxyInterface *proxy, const char *event_type, const char *class_type, void *object, sc_core::sc_time *timestamp) override
Definition: sc_tool.h:67
void get_direct_mem_ptr_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_dmi *dmi_data, bool *ret) override
Definition: sc_tool.h:107
void invalidate_direct_mem_ptr_pre(scla::ProxyInterface *proxy, uint64 *start_range, uint64 *end_range) override
Definition: sc_tool.h:127
Definition: adapter.h:82
Definition: adapter.h:81