SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
signal.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2013 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_H
17#define SIMICS_SYSTEMC_SIMICS2SYSTEMC_SIGNAL_H
18
19#include <simics/cc-api.h>
20#include <systemc>
21
26
27namespace simics {
28namespace systemc {
29namespace simics2systemc {
30
32 public:
33 friend class SignalSerializable;
35 SignalBase(const SignalBase&) = delete;
36 SignalBase& operator=(const SignalBase&) = delete;
38
39 // iface::SignalInterface
40 void raise() override {
41 validate_signal_level(true);
42 update(true);
43 }
44 void lower() override {
45 validate_signal_level(false);
46 update(false);
47 }
48
50 InternalInterface *internal);
51 void set_pin(sc_core::sc_in<bool> *target_pin, bool initial_level,
52 const ConfObjectRef &obj);
53 void set_pin(sc_core::sc_inout<bool> *target_pin, bool initial_level,
54 const ConfObjectRef &obj);
56
57 private:
58 void update(bool value);
59 void set_pin(const char *target_pin_name, bool initial_level,
60 const ConfObjectRef &obj);
61 void validate_signal_level(bool raise);
62 virtual void create_gasket(sc_core::sc_module_name);
63
64 ConfObjectRef *simics_obj_;
65 GasketInterface *gasket_;
66 iface::SimulationInterface *simulation_;
67 InternalInterface *internal_;
68};
69
70#if INTC_EXT && USE_SIMICS_CHECKPOINTING
71class SignalSerializable : public SignalBase {
72 public:
73 SignalSerializable();
74
75 private:
76 void create_gasket(sc_core::sc_module_name) override;
77};
78
79using Signal = SignalSerializable;
80#else
82#endif
83
84} // namespace simics2systemc
85} // namespace systemc
86} // namespace simics
87
88#endif
Definition: internal_interface.h:25
Simics signal interface.
Definition: signal_interface.h:28
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: gasket_interface.h:30
void init(iface::SimulationInterface *simulation, InternalInterface *internal)
SignalBase & operator=(const SignalBase &)=delete
friend class SignalSerializable
Definition: signal.h:33
void lower() override
Definition: signal.h:44
void set_pin(sc_core::sc_in< bool > *target_pin, bool initial_level, const ConfObjectRef &obj)
void set_pin(sc_core::sc_inout< bool > *target_pin, bool initial_level, const ConfObjectRef &obj)
SignalBase(const SignalBase &)=delete
void raise() override
Definition: signal.h:40
SignalBase Signal
Definition: signal.h:81
Definition: adapter.h:80