SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_initiator_gasket.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_AWARENESS_SC_INITIATOR_GASKET_H
15#define SIMICS_SYSTEMC_AWARENESS_SC_INITIATOR_GASKET_H
16
17
18
22
23namespace simics {
24namespace systemc {
25namespace awareness {
26
29 public:
30 explicit ScInitiatorGasket(simics::ConfObjectRef obj)
31 : gasket_(NULL), simics_obj_(obj) {}
32 void init(sc_core::sc_object *obj) {
33 gasket_ = dynamic_cast<simics2tlm::GasketInterface*>(obj);
34 }
35 // ScInitiatorGasketInterface
36 void set_dmi(bool enable) override {
37 if (!gasket_) {
38 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
39 "Unexpected error, object is no gasket.");
40 sc_core::sc_stop();
41 return;
42 }
43 gasket_->set_dmi(enable);
44 }
45 bool is_dmi_enabled() override {
46 if (!gasket_) {
47 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
48 "Unexpected error, object is no gasket.");
49 sc_core::sc_stop();
50 return false;
51 }
52 return gasket_->is_dmi_enabled();
53 }
54 char *print_dmi_table() override {
55 if (!gasket_) {
56 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
57 "Unexpected error, object is no gasket.");
58 sc_core::sc_stop();
59 return NULL;
60 }
61 return MM_STRDUP(gasket_->get_dmi_data_table()->print().c_str());
62 }
63
64 protected:
66 simics::ConfObjectRef simics_obj_;
67};
68
69} // namespace awareness
70} // namespace systemc
71} // namespace simics
72
73#endif
Definition: sc_initiator_gasket.h:28
simics2tlm::GasketInterface * gasket_
Definition: sc_initiator_gasket.h:65
void set_dmi(bool enable) override
Definition: sc_initiator_gasket.h:36
bool is_dmi_enabled() override
Definition: sc_initiator_gasket.h:45
simics::ConfObjectRef simics_obj_
Definition: sc_initiator_gasket.h:66
char * print_dmi_table() override
Definition: sc_initiator_gasket.h:54
ScInitiatorGasket(simics::ConfObjectRef obj)
Definition: sc_initiator_gasket.h:30
void init(sc_core::sc_object *obj)
Definition: sc_initiator_gasket.h:32
Definition: sc_initiator_gasket_interface.h:22
Interface used by simics2tlm gaskets, implemented by Gasket base class.
Definition: gasket_interface.h:33
virtual DmiDataTable * get_dmi_data_table()=0
@ Log_TLM
Definition: adapter_log_groups.h:22
Definition: adapter.h:79