gem5 v24.0.0.0
Loading...
Searching...
No Matches
sc_prim.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
33
34namespace sc_gem5
35{
36
37uint64_t getChangeStamp() { return scheduler.changeStamp(); }
38
39} // namespace sc_gem5
40
41namespace sc_core
42{
43
44sc_prim_channel::sc_prim_channel() : _gem5_channel(nullptr)
45{
46 if (sc_is_running()) {
47 SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "simulation running");
48 }
49 if (::sc_gem5::scheduler.elaborationDone()) {
50 SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "elaboration done");
51 }
53}
54
56 sc_object(_name), _gem5_channel(nullptr)
57{
58 if (sc_is_running()) {
59 SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "simulation running");
60 }
61 if (::sc_gem5::scheduler.elaborationDone()) {
62 SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "elaboration done");
63 }
65}
66
68
69void
74
75void
80
81void
86
87void
92
93void
98
99void
104
105void
110
111void
116
117void
122
123void
125{
127}
128
129void
134
135void
137 double d, sc_time_unit u, const sc_event_or_list &eol)
138{
139 ::sc_core::next_trigger(d, u, eol);
140}
141
142void
147
148void
150 double d, sc_time_unit u, const sc_event_and_list &eal)
151{
152 ::sc_core::next_trigger(d, u, eal);
153}
154
155bool
157{
158 return ::sc_core::timed_out();
159}
160
161void
166
167void
169{
171}
172
173void
178
179void
184
185void
190
191void
196
197void
199{
200 ::sc_core::wait(d, u);
201}
202
203void
205{
206 ::sc_core::wait(t, e);
207}
208
209void
211{
212 ::sc_core::wait(d, u, e);
213}
214
215void
217{
218 ::sc_core::wait(t, eol);
219}
220
221void
223{
224 ::sc_core::wait(d, u, eol);
225}
226
227void
229{
230 ::sc_core::wait(t, eal);
231}
232
233void
235{
236 ::sc_core::wait(d, u, eal);
237}
238
239} // namespace sc_core
sc_gem5::Channel * _gem5_channel
Definition sc_prim.hh:107
virtual ~sc_prim_channel()
Definition sc_prim.cc:67
void requestUpdate()
Definition channel.cc:47
void asyncRequestUpdate()
Definition channel.cc:53
uint64_t changeStamp()
Definition scheduler.hh:388
void next_trigger()
Definition sc_module.cc:538
bool sc_is_running()
Definition sc_main.cc:141
sc_time_unit
Definition sc_time.hh:40
void wait()
Definition sc_module.cc:653
uint64_t getChangeStamp()
Definition sc_prim.cc:37
Scheduler scheduler
Definition scheduler.cc:494
#define SC_REPORT_ERROR(msg_type, msg)

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