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 // ScInitiatorGasketInterface
38 void set_dmi(bool enable) override {
39 if (!gasket_) {
40 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
41 "Unexpected error, object is no gasket.");
42 sc_core::sc_stop();
43 return;
44 }
45 gasket_->set_dmi(enable);
46 }
47 bool is_dmi_enabled() override {
48 if (!gasket_) {
49 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
50 "Unexpected error, object is no gasket.");
51 sc_core::sc_stop();
52 return false;
53 }
54 return gasket_->is_dmi_enabled();
55 }
56 char *print_dmi_table() override {
57 if (!gasket_) {
58 SIM_LOG_CRITICAL(simics_obj_, Log_TLM,
59 "Unexpected error, object is no gasket.");
60 sc_core::sc_stop();
61 return NULL;
62 }
63 return MM_STRDUP(gasket_->get_dmi_data_table()->print().c_str());
64 }
65
66 protected:
68 simics::ConfObjectRef simics_obj_;
69};
70
71} // namespace awareness
72} // namespace systemc
73} // namespace simics
74
75#endif
Definition: sc_initiator_gasket.h:30
simics2tlm::GasketInterface * gasket_
Definition: sc_initiator_gasket.h:67
void set_dmi(bool enable) override
Definition: sc_initiator_gasket.h:38
bool is_dmi_enabled() override
Definition: sc_initiator_gasket.h:47
simics::ConfObjectRef simics_obj_
Definition: sc_initiator_gasket.h:68
char * print_dmi_table() override
Definition: sc_initiator_gasket.h:56
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: adapter.h:81