SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_process_profiler_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_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_SC_PROCESS_PROFILER_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, typename TInterface = ScProcessProfilerInterface>
32 : public SimicsAdapter<sc_process_profiler_interface_t> {
33 public:
35 : SimicsAdapter<sc_process_profiler_interface_t>(
36 SC_PROCESS_PROFILER_INTERFACE,
37 init_iface()) {
38 }
39
40 protected:
41 static ::uint64 min_time(conf_object_t *obj) {
42 return adapter<TBase, TInterface>(obj)->min_time();
43 }
44 static ::uint64 max_time(conf_object_t *obj) {
45 return adapter<TBase, TInterface>(obj)->max_time();
46 }
47 static ::uint64 total_time(conf_object_t *obj) {
48 return adapter<TBase, TInterface>(obj)->total_time();
49 }
50 static ::uint64 number_of_calls(conf_object_t *obj) {
51 return adapter<TBase, TInterface>(obj)->number_of_calls();
52 }
53
54 private:
55 std::vector<std::string> description(conf_object_t *obj,
56 DescriptionType type) override {
57 return descriptionBase<TBase, TInterface>(obj, type);
58 }
59 sc_process_profiler_interface_t init_iface() {
60 sc_process_profiler_interface_t iface = {};
61 iface.min_time = min_time;
62 iface.max_time = max_time;
63 iface.total_time = total_time;
64 iface.number_of_calls = number_of_calls;
65 return iface;
66 }
67};
68
69} // namespace iface
70} // namespace systemc
71} // namespace simics
72
73#endif // SIMICS_SYSTEMC_IFACE_SC_PROCESS_PROFILER_SIMICS_ADAPTER_H
Definition: sc_process_profiler_simics_adapter.h:32
ScProcessProfilerSimicsAdapter()
Definition: sc_process_profiler_simics_adapter.h:34
::uint64 max_time(conf_object_t *obj)
Definition: sc_process_profiler_simics_adapter.h:44
::uint64 number_of_calls(conf_object_t *obj)
Definition: sc_process_profiler_simics_adapter.h:50
::uint64 total_time(conf_object_t *obj)
Definition: sc_process_profiler_simics_adapter.h:47
::uint64 min_time(conf_object_t *obj)
Definition: sc_process_profiler_simics_adapter.h:41
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