gem5 v24.0.0.0
Loading...
Searching...
No Matches
sc_sensitive.cc
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
37
38namespace sc_core
39{
40
41namespace
42{
43
44void
45checkIfRunning()
46{
47 if (sc_is_running())
48 SC_REPORT_ERROR(SC_ID_MAKE_SENSITIVE_, "simulation running");
49}
50
51} // anonymous namespace
52
53sc_sensitive::sc_sensitive() : currentProcess(nullptr) {}
54
57{
58 checkIfRunning();
60 return *this;
61}
62
65{
66 checkIfRunning();
68 return *this;
69}
70
73{
74 checkIfRunning();
76 return *this;
77}
78
86
93
94
95void
97 const sc_signal_in_if<bool> &i)
98{
99 checkIfRunning();
100 sc_gem5::newStaticSensitivityEvent(p, &i.posedge_event());
101}
102
103void
106{
107 checkIfRunning();
108 sc_gem5::newStaticSensitivityEvent(p, &i.posedge_event());
109}
110
111void
113{
114 checkIfRunning();
116}
117
118void
120 const sc_in<sc_dt::sc_logic> &port)
121{
122 checkIfRunning();
124}
125
126void
128{
129 checkIfRunning();
131}
132
133void
135 const sc_inout<sc_dt::sc_logic> &port)
136{
137 checkIfRunning();
139}
140
141void
147
148} // namespace sc_core
sc_sensitive & operator<<(const sc_event &)
::sc_gem5::Process * currentProcess
void operator()(::sc_gem5::Process *p, const sc_signal_in_if< bool > &)
int f(int a, int b)
SwitchingFiber b
bool sc_is_running()
Definition sc_main.cc:141
void newStaticSensitivityInterface(Process *p, const sc_core::sc_interface *i)
void newStaticSensitivityFinder(Process *p, const sc_core::sc_event_finder *f)
void newStaticSensitivityEvent(Process *p, const sc_core::sc_event *e)
void newStaticSensitivityPort(Process *p, const sc_core::sc_port_base *pb)
#define SC_REPORT_ERROR(msg_type, msg)

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0