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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 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_SC_PROCESS_PROFILER_CONTROL_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_SC_PROCESS_PROFILER_CONTROL_SIMICS_ADAPTER_H
18
21
22#include <systemc-interfaces.h>
23
24#include <string>
25#include <vector>
26
27namespace simics {
28namespace systemc {
29namespace iface {
30
32template<typename TBase,
33 typename TInterface = ScProcessProfilerControlInterface>
35 : public SimicsAdapter<sc_process_profiler_control_interface_t> {
36 public:
38 : SimicsAdapter<sc_process_profiler_control_interface_t>(
39 SC_PROCESS_PROFILER_CONTROL_INTERFACE,
40 init_iface()) {
41 }
42
43 protected:
44 static bool is_enabled(conf_object_t *obj) {
45 return adapter<TBase, TInterface>(obj)->is_enabled();
46 }
47 static void set_enabled(conf_object_t *obj, bool enable) {
48 return adapter<TBase, TInterface>(obj)->set_enabled(enable);
49 }
50 static ::uint64 total_time(conf_object_t *obj) {
51 return adapter<TBase, TInterface>(obj)->total_time();
52 }
53 static ::uint64 total_number_of_calls(conf_object_t *obj) {
54 return adapter<TBase, TInterface>(obj)->total_number_of_calls();
55 }
56 static void clear_data(conf_object_t *obj) {
57 return adapter<TBase, TInterface>(obj)->clear_data();
58 }
59
60 private:
61 std::vector<std::string> description(conf_object_t *obj,
62 DescriptionType type) {
63 return descriptionBase<TBase, TInterface>(obj, type);
64 }
65 sc_process_profiler_control_interface_t init_iface() {
66 sc_process_profiler_control_interface_t iface = {};
67 iface.is_enabled = is_enabled;
68 iface.set_enabled = set_enabled;
69 iface.total_time = total_time;
70 iface.total_number_of_calls = total_number_of_calls;
71 iface.clear_data = clear_data;
72 return iface;
73 }
74};
75
76} // namespace iface
77} // namespace systemc
78} // namespace simics
79
80#endif
Definition: sc_process_profiler_control_simics_adapter.h:35
ScProcessProfilerControlSimicsAdapter()
Definition: sc_process_profiler_control_simics_adapter.h:37
::uint64 total_time(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:50
static bool is_enabled(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:44
static void set_enabled(conf_object_t *obj, bool enable)
Definition: sc_process_profiler_control_simics_adapter.h:47
static void clear_data(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:56
::uint64 total_number_of_calls(conf_object_t *obj)
Definition: sc_process_profiler_control_simics_adapter.h:53
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24