gem5
v20.1.0.0
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
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