SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
signal_class.h
Go to the documentation of this file.
1/*
2 © 2020 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_CLASS_H
15#define SIMICS_SYSTEMC_SIMICS2SYSTEMC_SIGNAL_CLASS_H
16
17
24
25#include <string>
26
27namespace simics {
28namespace systemc {
29namespace simics2systemc {
30
31class SignalClassBase : public ConfObject,
33 public Version,
37
38 public:
39 explicit SignalClassBase(ConfObjectRef o)
40 : ConfObject(o), initial_level_(false) {}
41 void finalize() override;
42
43 // GasketClassInterface
45 void createGasket(iface::SimulationInterface *simulation) override;
46
47 private:
48 virtual SignalBase *gasket() {return nullptr;}
49
50 std::string signal_name_;
51 bool initial_level_;
52 ConfObjectRef simulation_ref_;
53};
54
56 public SignalGasketAdapter {
57 public:
58 explicit SignalClassNonSerializable(ConfObjectRef o)
59 : SignalClassBase(o),
60 SignalGasketAdapter(&gasket_, this) {}
61
62 static conf_class_t *registerGasketClass(const char* class_name);
63
64 private:
65 SignalBase *gasket() override {
66 return &gasket_;
67 }
68
69 SignalBase gasket_;
70};
71
72#if INTC_EXT && USE_SIMICS_CHECKPOINTING
73class SignalClassSerializable : public SignalClassBase,
74 public SignalGasketAdapter {
75 public:
76 explicit SignalClassSerializable(ConfObjectRef o);
77
78 static conf_class_t *registerGasketClass(const char* class_name);
79
80 private:
81 SignalBase *gasket() override {
82 return &gasket_;
83 }
84
85 SignalSerializable gasket_;
86};
87using SignalClass = SignalClassSerializable;
88#else
90#endif
91} // namespace simics2systemc
92} // namespace systemc // NOLINT
93} // namespace simics // NOLINT
94
95#endif
Definition: gasket_class_interface.h:26
Interface to the SystemC simulation.
Definition: simulation_interface_proxy.h:25
Definition: version.h:41
Definition: sc_version_interface.h:25
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
SignalClassBase(ConfObjectRef o)
Definition: signal_class.h:39
friend class SignalClassSerializable
Definition: signal_class.h:36
iface::ScVersionInterface * version() override
void createGasket(iface::SimulationInterface *simulation) override
static conf_class_t * registerGasketClass(const char *class_name)
SignalClassNonSerializable(ConfObjectRef o)
Definition: signal_class.h:58
Adapter for Signal gasket.
Definition: signal_gasket_adapter.h:33
SignalClassNonSerializable SignalClass
Definition: signal_class.h:89
Definition: adapter.h:79