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