SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
bank_instrumentation_subscribe_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2019 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_BANK_INSTRUMENTATION_SUBSCRIBE_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_INSTRUMENTATION_BANK_INSTRUMENTATION_SUBSCRIBE_SIMICS_ADAPTER_H
16
17#include <simics/model-iface/bank-instrumentation.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace iface {
27namespace instrumentation {
28
29template<typename TBase,
30 typename TInterface = BankInstrumentationSubscribeInterface>
32 : public SimicsAdapter<bank_instrumentation_subscribe_interface_t> {
33 public:
35 : SimicsAdapter<bank_instrumentation_subscribe_interface_t>(
36 BANK_INSTRUMENTATION_SUBSCRIBE_INTERFACE, init_iface()) {
37 }
38
39 static bank_callback_handle_t register_before_read(
40 conf_object_t *NOTNULL bank,
41 conf_object_t *connection,
42 ::uint64 offset,
43 ::uint64 size,
44 before_read_callback_t before_read,
45 lang_void *user_data) {
46 return adapter<TBase, TInterface>(bank)->register_before_read(
47 connection, offset, size, before_read, user_data);
48 }
49 static bank_callback_handle_t register_after_read(
50 conf_object_t *NOTNULL bank,
51 conf_object_t *connection,
52 ::uint64 offset,
53 ::uint64 size,
54 after_read_callback_t after_read,
55 lang_void *user_data) {
56 return adapter<TBase, TInterface>(bank)->register_after_read(
57 connection, offset, size, after_read, user_data);
58 }
59 static bank_callback_handle_t register_before_write(
60 conf_object_t *NOTNULL bank,
61 conf_object_t *connection,
62 ::uint64 offset,
63 ::uint64 size,
64 before_write_callback_t before_write,
65 lang_void *user_data) {
66 return adapter<TBase, TInterface>(bank)->register_before_write(
67 connection, offset, size, before_write, user_data);
68 }
69 static bank_callback_handle_t register_after_write(
70 conf_object_t *NOTNULL bank,
71 conf_object_t *connection,
72 ::uint64 offset,
73 ::uint64 size,
74 after_write_callback_t after_write,
75 lang_void *user_data) {
76 return adapter<TBase, TInterface>(bank)->register_after_write(
77 connection, offset, size, after_write, user_data);
78 }
79
80 static void remove_callback(conf_object_t *NOTNULL bank,
81 bank_callback_handle_t callback) {
82 adapter<TBase, TInterface>(bank)->remove_callback(callback);
83 }
84
85 static void remove_connection_callbacks(conf_object_t *NOTNULL bank,
86 conf_object_t *NOTNULL connection) {
87 adapter<TBase, TInterface>(bank)->remove_connection_callbacks(
88 connection);
89 }
90 static void enable_connection_callbacks(conf_object_t *NOTNULL bank,
91 conf_object_t *NOTNULL connection) {
92 adapter<TBase, TInterface>(bank)->enable_connection_callbacks(
93 connection);
94 }
96 conf_object_t *NOTNULL bank, conf_object_t *NOTNULL connection) {
97 adapter<TBase, TInterface>(bank)->disable_connection_callbacks(
98 connection);
99 }
100
101 private:
102 std::vector<std::string> description(conf_object_t *obj,
103 DescriptionType type) override {
104 return descriptionBase<TBase, TInterface>(obj, type);
105 }
106 bank_instrumentation_subscribe_interface_t init_iface() {
107 bank_instrumentation_subscribe_interface_t iface = {};
108 iface.register_before_read = register_before_read;
109 iface.register_after_read = register_after_read;
110 iface.register_before_write = register_before_write;
111 iface.register_after_write = register_after_write;
112 iface.remove_callback = remove_callback;
113 iface.remove_connection_callbacks = remove_connection_callbacks;
114 iface.enable_connection_callbacks = enable_connection_callbacks;
115 iface.disable_connection_callbacks = disable_connection_callbacks;
116 return iface;
117 }
118};
119
120} // namespace instrumentation
121} // namespace iface
122} // namespace systemc
123} // namespace simics
124
125#endif
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
Definition: bank_instrumentation_subscribe_simics_adapter.h:32
static bank_callback_handle_t register_after_read(conf_object_t *NOTNULL bank, conf_object_t *connection, ::uint64 offset, ::uint64 size, after_read_callback_t after_read, lang_void *user_data)
Definition: bank_instrumentation_subscribe_simics_adapter.h:49
static bank_callback_handle_t register_before_write(conf_object_t *NOTNULL bank, conf_object_t *connection, ::uint64 offset, ::uint64 size, before_write_callback_t before_write, lang_void *user_data)
Definition: bank_instrumentation_subscribe_simics_adapter.h:59
static void remove_connection_callbacks(conf_object_t *NOTNULL bank, conf_object_t *NOTNULL connection)
Definition: bank_instrumentation_subscribe_simics_adapter.h:85
static bank_callback_handle_t register_after_write(conf_object_t *NOTNULL bank, conf_object_t *connection, ::uint64 offset, ::uint64 size, after_write_callback_t after_write, lang_void *user_data)
Definition: bank_instrumentation_subscribe_simics_adapter.h:69
BankInstrumentationSubscribeSimicsAdapter()
Definition: bank_instrumentation_subscribe_simics_adapter.h:34
static void enable_connection_callbacks(conf_object_t *NOTNULL bank, conf_object_t *NOTNULL connection)
Definition: bank_instrumentation_subscribe_simics_adapter.h:90
static void remove_callback(conf_object_t *NOTNULL bank, bank_callback_handle_t callback)
Definition: bank_instrumentation_subscribe_simics_adapter.h:80
static void disable_connection_callbacks(conf_object_t *NOTNULL bank, conf_object_t *NOTNULL connection)
Definition: bank_instrumentation_subscribe_simics_adapter.h:95
static bank_callback_handle_t register_before_read(conf_object_t *NOTNULL bank, conf_object_t *connection, ::uint64 offset, ::uint64 size, before_read_callback_t before_read, lang_void *user_data)
Definition: bank_instrumentation_subscribe_simics_adapter.h:39
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79