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