gem5
v24.0.0.0
Loading...
Searching...
No Matches
systemc
core
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
"
29
#include "
systemc/core/scheduler.hh
"
30
#include "
systemc/ext/channel/messages.hh
"
31
#include "
systemc/ext/core/sc_main.hh
"
32
#include "
systemc/ext/core/sc_prim.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
55
sc_prim_channel::sc_prim_channel
(
const
char
*_name) :
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
67
sc_prim_channel::~sc_prim_channel
() {
delete
_gem5_channel
; }
68
69
void
70
sc_prim_channel::request_update
()
71
{
72
_gem5_channel
->
requestUpdate
();
73
}
74
75
void
76
sc_prim_channel::async_request_update
()
77
{
78
_gem5_channel
->
asyncRequestUpdate
();
79
}
80
81
void
82
sc_prim_channel::next_trigger
()
83
{
84
::sc_core::next_trigger
();
85
}
86
87
void
88
sc_prim_channel::next_trigger
(
const
sc_event
&e)
89
{
90
::sc_core::next_trigger
(e);
91
}
92
93
void
94
sc_prim_channel::next_trigger
(
const
sc_event_or_list
&eol)
95
{
96
::sc_core::next_trigger
(eol);
97
}
98
99
void
100
sc_prim_channel::next_trigger
(
const
sc_event_and_list
&eal)
101
{
102
::sc_core::next_trigger
(eal);
103
}
104
105
void
106
sc_prim_channel::next_trigger
(
const
sc_time
&t)
107
{
108
::sc_core::next_trigger
(t);
109
}
110
111
void
112
sc_prim_channel::next_trigger
(
double
d,
sc_time_unit
u)
113
{
114
::sc_core::next_trigger
(d, u);
115
}
116
117
void
118
sc_prim_channel::next_trigger
(
const
sc_time
&t,
const
sc_event
&e)
119
{
120
::sc_core::next_trigger
(t, e);
121
}
122
123
void
124
sc_prim_channel::next_trigger
(
double
d,
sc_time_unit
u,
const
sc_event
&e)
125
{
126
::sc_core::next_trigger
(d, u, e);
127
}
128
129
void
130
sc_prim_channel::next_trigger
(
const
sc_time
&t,
const
sc_event_or_list
&eol)
131
{
132
::sc_core::next_trigger
(t, eol);
133
}
134
135
void
136
sc_prim_channel::next_trigger
(
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
143
sc_prim_channel::next_trigger
(
const
sc_time
&t,
const
sc_event_and_list
&eal)
144
{
145
::sc_core::next_trigger
(t, eal);
146
}
147
148
void
149
sc_prim_channel::next_trigger
(
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
156
sc_prim_channel::timed_out
()
157
{
158
return ::sc_core::timed_out();
159
}
160
161
void
162
sc_prim_channel::wait
()
163
{
164
::sc_core::wait
();
165
}
166
167
void
168
sc_prim_channel::wait
(
int
i)
169
{
170
::sc_core::wait
(i);
171
}
172
173
void
174
sc_prim_channel::wait
(
const
sc_event
&e)
175
{
176
::sc_core::wait
(e);
177
}
178
179
void
180
sc_prim_channel::wait
(
const
sc_event_or_list
&eol)
181
{
182
::sc_core::wait
(eol);
183
}
184
185
void
186
sc_prim_channel::wait
(
const
sc_event_and_list
&eal)
187
{
188
::sc_core::wait
(eal);
189
}
190
191
void
192
sc_prim_channel::wait
(
const
sc_time
&t)
193
{
194
::sc_core::wait
(t);
195
}
196
197
void
198
sc_prim_channel::wait
(
double
d,
sc_time_unit
u)
199
{
200
::sc_core::wait
(d, u);
201
}
202
203
void
204
sc_prim_channel::wait
(
const
sc_time
&t,
const
sc_event
&e)
205
{
206
::sc_core::wait
(t, e);
207
}
208
209
void
210
sc_prim_channel::wait
(
double
d,
sc_time_unit
u,
const
sc_event
&e)
211
{
212
::sc_core::wait
(d, u, e);
213
}
214
215
void
216
sc_prim_channel::wait
(
const
sc_time
&t,
const
sc_event_or_list
&eol)
217
{
218
::sc_core::wait
(t, eol);
219
}
220
221
void
222
sc_prim_channel::wait
(
double
d,
sc_time_unit
u,
const
sc_event_or_list
&eol)
223
{
224
::sc_core::wait
(d, u, eol);
225
}
226
227
void
228
sc_prim_channel::wait
(
const
sc_time
&t,
const
sc_event_and_list
&eal)
229
{
230
::sc_core::wait
(t, eal);
231
}
232
233
void
234
sc_prim_channel::wait
(
double
d,
sc_time_unit
u,
const
sc_event_and_list
&eal)
235
{
236
::sc_core::wait
(d, u, eal);
237
}
238
239
}
// namespace sc_core
messages.hh
channel.hh
sc_core::sc_event_and_list
Definition
sc_event.hh:62
sc_core::sc_event_or_list
Definition
sc_event.hh:94
sc_core::sc_event
Definition
sc_event.hh:170
sc_core::sc_object
Definition
sc_object.hh:51
sc_core::sc_prim_channel::next_trigger
void next_trigger()
Definition
sc_prim.cc:82
sc_core::sc_prim_channel::_gem5_channel
sc_gem5::Channel * _gem5_channel
Definition
sc_prim.hh:107
sc_core::sc_prim_channel::request_update
void request_update()
Definition
sc_prim.cc:70
sc_core::sc_prim_channel::sc_prim_channel
sc_prim_channel()
Definition
sc_prim.cc:44
sc_core::sc_prim_channel::timed_out
bool timed_out()
Definition
sc_prim.cc:156
sc_core::sc_prim_channel::async_request_update
void async_request_update()
Definition
sc_prim.cc:76
sc_core::sc_prim_channel::~sc_prim_channel
virtual ~sc_prim_channel()
Definition
sc_prim.cc:67
sc_core::sc_prim_channel::wait
void wait()
Definition
sc_prim.cc:162
sc_core::sc_time
Definition
sc_time.hh:50
sc_gem5::Channel
Definition
channel.hh:40
sc_gem5::Channel::requestUpdate
void requestUpdate()
Definition
channel.cc:47
sc_gem5::Channel::asyncRequestUpdate
void asyncRequestUpdate()
Definition
channel.cc:53
sc_gem5::Scheduler::changeStamp
uint64_t changeStamp()
Definition
scheduler.hh:388
sc_core
Definition
messages.cc:32
sc_core::next_trigger
void next_trigger()
Definition
sc_module.cc:538
sc_core::sc_is_running
bool sc_is_running()
Definition
sc_main.cc:141
sc_core::sc_time_unit
sc_time_unit
Definition
sc_time.hh:40
sc_core::wait
void wait()
Definition
sc_module.cc:653
sc_gem5
Definition
sc_clock.cc:42
sc_gem5::getChangeStamp
uint64_t getChangeStamp()
Definition
sc_prim.cc:37
sc_gem5::scheduler
Scheduler scheduler
Definition
scheduler.cc:494
sc_main.hh
sc_prim.hh
SC_REPORT_ERROR
#define SC_REPORT_ERROR(msg_type, msg)
Definition
sc_report_handler.hh:127
scheduler.hh
Generated on Tue Jun 18 2024 16:24:06 for gem5 by
doxygen
1.11.0