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_SYSTEMC2SIMICS_SIGNAL_H
17#define SIMICS_SYSTEMC_SYSTEMC2SIMICS_SIGNAL_H
18
19#include <systemc>
20
25
26namespace simics {
27namespace systemc {
28namespace systemc2simics {
29
31 public:
33 : simics::systemc::InterfaceProvider("signal"),
34 gasket_(new NullSignal) {
35 }
37
38 // Operator for accessing the signal
39 // NOTE: non-const access is not a supported use-case
40 const sc_core::sc_signal<bool,
41 sc_core::SC_MANY_WRITERS> *operator->() const {
42 FATAL_ERROR_IF(dynamic_cast<Gasket*>(gasket_) == NULL,
43 "Missing call to systemc2simics::Signal::set_pin()");
44 return gasket_->signal();
45 }
46
47 // API: must be called from Adapter CTOR
48 void set_pin(sc_core::sc_inout<bool> *target_pin);
49
50 private:
51 GasketInterface *gasket_;
52};
53
54} // namespace systemc2simics
55} // namespace systemc
56} // namespace simics
57
58#endif
Returns the interface provided by the associated Simics object.
Definition: interface_provider.h:32
Definition: gasket_interface.h:28
virtual sc_core::sc_signal< bool, sc_core::SC_MANY_WRITERS > * signal()=0
Gasket for translating a SystemC sc_signal of type bool into a Simics signal interface call.
Definition: gasket.h:40
Utility class that counts the number of instances.
Definition: null_signal.h:35
void set_pin(sc_core::sc_inout< bool > *target_pin)
const sc_core::sc_signal< bool, sc_core::SC_MANY_WRITERS > * operator->() const
Definition: signal.h:41
Definition: pci_bus_interface.h:24