gem5  v22.1.0.0
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 
28 #include "systemc/core/channel.hh"
33 
34 namespace sc_gem5
35 {
36 
37 uint64_t getChangeStamp() { return scheduler.changeStamp(); }
38 
39 } // namespace sc_gem5
40 
41 namespace sc_core
42 {
43 
44 sc_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  }
52  _gem5_channel = new sc_gem5::Channel(this);
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  }
64  _gem5_channel = new sc_gem5::Channel(this);
65 }
66 
68 
69 void
71 {
73 }
74 
75 void
77 {
79 }
80 
81 void
83 {
85 }
86 
87 void
89 {
91 }
92 
93 void
95 {
97 }
98 
99 void
101 {
103 }
104 
105 void
107 {
109 }
110 
111 void
113 {
115 }
116 
117 void
119 {
121 }
122 
123 void
125 {
127 }
128 
129 void
131 {
133 }
134 
135 void
137  double d, sc_time_unit u, const sc_event_or_list &eol)
138 {
139  ::sc_core::next_trigger(d, u, eol);
140 }
141 
142 void
144 {
146 }
147 
148 void
150  double d, sc_time_unit u, const sc_event_and_list &eal)
151 {
152  ::sc_core::next_trigger(d, u, eal);
153 }
154 
155 bool
157 {
159 }
160 
161 void
163 {
164  ::sc_core::wait();
165 }
166 
167 void
169 {
171 }
172 
173 void
175 {
177 }
178 
179 void
181 {
182  ::sc_core::wait(eol);
183 }
184 
185 void
187 {
188  ::sc_core::wait(eal);
189 }
190 
191 void
193 {
195 }
196 
197 void
199 {
200  ::sc_core::wait(d, u);
201 }
202 
203 void
205 {
206  ::sc_core::wait(t, e);
207 }
208 
209 void
211 {
212  ::sc_core::wait(d, u, e);
213 }
214 
215 void
217 {
218  ::sc_core::wait(t, eol);
219 }
220 
221 void
223 {
224  ::sc_core::wait(d, u, eol);
225 }
226 
227 void
229 {
230  ::sc_core::wait(t, eal);
231 }
232 
233 void
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
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 9 > e
Definition: misc_types.hh:65
Bitfield< 22 > u
Definition: misc_types.hh:359
Bitfield< 9 > d
Definition: misc_types.hh:64
Bitfield< 51 > t
Definition: pagetable.hh:56
const char SC_ID_INSERT_PRIM_CHANNEL_[]
Definition: messages.cc:50
void next_trigger()
Definition: sc_module.cc:538
bool sc_is_running()
Definition: sc_main.cc:141
bool timed_out()
Definition: sc_module.cc:626
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 Wed Dec 21 2022 10:22:40 for gem5 by doxygen 1.9.1