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