gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  * Authors: Gabe Black
28  */
29 
30 #include "systemc/core/channel.hh"
35 
36 namespace sc_gem5
37 {
38 
39 uint64_t getChangeStamp() { return scheduler.changeStamp(); }
40 
41 } // namespace sc_gem5
42 
43 namespace sc_core
44 {
45 
46 sc_prim_channel::sc_prim_channel() : _gem5_channel(nullptr)
47 {
48  if (sc_is_running()) {
49  SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "simulation running");
50  }
51  if (::sc_gem5::scheduler.elaborationDone()) {
52  SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "elaboration done");
53  }
54  _gem5_channel = new sc_gem5::Channel(this);
55 }
56 
58  sc_object(_name), _gem5_channel(nullptr)
59 {
60  if (sc_is_running()) {
61  SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "simulation running");
62  }
63  if (::sc_gem5::scheduler.elaborationDone()) {
64  SC_REPORT_ERROR(SC_ID_INSERT_PRIM_CHANNEL_, "elaboration done");
65  }
66  _gem5_channel = new sc_gem5::Channel(this);
67 }
68 
70 
71 void
73 {
75 }
76 
77 void
79 {
81 }
82 
83 void
85 {
87 }
88 
89 void
91 {
93 }
94 
95 void
97 {
99 }
100 
101 void
103 {
105 }
106 
107 void
109 {
111 }
112 
113 void
115 {
117 }
118 
119 void
121 {
123 }
124 
125 void
127 {
128  ::sc_core::next_trigger(d, u, e);
129 }
130 
131 void
133 {
134  ::sc_core::next_trigger(t, eol);
135 }
136 
137 void
139  double d, sc_time_unit u, const sc_event_or_list &eol)
140 {
141  ::sc_core::next_trigger(d, u, eol);
142 }
143 
144 void
146 {
147  ::sc_core::next_trigger(t, eal);
148 }
149 
150 void
152  double d, sc_time_unit u, const sc_event_and_list &eal)
153 {
154  ::sc_core::next_trigger(d, u, eal);
155 }
156 
157 bool
159 {
161 }
162 
163 void
165 {
166  ::sc_core::wait();
167 }
168 
169 void
171 {
172  ::sc_core::wait(i);
173 }
174 
175 void
177 {
178  ::sc_core::wait(e);
179 }
180 
181 void
183 {
184  ::sc_core::wait(eol);
185 }
186 
187 void
189 {
190  ::sc_core::wait(eal);
191 }
192 
193 void
195 {
196  ::sc_core::wait(t);
197 }
198 
199 void
201 {
202  ::sc_core::wait(d, u);
203 }
204 
205 void
207 {
208  ::sc_core::wait(t, e);
209 }
210 
211 void
213 {
214  ::sc_core::wait(d, u, e);
215 }
216 
217 void
219 {
220  ::sc_core::wait(t, eol);
221 }
222 
223 void
225 {
226  ::sc_core::wait(d, u, eol);
227 }
228 
229 void
231 {
232  ::sc_core::wait(t, eal);
233 }
234 
235 void
237 {
238  ::sc_core::wait(d, u, eal);
239 }
240 
241 } // namespace sc_core
uint64_t getChangeStamp()
Definition: sc_prim.cc:39
sc_gem5::Channel * _gem5_channel
Definition: sc_prim.hh:109
bool sc_is_running()
Definition: sc_main.cc:144
Bitfield< 7 > i
sc_time_unit
Definition: sc_time.hh:42
void asyncRequestUpdate()
Definition: channel.cc:55
const char SC_ID_INSERT_PRIM_CHANNEL_[]
Definition: messages.cc:52
Bitfield< 22 > u
void requestUpdate()
Definition: channel.cc:49
Bitfield< 9 > d
Scheduler scheduler
Definition: scheduler.cc:491
virtual ~sc_prim_channel()
Definition: sc_prim.cc:69
uint64_t changeStamp()
Definition: scheduler.hh:366
Bitfield< 9 > e
void wait()
Definition: sc_module.cc:655
#define SC_REPORT_ERROR(msg_type, msg)
void next_trigger()
Definition: sc_module.cc:540
Bitfield< 5 > t
bool timed_out()
Definition: sc_module.cc:628

Generated on Fri Feb 28 2020 16:27:03 for gem5 by doxygen 1.8.13