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