gem5  v20.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_core::sc_prim_channel::timed_out
bool timed_out()
Definition: sc_prim.cc:156
sc_gem5::Channel::requestUpdate
void requestUpdate()
Definition: channel.cc:47
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
sc_core
Definition: messages.cc:31
sc_core::sc_time_unit
sc_time_unit
Definition: sc_time.hh:40
sc_core::sc_event_and_list
Definition: sc_event.hh:61
sc_core::sc_prim_channel::wait
void wait()
Definition: sc_prim.cc:162
sc_core::sc_event_or_list
Definition: sc_event.hh:93
sc_core::sc_prim_channel::next_trigger
void next_trigger()
Definition: sc_prim.cc:82
messages.hh
sc_core::timed_out
bool timed_out()
Definition: sc_module.cc:626
sc_core::sc_prim_channel::request_update
void request_update()
Definition: sc_prim.cc:70
sc_gem5::Scheduler::changeStamp
uint64_t changeStamp()
Definition: scheduler.hh:364
sc_gem5::Channel::asyncRequestUpdate
void asyncRequestUpdate()
Definition: channel.cc:53
sc_gem5::getChangeStamp
uint64_t getChangeStamp()
Definition: sc_prim.cc:37
sc_core::SC_ID_INSERT_PRIM_CHANNEL_
const char SC_ID_INSERT_PRIM_CHANNEL_[]
Definition: messages.cc:50
SC_REPORT_ERROR
#define SC_REPORT_ERROR(msg_type, msg)
Definition: sc_report_handler.hh:127
sc_core::sc_prim_channel::~sc_prim_channel
virtual ~sc_prim_channel()
Definition: sc_prim.cc:67
sc_core::sc_prim_channel::async_request_update
void async_request_update()
Definition: sc_prim.cc:76
sc_core::sc_event
Definition: sc_event.hh:169
ArmISA::d
Bitfield< 9 > d
Definition: miscregs_types.hh:60
sc_main.hh
sc_core::sc_time
Definition: sc_time.hh:49
sc_core::sc_prim_channel::sc_prim_channel
sc_prim_channel()
Definition: sc_prim.cc:44
channel.hh
sc_core::sc_object
Definition: sc_object.hh:50
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
ArmISA::u
Bitfield< 22 > u
Definition: miscregs_types.hh:348
sc_core::wait
void wait()
Definition: sc_module.cc:653
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
sc_gem5
Definition: sc_clock.cc:42
sc_gem5::scheduler
Scheduler scheduler
Definition: scheduler.cc:489
sc_gem5::Channel
Definition: channel.hh:39
sc_prim.hh
sc_core::next_trigger
void next_trigger()
Definition: sc_module.cc:538
scheduler.hh
sc_core::sc_prim_channel::_gem5_channel
sc_gem5::Channel * _gem5_channel
Definition: sc_prim.hh:107
sc_core::sc_is_running
bool sc_is_running()
Definition: sc_main.cc:142

Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17