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 // ProxyInterface
45 void init(sc_core::sc_object *obj,
47 void allProxiesInitialized() override;
48 void breakSimulation() override;
49 ConfObjectRef simics_obj() override;
50 sc_core::sc_object *systemc_obj() override;
51 void buildEventObjects() override;
55 void simulationStarted() override;
56 void simulationEnded() override;
57
58 // ScObjectInterface
59 std::vector<std::string> sc_print() const override;
60 std::vector<std::string> sc_dump() const override;
61 attr_value_t sc_kind() const override;
62 const char *sc_name() const override;
63
64 virtual void set_attributes(Attributes *attributes);
65 virtual void resizeExtensions(tlm::tlm_generic_payload *payload) const;
66
67 template <class T> T *feature() {
68 return dynamic_cast<T *> (feature(ClassType::typeForClass<T>()));
69 }
70 static attr_value_t getAttribute(lang_void *ptr, conf_object_t *obj,
71 attr_value_t *idx);
72 static set_error_t setAttribute(lang_void *ptr, conf_object_t *obj,
73 attr_value_t *val,
74 attr_value_t *idx);
75 static ProxyInterface *findProxy(sc_core::sc_object *obj);
76 static ProxyInterface *findProxy(sc_core::sc_interface *iface);
77 static ScEventObject *findScEventObject(sc_core::sc_event *event);
78 virtual ~Proxy();
79
80 protected:
81 sc_core::sc_object *object_;
82 sc_core::sc_interface *iface_;
83
84 private:
85 Attributes *attributes_;
86 std::vector<ScEventObject *> events_;
87 static std::unordered_map<sc_core::sc_object *, ProxyInterface *> proxies_;
88 static std::unordered_map<sc_core::sc_event *, ScEventObject *> sc_events_;
89 static std::unordered_map<sc_core::sc_interface *, ProxyInterface *>
90 proxies_by_iface_;
91 std::map<ClassType, ProxyFeatureInterface *> features_;
92};
93
94} // namespace awareness
95} // namespace systemc
96} // namespace simics
97
98#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_object * systemc_obj() override
sc_core::sc_interface * iface_
Definition: proxy.h:82
std::vector< std::string > sc_dump() const override
ProxyFeatureInterface * feature(ClassType type) override
attr_value_t sc_kind() const override
virtual void resizeExtensions(tlm::tlm_generic_payload *payload) const
static ScEventObject * findScEventObject(sc_core::sc_event *event)
sc_core::sc_object * object_
Definition: proxy.h:81
static set_error_t setAttribute(lang_void *ptr, conf_object_t *obj, attr_value_t *val, attr_value_t *idx)
void init(sc_core::sc_object *obj, iface::SimulationInterface *simulation) override
static ProxyInterface * findProxy(sc_core::sc_interface *iface)
ConfObjectRef simics_obj() override
const char * sc_name() const override
Proxy(simics::ConfObjectRef o)
static ProxyInterface * findProxy(sc_core::sc_object *obj)
std::vector< std::string > sc_print() const override
void addFeature(ProxyFeatureInterface *feature) override
T * feature()
Definition: proxy.h:67
static attr_value_t getAttribute(lang_void *ptr, conf_object_t *obj, attr_value_t *idx)
iface::SimulationInterface * simulation() override
Definition: sc_event_object.h:27
Definition: sc_object_interface.h:29
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: adapter.h:81