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 virtual conf_object_t *connect(conf_object_t *controller,
56 attr_value_t args);
57 virtual void disconnect(conf_object_t *conn);
58
59 // Registers a simics configuration class with all action interfaces.
60 template <class T>
61 static std::unique_ptr<simics::ConfClass> register_class(
62 std::string name, std::string long_name, std::string documentation);
63
64 protected:
65 // scli::EventActionInterface
66 virtual void triggered(scla::ProxyInterface *proxy,
67 const char *event_type,
68 const char *class_type,
69 void *object,
70 sc_core::sc_time *timestamp) {}
71
72 // scli::ProcessActionInterface
73 virtual void process_state_change(scla::ProxyInterface *proxy,
74 const char *event_type,
75 const char *class_type,
76 void *object,
77 sc_core::sc_time *timestamp,
78 bool internal) {}
79
80 // scli::SignalActionInterface
81 virtual void fired(scla::ProxyInterface *proxy) {}
82
83 // scli::SignalPortActionInterface
84 virtual void signal_port_value_update(scla::ProxyInterface *proxy,
85 sc_core::sc_object *signal) {}
86
87 // scli::TlmFwActionInterface
88 virtual void nb_transport_fw_pre(scla::ProxyInterface *proxy,
89 tlm::tlm_generic_payload *trans,
90 tlm::tlm_phase *phase,
91 sc_core::sc_time *delay) {}
92 virtual void nb_transport_fw_post(scla::ProxyInterface *proxy,
93 tlm::tlm_generic_payload *trans,
94 tlm::tlm_phase *phase,
95 sc_core::sc_time *delay,
96 tlm::tlm_sync_enum *ret) {}
97 virtual void b_transport_pre(scla::ProxyInterface *proxy,
98 tlm::tlm_generic_payload *trans,
99 sc_core::sc_time *delay) {}
100 virtual void b_transport_post(scla::ProxyInterface *proxy,
101 tlm::tlm_generic_payload *trans,
102 sc_core::sc_time *delay) {}
103 virtual void get_direct_mem_ptr_pre(scla::ProxyInterface *proxy,
104 tlm::tlm_generic_payload *trans,
105 tlm::tlm_dmi *dmi_data) {}
106 virtual void get_direct_mem_ptr_post(scla::ProxyInterface *proxy,
107 tlm::tlm_generic_payload *trans,
108 tlm::tlm_dmi *dmi_data,
109 bool *ret) {}
110 virtual void transport_dbg_pre(scla::ProxyInterface *proxy,
111 tlm::tlm_generic_payload *trans) {}
112 virtual void transport_dbg_post(scla::ProxyInterface *proxy,
113 tlm::tlm_generic_payload *trans,
114 unsigned int *ret) {}
115
116 // scli::TlmBwActionInterface
117 virtual void nb_transport_bw_pre(scla::ProxyInterface *proxy,
118 tlm::tlm_generic_payload *trans,
119 tlm::tlm_phase *phase,
120 sc_core::sc_time *delay) {}
121 virtual void nb_transport_bw_post(scla::ProxyInterface *proxy,
122 tlm::tlm_generic_payload *trans,
123 tlm::tlm_phase *phase,
124 sc_core::sc_time *delay,
125 tlm::tlm_sync_enum *ret) {}
126 virtual void invalidate_direct_mem_ptr_pre(scla::ProxyInterface *proxy,
127 uint64 *start_range,
128 uint64 *end_range) {}
129 virtual void invalidate_direct_mem_ptr_post(scla::ProxyInterface *proxy,
130 uint64 *start_range,
131 uint64 *end_range) {}
132};
133
134template <class T>
135std::unique_ptr<simics::ConfClass> ScTool::register_class(
136 std::string name, std::string long_name, 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:51
virtual void transport_dbg_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, unsigned int *ret)
Definition: sc_tool.h:112
virtual void nb_transport_fw_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay)
Definition: sc_tool.h:88
virtual void invalidate_direct_mem_ptr_post(scla::ProxyInterface *proxy, uint64 *start_range, uint64 *end_range)
Definition: sc_tool.h:129
virtual void get_direct_mem_ptr_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_dmi *dmi_data, bool *ret)
Definition: sc_tool.h:106
virtual void get_direct_mem_ptr_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_dmi *dmi_data)
Definition: sc_tool.h:103
virtual void nb_transport_bw_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, tlm::tlm_phase *phase, sc_core::sc_time *delay)
Definition: sc_tool.h:117
static std::unique_ptr< simics::ConfClass > register_class(std::string name, std::string long_name, std::string documentation)
Definition: sc_tool.h:135
virtual 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)
Definition: sc_tool.h:92
virtual void transport_dbg_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans)
Definition: sc_tool.h:110
virtual void signal_port_value_update(scla::ProxyInterface *proxy, sc_core::sc_object *signal)
Definition: sc_tool.h:84
virtual void disconnect(conf_object_t *conn)
virtual void triggered(scla::ProxyInterface *proxy, const char *event_type, const char *class_type, void *object, sc_core::sc_time *timestamp)
Definition: sc_tool.h:66
ScTool(simics::ConfObjectRef o)
Definition: sc_tool.h:53
virtual void b_transport_post(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, sc_core::sc_time *delay)
Definition: sc_tool.h:100
virtual void b_transport_pre(scla::ProxyInterface *proxy, tlm::tlm_generic_payload *trans, sc_core::sc_time *delay)
Definition: sc_tool.h:97
virtual conf_object_t * connect(conf_object_t *controller, attr_value_t args)
virtual 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)
Definition: sc_tool.h:121
virtual void invalidate_direct_mem_ptr_pre(scla::ProxyInterface *proxy, uint64 *start_range, uint64 *end_range)
Definition: sc_tool.h:126
virtual void process_state_change(scla::ProxyInterface *proxy, const char *event_type, const char *class_type, void *object, sc_core::sc_time *timestamp, bool internal)
Definition: sc_tool.h:73
virtual void fired(scla::ProxyInterface *proxy)
Definition: sc_tool.h:81
Definition: adapter.h:78
Definition: pci_bus_interface.h:24