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