SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
Loading...
Searching...
No Matches
signal_gasket_adapter.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_SIMICS2SYSTEMC_SIGNAL_GASKET_ADAPTER_H
17
#define SIMICS_SYSTEMC_SIMICS2SYSTEMC_SIGNAL_GASKET_ADAPTER_H
18
19
#include <
simics/systemc/context.h
>
20
#include <
simics/systemc/description_interface.h
>
21
#include <
simics/systemc/iface/signal_interface.h
>
22
#include <
simics/systemc/iface/simulation_interface.h
>
23
#include <
simics/systemc/simics2systemc/signal.h
>
24
25
#include <string>
26
#include <vector>
27
28
namespace
simics
{
29
namespace
systemc {
30
namespace
simics2systemc {
31
33
class
SignalGasketAdapter
34
:
public
iface::SignalInterface
,
35
public
DescriptionInterface
<iface::SignalInterface> {
36
public
:
37
SignalGasketAdapter
(SignalInterface *signal,
38
iface::SimulationInterface
*simulation)
39
: signal_(signal),
40
simulation_(simulation) {
41
}
42
43
void
raise
()
override
{
44
simics::systemc::Context
context(simulation_);
45
signal_->raise();
46
}
47
void
lower
()
override
{
48
simics::systemc::Context
context(simulation_);
49
signal_->lower();
50
}
51
std::vector<std::string>
description
(
DescriptionType
type)
override
{
52
if
(type !=
DESCRIPTION_TYPE_SIMICS2SYSTEMC
)
53
return
{};
54
55
auto
*signal =
dynamic_cast<
simics2systemc::Signal
*
>
(signal_);
56
if
(!signal)
57
return
{};
58
59
auto
gasket = signal->
gasket
();
60
if
(!gasket)
61
return
{};
62
63
return
{gasket->
gasket_name
(), gasket->output_pin()->name()};
64
}
65
66
private
:
67
SignalInterface *signal_;
68
iface::SimulationInterface
*simulation_;
69
};
70
71
}
// namespace simics2systemc
72
}
// namespace systemc
73
}
// namespace simics
74
75
#endif
simics::systemc::Context
Utility class that handles the context switching, using RAII methodology.
Definition:
context.h:31
simics::systemc::DescriptionInterface
Definition:
description_interface.h:34
simics::systemc::iface::SignalInterface
Simics signal interface.
Definition:
signal_interface.h:28
simics::systemc::iface::SimulationInterface
Interface to the SystemC simulation.
Definition:
simulation_interface.h:27
simics::systemc::simics2systemc::GasketInterface::gasket_name
virtual std::string gasket_name() const =0
simics::systemc::simics2systemc::SignalGasketAdapter
Adapter for Signal gasket.
Definition:
signal_gasket_adapter.h:35
simics::systemc::simics2systemc::SignalGasketAdapter::description
std::vector< std::string > description(DescriptionType type) override
Definition:
signal_gasket_adapter.h:51
simics::systemc::simics2systemc::SignalGasketAdapter::lower
void lower() override
Definition:
signal_gasket_adapter.h:47
simics::systemc::simics2systemc::SignalGasketAdapter::SignalGasketAdapter
SignalGasketAdapter(SignalInterface *signal, iface::SimulationInterface *simulation)
Definition:
signal_gasket_adapter.h:37
simics::systemc::simics2systemc::SignalGasketAdapter::raise
void raise() override
Definition:
signal_gasket_adapter.h:43
simics::systemc::simics2systemc::Signal
Definition:
signal.h:31
simics::systemc::simics2systemc::Signal::gasket
GasketInterface * gasket()
context.h
description_interface.h
simics::systemc::DescriptionType
DescriptionType
Definition:
description_interface.h:25
simics::systemc::DESCRIPTION_TYPE_SIMICS2SYSTEMC
@ DESCRIPTION_TYPE_SIMICS2SYSTEMC
Definition:
description_interface.h:28
simics
Definition:
pci_bus_interface.h:24
signal_interface.h
signal.h
simulation_interface.h