sc_prim.cc (13140:ecd8a58f3884) sc_prim.cc (13189:057566bc8fd6)
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 "base/logging.hh"
31#include "systemc/core/channel.hh"
32#include "systemc/core/scheduler.hh"
33#include "systemc/ext/core/sc_prim.hh"
34
35namespace sc_gem5
36{
37
38uint64_t getChangeStamp() { return scheduler.changeStamp(); }
39
40} // namespace sc_gem5
41
42namespace sc_core
43{
44
45sc_prim_channel::sc_prim_channel() :
46 _gem5_channel(new sc_gem5::Channel(this))
47{}
48
49sc_prim_channel::sc_prim_channel(const char *_name) :
50 sc_object(_name), _gem5_channel(new sc_gem5::Channel(this))
51{}
52
53sc_prim_channel::~sc_prim_channel() { delete _gem5_channel; }
54
55void
56sc_prim_channel::request_update()
57{
58 _gem5_channel->requestUpdate();
59}
60
61void
62sc_prim_channel::async_request_update()
63{
64 _gem5_channel->asyncRequestUpdate();
65}
66
67void
68sc_prim_channel::next_trigger()
69{
70 ::sc_core::next_trigger();
71}
72
73void
74sc_prim_channel::next_trigger(const sc_event &e)
75{
76 ::sc_core::next_trigger(e);
77}
78
79void
80sc_prim_channel::next_trigger(const sc_event_or_list &eol)
81{
82 ::sc_core::next_trigger(eol);
83}
84
85void
86sc_prim_channel::next_trigger(const sc_event_and_list &eal)
87{
88 ::sc_core::next_trigger(eal);
89}
90
91void
92sc_prim_channel::next_trigger(const sc_time &t)
93{
94 ::sc_core::next_trigger(t);
95}
96
97void
98sc_prim_channel::next_trigger(double d, sc_time_unit u)
99{
100 ::sc_core::next_trigger(d, u);
101}
102
103void
104sc_prim_channel::next_trigger(const sc_time &t, const sc_event &e)
105{
106 ::sc_core::next_trigger(t, e);
107}
108
109void
110sc_prim_channel::next_trigger(double d, sc_time_unit u, const sc_event &e)
111{
112 ::sc_core::next_trigger(d, u, e);
113}
114
115void
116sc_prim_channel::next_trigger(const sc_time &t, const sc_event_or_list &eol)
117{
118 ::sc_core::next_trigger(t, eol);
119}
120
121void
122sc_prim_channel::next_trigger(
123 double d, sc_time_unit u, const sc_event_or_list &eol)
124{
125 ::sc_core::next_trigger(d, u, eol);
126}
127
128void
129sc_prim_channel::next_trigger(const sc_time &t, const sc_event_and_list &eal)
130{
131 ::sc_core::next_trigger(t, eal);
132}
133
134void
135sc_prim_channel::next_trigger(
136 double d, sc_time_unit u, const sc_event_and_list &eal)
137{
138 ::sc_core::next_trigger(d, u, eal);
139}
140
141bool
142sc_prim_channel::timed_out()
143{
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 "base/logging.hh"
31#include "systemc/core/channel.hh"
32#include "systemc/core/scheduler.hh"
33#include "systemc/ext/core/sc_prim.hh"
34
35namespace sc_gem5
36{
37
38uint64_t getChangeStamp() { return scheduler.changeStamp(); }
39
40} // namespace sc_gem5
41
42namespace sc_core
43{
44
45sc_prim_channel::sc_prim_channel() :
46 _gem5_channel(new sc_gem5::Channel(this))
47{}
48
49sc_prim_channel::sc_prim_channel(const char *_name) :
50 sc_object(_name), _gem5_channel(new sc_gem5::Channel(this))
51{}
52
53sc_prim_channel::~sc_prim_channel() { delete _gem5_channel; }
54
55void
56sc_prim_channel::request_update()
57{
58 _gem5_channel->requestUpdate();
59}
60
61void
62sc_prim_channel::async_request_update()
63{
64 _gem5_channel->asyncRequestUpdate();
65}
66
67void
68sc_prim_channel::next_trigger()
69{
70 ::sc_core::next_trigger();
71}
72
73void
74sc_prim_channel::next_trigger(const sc_event &e)
75{
76 ::sc_core::next_trigger(e);
77}
78
79void
80sc_prim_channel::next_trigger(const sc_event_or_list &eol)
81{
82 ::sc_core::next_trigger(eol);
83}
84
85void
86sc_prim_channel::next_trigger(const sc_event_and_list &eal)
87{
88 ::sc_core::next_trigger(eal);
89}
90
91void
92sc_prim_channel::next_trigger(const sc_time &t)
93{
94 ::sc_core::next_trigger(t);
95}
96
97void
98sc_prim_channel::next_trigger(double d, sc_time_unit u)
99{
100 ::sc_core::next_trigger(d, u);
101}
102
103void
104sc_prim_channel::next_trigger(const sc_time &t, const sc_event &e)
105{
106 ::sc_core::next_trigger(t, e);
107}
108
109void
110sc_prim_channel::next_trigger(double d, sc_time_unit u, const sc_event &e)
111{
112 ::sc_core::next_trigger(d, u, e);
113}
114
115void
116sc_prim_channel::next_trigger(const sc_time &t, const sc_event_or_list &eol)
117{
118 ::sc_core::next_trigger(t, eol);
119}
120
121void
122sc_prim_channel::next_trigger(
123 double d, sc_time_unit u, const sc_event_or_list &eol)
124{
125 ::sc_core::next_trigger(d, u, eol);
126}
127
128void
129sc_prim_channel::next_trigger(const sc_time &t, const sc_event_and_list &eal)
130{
131 ::sc_core::next_trigger(t, eal);
132}
133
134void
135sc_prim_channel::next_trigger(
136 double d, sc_time_unit u, const sc_event_and_list &eal)
137{
138 ::sc_core::next_trigger(d, u, eal);
139}
140
141bool
142sc_prim_channel::timed_out()
143{
144 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
145 return false;
144 return ::sc_core::timed_out();
146}
147
148void
149sc_prim_channel::wait()
150{
151 ::sc_core::wait();
152}
153
154void
155sc_prim_channel::wait(int i)
156{
157 ::sc_core::wait(i);
158}
159
160void
161sc_prim_channel::wait(const sc_event &e)
162{
163 ::sc_core::wait(e);
164}
165
166void
167sc_prim_channel::wait(const sc_event_or_list &eol)
168{
169 ::sc_core::wait(eol);
170}
171
172void
173sc_prim_channel::wait(const sc_event_and_list &eal)
174{
175 ::sc_core::wait(eal);
176}
177
178void
179sc_prim_channel::wait(const sc_time &t)
180{
181 ::sc_core::wait(t);
182}
183
184void
185sc_prim_channel::wait(double d, sc_time_unit u)
186{
187 ::sc_core::wait(d, u);
188}
189
190void
191sc_prim_channel::wait(const sc_time &t, const sc_event &e)
192{
193 ::sc_core::wait(t, e);
194}
195
196void
197sc_prim_channel::wait(double d, sc_time_unit u, const sc_event &e)
198{
199 ::sc_core::wait(d, u, e);
200}
201
202void
203sc_prim_channel::wait(const sc_time &t, const sc_event_or_list &eol)
204{
205 ::sc_core::wait(t, eol);
206}
207
208void
209sc_prim_channel::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
210{
211 ::sc_core::wait(d, u, eol);
212}
213
214void
215sc_prim_channel::wait(const sc_time &t, const sc_event_and_list &eal)
216{
217 ::sc_core::wait(t, eal);
218}
219
220void
221sc_prim_channel::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
222{
223 ::sc_core::wait(d, u, eal);
224}
225
226} // namespace sc_core
145}
146
147void
148sc_prim_channel::wait()
149{
150 ::sc_core::wait();
151}
152
153void
154sc_prim_channel::wait(int i)
155{
156 ::sc_core::wait(i);
157}
158
159void
160sc_prim_channel::wait(const sc_event &e)
161{
162 ::sc_core::wait(e);
163}
164
165void
166sc_prim_channel::wait(const sc_event_or_list &eol)
167{
168 ::sc_core::wait(eol);
169}
170
171void
172sc_prim_channel::wait(const sc_event_and_list &eal)
173{
174 ::sc_core::wait(eal);
175}
176
177void
178sc_prim_channel::wait(const sc_time &t)
179{
180 ::sc_core::wait(t);
181}
182
183void
184sc_prim_channel::wait(double d, sc_time_unit u)
185{
186 ::sc_core::wait(d, u);
187}
188
189void
190sc_prim_channel::wait(const sc_time &t, const sc_event &e)
191{
192 ::sc_core::wait(t, e);
193}
194
195void
196sc_prim_channel::wait(double d, sc_time_unit u, const sc_event &e)
197{
198 ::sc_core::wait(d, u, e);
199}
200
201void
202sc_prim_channel::wait(const sc_time &t, const sc_event_or_list &eol)
203{
204 ::sc_core::wait(t, eol);
205}
206
207void
208sc_prim_channel::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
209{
210 ::sc_core::wait(d, u, eol);
211}
212
213void
214sc_prim_channel::wait(const sc_time &t, const sc_event_and_list &eal)
215{
216 ::sc_core::wait(t, eal);
217}
218
219void
220sc_prim_channel::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
221{
222 ::sc_core::wait(d, u, eal);
223}
224
225} // namespace sc_core