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