SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_process_profiler_control_simics_adapter.h
Go to the documentation of this file.
1/*
2 © 2015 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_SC_PROCESS_PROFILER_CONTROL_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_PROCESS_PROFILER_CONTROL_SIMICS_ADAPTER_H
16
19
20#include <systemc-interfaces.h>
21
22#include <string>
23#include <vector>
24
25namespace simics {
26namespace systemc {
27namespace iface {
28
30template<typename TBase,
31 typename TInterface = ScProcessProfilerControlInterface>
33 : public SimicsAdapter<sc_process_profiler_control_interface_t> {
34 public:
36 : SimicsAdapter<sc_process_profiler_control_interface_t>(
37 SC_PROCESS_PROFILER_CONTROL_INTERFACE,
38 init_iface()) {
39 }
40
41 protected:
42 static bool is_enabled(conf_object_t *obj) {
43 return adapter<TBase, TInterface>(obj)->is_enabled();
44 }
45 static void set_enabled(conf_object_t *obj, bool enable) {
46 return adapter<TBase, TInterface>(obj)->set_enabled(enable);
47 }
48 static ::uint64 total_time(conf_object_t *obj) {
49 return adapter<TBase, TInterface>(obj)->total_time();
50 }
51 static ::uint64 total_number_of_calls(conf_object_t *obj) {
52 return adapter<TBase, TInterface>(obj)->total_number_of_calls();
53 }
54 static void clear_data(conf_object_t *obj) {
55 return adapter<TBase, TInterface>(obj)->clear_data();
56 }
57
58 private:
59 std::vector<std::string> description(conf_object_t *obj,
60 DescriptionType type) override {
61 return descriptionBase<TBase, TInterface>(obj, type);
62 }
63 sc_process_profiler_control_interface_t init_iface() {
64 sc_process_profiler_control_interface_t iface = {};
65 iface.is_enabled = is_enabled;
66 iface.set_enabled = set_enabled;
67 iface.total_time = total_time;
68 iface.total_number_of_calls = total_number_of_calls;
69 iface.clear_data = clear_data;
70 return iface;
71 }
72};
73
74} // namespace iface
75} // namespace systemc
76} // namespace simics
77
78#endif
Definition: sc_process_profiler_control_simics_adapter.h:33
ScProcessProfilerControlSimicsAdapter()
Definition: sc_process_profiler_control_simics_adapter.h:35
::uint64 total_time(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:48
static bool is_enabled(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:42
static void set_enabled(conf_object_t *obj, bool enable)
Definition: sc_process_profiler_control_simics_adapter.h:45
static void clear_data(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:54
::uint64 total_number_of_calls(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:51
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
Definition: adapter.h:79