SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
simcontext_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_SIMCONTEXT_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_SIMCONTEXT_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 = SimContextInterface>
34 : public SimicsAdapter<sc_simcontext_interface_t> {
35 public:
37 : SimicsAdapter<sc_simcontext_interface_t>(
38 SC_SIMCONTEXT_INTERFACE, init_iface()) {
39 }
40
41 protected:
42 static ::uint64 time_stamp(conf_object_t *obj) {
43 return adapter<TBase, TInterface>(obj)->time_stamp();
44 }
45 static ::uint64 delta_count(conf_object_t *obj) {
46 return adapter<TBase, TInterface>(obj)->delta_count();
47 }
48 static ::uint64 time_to_pending_activity(conf_object_t *obj) {
49 return adapter<TBase, TInterface>(obj)->time_to_pending_activity();
50 }
51 static int status(conf_object_t *obj) {
52 return adapter<TBase, TInterface>(obj)->status();
53 }
54 static attr_value_t events(conf_object_t *obj) {
55 return adapter<TBase, TInterface>(obj)->events();
56 }
57
58 private:
59 std::vector<std::string> description(conf_object_t *obj,
60 DescriptionType type) {
61 return descriptionBase<TBase, TInterface>(obj, type);
62 }
63 sc_simcontext_interface_t init_iface() {
64 sc_simcontext_interface_t iface = {};
65 iface.time_stamp = time_stamp;
66 iface.delta_count = delta_count;
67 iface.time_to_pending_activity = time_to_pending_activity;
68 iface.status = status;
69 iface.events = events;
70 return iface;
71 }
72};
73
74} // namespace iface
75} // namespace systemc
76} // namespace simics
77
78#endif
Adapter for Simics simulation context interface.
Definition: simcontext_simics_adapter.h:34
static int status(conf_object_t *obj)
Definition: simcontext_simics_adapter.h:51
static attr_value_t events(conf_object_t *obj)
Definition: simcontext_simics_adapter.h:54
::uint64 time_stamp(conf_object_t *obj)
Definition: simcontext_simics_adapter.h:42
::uint64 time_to_pending_activity(conf_object_t *obj)
Definition: simcontext_simics_adapter.h:48
::uint64 delta_count(conf_object_t *obj)
Definition: simcontext_simics_adapter.h:45
SimContextSimicsAdapter()
Definition: simcontext_simics_adapter.h:36
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