SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
proxy.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 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_AWARENESS_PROXY_H
17#define SIMICS_SYSTEMC_AWARENESS_PROXY_H
18
19#include <simics/cc-api.h>
20
21
27#include <systemc>
28#include <tlm>
29
30#include <string>
31#include <unordered_map>
32#include <map>
33#include <vector>
34
35namespace simics {
36namespace systemc {
37namespace awareness {
38
39class Proxy : public simics::ConfObject, public ProxyInterface,
42 public:
43 explicit Proxy(simics::ConfObjectRef o);
44 virtual void init(sc_core::sc_object *obj,
46 virtual void allProxiesInitialized();
47 virtual void set_attributes(Attributes *attributes);
48 static attr_value_t getAttribute(lang_void *ptr, conf_object_t *obj,
49 attr_value_t *idx);
50 static set_error_t setAttribute(lang_void *ptr, conf_object_t *obj,
51 attr_value_t *val,
52 attr_value_t *idx);
53 std::vector<std::string> sc_print() const;
54 std::vector<std::string> sc_dump() const;
55 attr_value_t sc_kind() const;
56 const char *sc_name() const;
58 ConfObjectRef simics_obj();
59 sc_core::sc_object *systemc_obj();
64 virtual void simulationStarted();
65 virtual void simulationEnded();
66 virtual void resizeExtensions(tlm::tlm_generic_payload *payload) const;
67 template <class T> T *feature() {
68 return dynamic_cast<T *> (feature(ClassType::typeForClass<T>()));
69 }
70 static ProxyInterface *findProxy(sc_core::sc_object *obj);
71 static ProxyInterface *findProxy(sc_core::sc_interface *iface);
72 static ScEventObject *findScEventObject(sc_core::sc_event *event);
73 virtual ~Proxy();
74
75 protected:
76 sc_core::sc_object *object_;
77 sc_core::sc_interface *iface_;
78
79 private:
80 Attributes *attributes_;
81 std::vector<ScEventObject *> events_;
82 static std::unordered_map<sc_core::sc_object *, ProxyInterface *> proxies_;
83 static std::unordered_map<sc_core::sc_event *, ScEventObject *> sc_events_;
84 static std::unordered_map<sc_core::sc_interface *, ProxyInterface *>
85 proxies_by_iface_;
86 std::map<ClassType, ProxyFeatureInterface *> features_;
87};
88
89} // namespace awareness
90} // namespace systemc
91} // namespace simics
92
93#endif
Definition: class_type.h:25
Interface to the SystemC simulation.
Definition: simulation_interface_proxy.h:27
Definition: attributes.h:28
Definition: proxy_feature_interface.h:28
Definition: proxy_interface.h:29
Definition: proxy.h:41
virtual void set_attributes(Attributes *attributes)
sc_core::sc_interface * iface_
Definition: proxy.h:77
virtual void init(sc_core::sc_object *obj, iface::SimulationInterface *simulation)
sc_core::sc_object * systemc_obj()
std::vector< std::string > sc_dump() const
virtual iface::SimulationInterface * simulation()
virtual void resizeExtensions(tlm::tlm_generic_payload *payload) const
std::vector< std::string > sc_print() const
static ScEventObject * findScEventObject(sc_core::sc_event *event)
sc_core::sc_object * object_
Definition: proxy.h:76
static set_error_t setAttribute(lang_void *ptr, conf_object_t *obj, attr_value_t *val, attr_value_t *idx)
static ProxyInterface * findProxy(sc_core::sc_interface *iface)
attr_value_t sc_kind() const
virtual ProxyFeatureInterface * feature(ClassType type)
Proxy(simics::ConfObjectRef o)
static ProxyInterface * findProxy(sc_core::sc_object *obj)
virtual void addFeature(ProxyFeatureInterface *feature)
const char * sc_name() const
T * feature()
Definition: proxy.h:67
static attr_value_t getAttribute(lang_void *ptr, conf_object_t *obj, attr_value_t *idx)
Definition: sc_event_object.h:27
Definition: sc_object_interface.h:29
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: pci_bus_interface.h:24