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_SYSTEMC2SIMICS_GASKET_H
17#define SIMICS_SYSTEMC_SYSTEMC2SIMICS_GASKET_H
18
19#include <systemc>
24
25#include <string>
26
27#if INTC_EXT && USE_SIMICS_CHECKPOINTING
28#include <systemc-checkpoint/serialization/sc_signal.h>
29#include <systemc-checkpoint/serialization/serializer.h>
30#include <systemc-checkpoint/serialization/smd.h>
31#endif
32
33namespace simics {
34namespace systemc {
35namespace systemc2simics {
36
39class Gasket : public Registrant<GasketInterface>
40 , public sc_core::sc_module {
41 public:
43 Gasket(sc_core::sc_module_name,
45 : signal_("signal"),
46 provider_(provider) {
47#ifndef RISC_SIMICS
48 SC_THREAD(update);
49#endif
50 }
51
52 virtual sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> *signal() {
53 return &signal_;
54 }
55 std::string gasket_name() const override {
56 return name();
57 }
58 const InterfaceProvider *interface_provider() const override {
59 return provider_;
60 }
61
62 private:
63 void update();
64 void call_iface(bool value);
65
66#if INTC_EXT && USE_SIMICS_CHECKPOINTING
67 friend class cci::serialization::access;
68 template <class Archive>
69 void serialize(Archive &ar, const unsigned int version) { // NOLINT
70 ar & SMD(signal_);
71 }
72#endif
73
74 sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> signal_;
76 NullSimulation null_simulation_;
77};
78
79#if INTC_EXT && USE_SIMICS_CHECKPOINTING
80static sc_checkpoint::serialization::Serializer<Gasket> gasket_serializer;
81#endif
82
83} // namespace systemc2simics
84} // namespace systemc
85} // namespace simics
86
87#endif
Returns the interface provided by the associated Simics object.
Definition: interface_provider.h:32
Definition: null_simulation.h:28
Definition: registry.h:88
Gasket for translating a SystemC sc_signal of type bool into a Simics signal interface call.
Definition: gasket.h:40
std::string gasket_name() const override
Definition: gasket.h:55
Gasket(sc_core::sc_module_name, simics::systemc::InterfaceProvider *provider)
Definition: gasket.h:43
virtual sc_core::sc_signal< bool, sc_core::SC_MANY_WRITERS > * signal()
Definition: gasket.h:52
const InterfaceProvider * interface_provider() const override
Definition: gasket.h:58
Definition: pci_bus_interface.h:24