SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
gasket.h
Go to the documentation of this file.
1/*
2 © 2019 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_GASKET_H
15#define SIMICS_SYSTEMC_SIMICS2SYSTEMC_GASKET_H
16
17#include <systemc>
18
20
21#include <string>
22
23#if INTC_EXT && USE_SIMICS_CHECKPOINTING
24#include <systemc-checkpoint/serialization/sc_signal.h>
25#include <systemc-checkpoint/serialization/serializer.h>
26#include <systemc-checkpoint/serialization/smd.h>
27#endif
28
29namespace simics {
30namespace systemc {
31namespace simics2systemc {
32
36 , public sc_core::sc_module {
37 public:
38 friend class GasketSerializable;
39 explicit GasketBase(sc_core::sc_module_name) : output_pin_("output_pin") {}
40 sc_core::sc_signal<bool> *output_pin() override {
41 return &output_pin_;
42 }
43 std::string gasket_name() const override {
44 return name();
45 }
46
47 private:
48 sc_core::sc_signal<bool> output_pin_;
49};
50
51#if INTC_EXT && USE_SIMICS_CHECKPOINTING
52/*
53 * This class responsible for serializing the state of output_pin_
54 *
55 * This class is visible only when USE_SIMICS_CHECKPOINTING=yes
56 */
57class GasketSerializable : public GasketBase {
58 public:
59 explicit GasketSerializable(sc_core::sc_module_name);
60
61 friend class cci::serialization::access;
62 template <class Archive>
63 void serialize(Archive& ar, const unsigned int version) { // NOLINT
64 ar & SMD(output_pin_);
65 }
66 static sc_checkpoint::serialization::Serializer<
67 GasketSerializable> output_pin_serializer;
68};
69using Gasket = GasketSerializable;
70#else
72#endif
73
74} // namespace simics2systemc
75} // namespace systemc
76} // namespace simics
77
78#endif
Gasket for translating a Simics signal interface into a SystemC sc_signal of type bool.
Definition: gasket.h:36
std::string gasket_name() const override
Definition: gasket.h:43
GasketBase(sc_core::sc_module_name)
Definition: gasket.h:39
sc_core::sc_signal< bool > * output_pin() override
Definition: gasket.h:40
friend class GasketSerializable
Definition: gasket.h:38
Definition: gasket_interface.h:28
GasketBase Gasket
Definition: gasket.h:71
Definition: adapter.h:79