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