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
24
25#include <string>
26#include <vector>
27
28namespace simics {
29namespace systemc {
30namespace simics2systemc {
31
35 public DescriptionInterface<iface::SignalInterface> {
36 public:
37 SignalGasketAdapter(SignalInterface *signal,
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 {
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
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: description_interface.h:34
Simics signal interface.
Definition: signal_interface.h:28
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
virtual std::string gasket_name() const =0
Adapter for Signal gasket.
Definition: signal_gasket_adapter.h:35
std::vector< std::string > description(DescriptionType type) override
Definition: signal_gasket_adapter.h:51
void lower() override
Definition: signal_gasket_adapter.h:47
SignalGasketAdapter(SignalInterface *signal, iface::SimulationInterface *simulation)
Definition: signal_gasket_adapter.h:37
void raise() override
Definition: signal_gasket_adapter.h:43
DescriptionType
Definition: description_interface.h:25
@ DESCRIPTION_TYPE_SIMICS2SYSTEMC
Definition: description_interface.h:28
Definition: pci_bus_interface.h:24