sc_module.cc (12993:977fa1dfe9b3) sc_module.cc (13035:bafbdba2352a)
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 <memory>
31#include <vector>
32
33#include "base/logging.hh"
34#include "systemc/core/kernel.hh"
35#include "systemc/core/module.hh"
36#include "systemc/core/process_types.hh"
37#include "systemc/ext/core/sc_module.hh"
38#include "systemc/ext/core/sc_module_name.hh"
39
40namespace sc_gem5
41{
42
43Process *
44newMethodProcess(const char *name, ProcessFuncWrapper *func)
45{
46 Process *p = new Method(name, func);
47 scheduler.reg(p);
48 return p;
49}
50
51Process *
52newThreadProcess(const char *name, ProcessFuncWrapper *func)
53{
54 Process *p = new Thread(name, func);
55 scheduler.reg(p);
56 return p;
57}
58
59Process *
60newCThreadProcess(const char *name, ProcessFuncWrapper *func)
61{
62 Process *p = new CThread(name, func);
63 scheduler.reg(p);
64 return p;
65}
66
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 <memory>
31#include <vector>
32
33#include "base/logging.hh"
34#include "systemc/core/kernel.hh"
35#include "systemc/core/module.hh"
36#include "systemc/core/process_types.hh"
37#include "systemc/ext/core/sc_module.hh"
38#include "systemc/ext/core/sc_module_name.hh"
39
40namespace sc_gem5
41{
42
43Process *
44newMethodProcess(const char *name, ProcessFuncWrapper *func)
45{
46 Process *p = new Method(name, func);
47 scheduler.reg(p);
48 return p;
49}
50
51Process *
52newThreadProcess(const char *name, ProcessFuncWrapper *func)
53{
54 Process *p = new Thread(name, func);
55 scheduler.reg(p);
56 return p;
57}
58
59Process *
60newCThreadProcess(const char *name, ProcessFuncWrapper *func)
61{
62 Process *p = new CThread(name, func);
63 scheduler.reg(p);
64 return p;
65}
66
67UniqueNameGen nameGen;
68
67} // namespace sc_gem5
68
69namespace sc_core
70{
71
72sc_bind_proxy::sc_bind_proxy(const sc_interface &_interface) :
73 _interface(&_interface), _port(nullptr)
74{}
75
76sc_bind_proxy::sc_bind_proxy(const sc_port_base &_port) :
77 _interface(nullptr), _port(&_port)
78{}
79
80const sc_bind_proxy SC_BIND_PROXY_NUL(*(const sc_port_base *)nullptr);
81
82sc_module::~sc_module() { delete _gem5_module; }
83
84const sc_bind_proxy SC_BIND_PROXY_NIL(*(const sc_port_base *)nullptr);
85
86void
87sc_module::operator () (const sc_bind_proxy &p001,
88 const sc_bind_proxy &p002,
89 const sc_bind_proxy &p003,
90 const sc_bind_proxy &p004,
91 const sc_bind_proxy &p005,
92 const sc_bind_proxy &p006,
93 const sc_bind_proxy &p007,
94 const sc_bind_proxy &p008,
95 const sc_bind_proxy &p009,
96 const sc_bind_proxy &p010,
97 const sc_bind_proxy &p011,
98 const sc_bind_proxy &p012,
99 const sc_bind_proxy &p013,
100 const sc_bind_proxy &p014,
101 const sc_bind_proxy &p015,
102 const sc_bind_proxy &p016,
103 const sc_bind_proxy &p017,
104 const sc_bind_proxy &p018,
105 const sc_bind_proxy &p019,
106 const sc_bind_proxy &p020,
107 const sc_bind_proxy &p021,
108 const sc_bind_proxy &p022,
109 const sc_bind_proxy &p023,
110 const sc_bind_proxy &p024,
111 const sc_bind_proxy &p025,
112 const sc_bind_proxy &p026,
113 const sc_bind_proxy &p027,
114 const sc_bind_proxy &p028,
115 const sc_bind_proxy &p029,
116 const sc_bind_proxy &p030,
117 const sc_bind_proxy &p031,
118 const sc_bind_proxy &p032,
119 const sc_bind_proxy &p033,
120 const sc_bind_proxy &p034,
121 const sc_bind_proxy &p035,
122 const sc_bind_proxy &p036,
123 const sc_bind_proxy &p037,
124 const sc_bind_proxy &p038,
125 const sc_bind_proxy &p039,
126 const sc_bind_proxy &p040,
127 const sc_bind_proxy &p041,
128 const sc_bind_proxy &p042,
129 const sc_bind_proxy &p043,
130 const sc_bind_proxy &p044,
131 const sc_bind_proxy &p045,
132 const sc_bind_proxy &p046,
133 const sc_bind_proxy &p047,
134 const sc_bind_proxy &p048,
135 const sc_bind_proxy &p049,
136 const sc_bind_proxy &p050,
137 const sc_bind_proxy &p051,
138 const sc_bind_proxy &p052,
139 const sc_bind_proxy &p053,
140 const sc_bind_proxy &p054,
141 const sc_bind_proxy &p055,
142 const sc_bind_proxy &p056,
143 const sc_bind_proxy &p057,
144 const sc_bind_proxy &p058,
145 const sc_bind_proxy &p059,
146 const sc_bind_proxy &p060,
147 const sc_bind_proxy &p061,
148 const sc_bind_proxy &p062,
149 const sc_bind_proxy &p063,
150 const sc_bind_proxy &p064)
151{
152 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
153}
154
155const std::vector<sc_object *> &
156sc_module::get_child_objects() const
157{
158 return _gem5_module->obj()->get_child_objects();
159}
160
161const std::vector<sc_event *> &
162sc_module::get_child_events() const
163{
164 return _gem5_module->obj()->get_child_events();
165}
166
167sc_module::sc_module() :
168 sc_object(sc_gem5::newModule()->name()),
169 _gem5_module(sc_gem5::currentModule())
170{}
171
172sc_module::sc_module(const sc_module_name &) : sc_module() {}
173sc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name)) {}
174sc_module::sc_module(const std::string &_name) :
175 sc_module(sc_module_name(_name.c_str()))
176{}
177
178void
179sc_module::reset_signal_is(const sc_in<bool> &, bool)
180{
181 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
182}
183
184void
185sc_module::reset_signal_is(const sc_inout<bool> &, bool)
186{
187 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
188}
189
190void
191sc_module::reset_signal_is(const sc_out<bool> &, bool)
192{
193 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
194}
195
196void
197sc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool)
198{
199 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
200}
201
202
203void
204sc_module::async_reset_signal_is(const sc_in<bool> &, bool)
205{
206 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
207}
208
209void
210sc_module::async_reset_signal_is(const sc_inout<bool> &, bool)
211{
212 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
213}
214
215void
216sc_module::async_reset_signal_is(const sc_out<bool> &, bool)
217{
218 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
219}
220
221void
222sc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool)
223{
224 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
225}
226
227
228void
229sc_module::dont_initialize()
230{
231 ::sc_gem5::Process::newest()->dontInitialize();
232}
233
234void
235sc_module::set_stack_size(size_t size)
236{
237 ::sc_gem5::Process::newest()->setStackSize(size);
238}
239
240
241void sc_module::next_trigger() { ::sc_core::next_trigger(); }
242
243void
244sc_module::next_trigger(const sc_event &e)
245{
246 ::sc_core::next_trigger(e);
247}
248
249void
250sc_module::next_trigger(const sc_event_or_list &eol)
251{
252 ::sc_core::next_trigger(eol);
253}
254
255void
256sc_module::next_trigger(const sc_event_and_list &eal)
257{
258 ::sc_core::next_trigger(eal);
259}
260
261void
262sc_module::next_trigger(const sc_time &t)
263{
264 ::sc_core::next_trigger(t);
265}
266
267void
268sc_module::next_trigger(double d, sc_time_unit u)
269{
270 ::sc_core::next_trigger(d, u);
271}
272
273void
274sc_module::next_trigger(const sc_time &t, const sc_event &e)
275{
276 ::sc_core::next_trigger(t, e);
277}
278
279void
280sc_module::next_trigger(double d, sc_time_unit u, const sc_event &e)
281{
282 ::sc_core::next_trigger(d, u, e);
283}
284
285void
286sc_module::next_trigger(const sc_time &t, const sc_event_or_list &eol)
287{
288 ::sc_core::next_trigger(t, eol);
289}
290
291void
292sc_module::next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
293{
294 ::sc_core::next_trigger(d, u, eol);
295}
296
297void
298sc_module::next_trigger(const sc_time &t, const sc_event_and_list &eal)
299{
300 ::sc_core::next_trigger(t, eal);
301}
302
303void
304sc_module::next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
305{
306 ::sc_core::next_trigger(d, u, eal);
307}
308
309
310bool
311sc_module::timed_out()
312{
313 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
314 return false;
315}
316
317
318void
319sc_module::wait()
320{
321 ::sc_core::wait();
322}
323
324void
325sc_module::wait(int i)
326{
327 ::sc_core::wait(i);
328}
329
330void
331sc_module::wait(const sc_event &e)
332{
333 ::sc_core::wait(e);
334}
335
336void
337sc_module::wait(const sc_event_or_list &eol)
338{
339 ::sc_core::wait(eol);
340}
341
342void
343sc_module::wait(const sc_event_and_list &eal)
344{
345 ::sc_core::wait(eal);
346}
347
348void
349sc_module::wait(const sc_time &t)
350{
351 ::sc_core::wait(t);
352}
353
354void
355sc_module::wait(double d, sc_time_unit u)
356{
357 ::sc_core::wait(d, u);
358}
359
360void
361sc_module::wait(const sc_time &t, const sc_event &e)
362{
363 ::sc_core::wait(t, e);
364}
365
366void
367sc_module::wait(double d, sc_time_unit u, const sc_event &e)
368{
369 ::sc_core::wait(d, u, e);
370}
371
372void
373sc_module::wait(const sc_time &t, const sc_event_or_list &eol)
374{
375 ::sc_core::wait(t, eol);
376}
377
378void
379sc_module::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
380{
381 ::sc_core::wait(d, u, eol);
382}
383
384void
385sc_module::wait(const sc_time &t, const sc_event_and_list &eal)
386{
387 ::sc_core::wait(t, eal);
388}
389
390void
391sc_module::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
392{
393 ::sc_core::wait(d, u, eal);
394}
395
396
397void
398sc_module::halt()
399{
400 ::sc_core::halt();
401}
402
403void
404sc_module::at_posedge(const sc_signal_in_if<bool> &s)
405{
406 ::sc_core::at_posedge(s);
407}
408
409void
410sc_module::at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
411{
412 ::sc_core::at_posedge(s);
413}
414
415void
416sc_module::at_negedge(const sc_signal_in_if<bool> &s)
417{
418 ::sc_core::at_negedge(s);
419}
420
421void
422sc_module::at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
423{
424 ::sc_core::at_negedge(s);
425}
426
427
428void
429next_trigger()
430{
431 sc_gem5::Process *p = sc_gem5::scheduler.current();
432 p->setDynamic(nullptr);
433}
434
435void
436next_trigger(const sc_event &e)
437{
438 sc_gem5::Process *p = sc_gem5::scheduler.current();
439 p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
440}
441
442void
443next_trigger(const sc_event_or_list &eol)
444{
445 sc_gem5::Process *p = sc_gem5::scheduler.current();
446 p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
447}
448
449void
450next_trigger(const sc_event_and_list &eal)
451{
452 sc_gem5::Process *p = sc_gem5::scheduler.current();
453 p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
454}
455
456void
457next_trigger(const sc_time &t)
458{
459 sc_gem5::Process *p = sc_gem5::scheduler.current();
460 p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
461}
462
463void
464next_trigger(double d, sc_time_unit u)
465{
466 next_trigger(sc_time(d, u));
467}
468
469void
470next_trigger(const sc_time &t, const sc_event &e)
471{
472 sc_gem5::Process *p = sc_gem5::scheduler.current();
473 p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
474}
475
476void
477next_trigger(double d, sc_time_unit u, const sc_event &e)
478{
479 next_trigger(sc_time(d, u), e);
480}
481
482void
483next_trigger(const sc_time &t, const sc_event_or_list &eol)
484{
485 sc_gem5::Process *p = sc_gem5::scheduler.current();
486 p->setDynamic(
487 new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
488}
489
490void
491next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
492{
493 next_trigger(sc_time(d, u), eol);
494}
495
496void
497next_trigger(const sc_time &t, const sc_event_and_list &eal)
498{
499 sc_gem5::Process *p = sc_gem5::scheduler.current();
500 p->setDynamic(
501 new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
502}
503
504void
505next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
506{
507 next_trigger(sc_time(d, u), eal);
508}
509
510bool
511timed_out()
512{
513 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
514 return false;
515}
516
517
518void
519wait()
520{
521 sc_gem5::Process *p = sc_gem5::scheduler.current();
522 p->setDynamic(nullptr);
523 sc_gem5::scheduler.yield();
524}
525
526void
527wait(int n)
528{
529 for (int i = 0; i < n; i++)
530 wait();
531}
532
533void
534wait(const sc_event &e)
535{
536 sc_gem5::Process *p = sc_gem5::scheduler.current();
537 p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
538 sc_gem5::scheduler.yield();
539}
540
541void
542wait(const sc_event_or_list &eol)
543{
544 sc_gem5::Process *p = sc_gem5::scheduler.current();
545 p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
546 sc_gem5::scheduler.yield();
547}
548
549void
550wait(const sc_event_and_list &eal)
551{
552 sc_gem5::Process *p = sc_gem5::scheduler.current();
553 p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
554 sc_gem5::scheduler.yield();
555}
556
557void
558wait(const sc_time &t)
559{
560 sc_gem5::Process *p = sc_gem5::scheduler.current();
561 p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
562 sc_gem5::scheduler.yield();
563}
564
565void
566wait(double d, sc_time_unit u)
567{
568 wait(sc_time(d, u));
569}
570
571void
572wait(const sc_time &t, const sc_event &e)
573{
574 sc_gem5::Process *p = sc_gem5::scheduler.current();
575 p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
576 sc_gem5::scheduler.yield();
577}
578
579void
580wait(double d, sc_time_unit u, const sc_event &e)
581{
582 wait(sc_time(d, u), e);
583}
584
585void
586wait(const sc_time &t, const sc_event_or_list &eol)
587{
588 sc_gem5::Process *p = sc_gem5::scheduler.current();
589 p->setDynamic(
590 new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
591 sc_gem5::scheduler.yield();
592}
593
594void
595wait(double d, sc_time_unit u, const sc_event_or_list &eol)
596{
597 wait(sc_time(d, u), eol);
598}
599
600void
601wait(const sc_time &t, const sc_event_and_list &eal)
602{
603 sc_gem5::Process *p = sc_gem5::scheduler.current();
604 p->setDynamic(
605 new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
606 sc_gem5::scheduler.yield();
607}
608
609void
610wait(double d, sc_time_unit u, const sc_event_and_list &eal)
611{
612 wait(sc_time(d, u), eal);
613}
614
615void
616halt()
617{
618 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
619}
620
621void
622at_posedge(const sc_signal_in_if<bool> &)
623{
624 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
625}
626
627void
628at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &)
629{
630 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
631}
632
633void
634at_negedge(const sc_signal_in_if<bool> &)
635{
636 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
637}
638
639void
640at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &)
641{
642 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
643}
644
645const char *
69} // namespace sc_gem5
70
71namespace sc_core
72{
73
74sc_bind_proxy::sc_bind_proxy(const sc_interface &_interface) :
75 _interface(&_interface), _port(nullptr)
76{}
77
78sc_bind_proxy::sc_bind_proxy(const sc_port_base &_port) :
79 _interface(nullptr), _port(&_port)
80{}
81
82const sc_bind_proxy SC_BIND_PROXY_NUL(*(const sc_port_base *)nullptr);
83
84sc_module::~sc_module() { delete _gem5_module; }
85
86const sc_bind_proxy SC_BIND_PROXY_NIL(*(const sc_port_base *)nullptr);
87
88void
89sc_module::operator () (const sc_bind_proxy &p001,
90 const sc_bind_proxy &p002,
91 const sc_bind_proxy &p003,
92 const sc_bind_proxy &p004,
93 const sc_bind_proxy &p005,
94 const sc_bind_proxy &p006,
95 const sc_bind_proxy &p007,
96 const sc_bind_proxy &p008,
97 const sc_bind_proxy &p009,
98 const sc_bind_proxy &p010,
99 const sc_bind_proxy &p011,
100 const sc_bind_proxy &p012,
101 const sc_bind_proxy &p013,
102 const sc_bind_proxy &p014,
103 const sc_bind_proxy &p015,
104 const sc_bind_proxy &p016,
105 const sc_bind_proxy &p017,
106 const sc_bind_proxy &p018,
107 const sc_bind_proxy &p019,
108 const sc_bind_proxy &p020,
109 const sc_bind_proxy &p021,
110 const sc_bind_proxy &p022,
111 const sc_bind_proxy &p023,
112 const sc_bind_proxy &p024,
113 const sc_bind_proxy &p025,
114 const sc_bind_proxy &p026,
115 const sc_bind_proxy &p027,
116 const sc_bind_proxy &p028,
117 const sc_bind_proxy &p029,
118 const sc_bind_proxy &p030,
119 const sc_bind_proxy &p031,
120 const sc_bind_proxy &p032,
121 const sc_bind_proxy &p033,
122 const sc_bind_proxy &p034,
123 const sc_bind_proxy &p035,
124 const sc_bind_proxy &p036,
125 const sc_bind_proxy &p037,
126 const sc_bind_proxy &p038,
127 const sc_bind_proxy &p039,
128 const sc_bind_proxy &p040,
129 const sc_bind_proxy &p041,
130 const sc_bind_proxy &p042,
131 const sc_bind_proxy &p043,
132 const sc_bind_proxy &p044,
133 const sc_bind_proxy &p045,
134 const sc_bind_proxy &p046,
135 const sc_bind_proxy &p047,
136 const sc_bind_proxy &p048,
137 const sc_bind_proxy &p049,
138 const sc_bind_proxy &p050,
139 const sc_bind_proxy &p051,
140 const sc_bind_proxy &p052,
141 const sc_bind_proxy &p053,
142 const sc_bind_proxy &p054,
143 const sc_bind_proxy &p055,
144 const sc_bind_proxy &p056,
145 const sc_bind_proxy &p057,
146 const sc_bind_proxy &p058,
147 const sc_bind_proxy &p059,
148 const sc_bind_proxy &p060,
149 const sc_bind_proxy &p061,
150 const sc_bind_proxy &p062,
151 const sc_bind_proxy &p063,
152 const sc_bind_proxy &p064)
153{
154 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
155}
156
157const std::vector<sc_object *> &
158sc_module::get_child_objects() const
159{
160 return _gem5_module->obj()->get_child_objects();
161}
162
163const std::vector<sc_event *> &
164sc_module::get_child_events() const
165{
166 return _gem5_module->obj()->get_child_events();
167}
168
169sc_module::sc_module() :
170 sc_object(sc_gem5::newModule()->name()),
171 _gem5_module(sc_gem5::currentModule())
172{}
173
174sc_module::sc_module(const sc_module_name &) : sc_module() {}
175sc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name)) {}
176sc_module::sc_module(const std::string &_name) :
177 sc_module(sc_module_name(_name.c_str()))
178{}
179
180void
181sc_module::reset_signal_is(const sc_in<bool> &, bool)
182{
183 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
184}
185
186void
187sc_module::reset_signal_is(const sc_inout<bool> &, bool)
188{
189 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
190}
191
192void
193sc_module::reset_signal_is(const sc_out<bool> &, bool)
194{
195 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
196}
197
198void
199sc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool)
200{
201 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
202}
203
204
205void
206sc_module::async_reset_signal_is(const sc_in<bool> &, bool)
207{
208 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
209}
210
211void
212sc_module::async_reset_signal_is(const sc_inout<bool> &, bool)
213{
214 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
215}
216
217void
218sc_module::async_reset_signal_is(const sc_out<bool> &, bool)
219{
220 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
221}
222
223void
224sc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool)
225{
226 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
227}
228
229
230void
231sc_module::dont_initialize()
232{
233 ::sc_gem5::Process::newest()->dontInitialize();
234}
235
236void
237sc_module::set_stack_size(size_t size)
238{
239 ::sc_gem5::Process::newest()->setStackSize(size);
240}
241
242
243void sc_module::next_trigger() { ::sc_core::next_trigger(); }
244
245void
246sc_module::next_trigger(const sc_event &e)
247{
248 ::sc_core::next_trigger(e);
249}
250
251void
252sc_module::next_trigger(const sc_event_or_list &eol)
253{
254 ::sc_core::next_trigger(eol);
255}
256
257void
258sc_module::next_trigger(const sc_event_and_list &eal)
259{
260 ::sc_core::next_trigger(eal);
261}
262
263void
264sc_module::next_trigger(const sc_time &t)
265{
266 ::sc_core::next_trigger(t);
267}
268
269void
270sc_module::next_trigger(double d, sc_time_unit u)
271{
272 ::sc_core::next_trigger(d, u);
273}
274
275void
276sc_module::next_trigger(const sc_time &t, const sc_event &e)
277{
278 ::sc_core::next_trigger(t, e);
279}
280
281void
282sc_module::next_trigger(double d, sc_time_unit u, const sc_event &e)
283{
284 ::sc_core::next_trigger(d, u, e);
285}
286
287void
288sc_module::next_trigger(const sc_time &t, const sc_event_or_list &eol)
289{
290 ::sc_core::next_trigger(t, eol);
291}
292
293void
294sc_module::next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
295{
296 ::sc_core::next_trigger(d, u, eol);
297}
298
299void
300sc_module::next_trigger(const sc_time &t, const sc_event_and_list &eal)
301{
302 ::sc_core::next_trigger(t, eal);
303}
304
305void
306sc_module::next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
307{
308 ::sc_core::next_trigger(d, u, eal);
309}
310
311
312bool
313sc_module::timed_out()
314{
315 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
316 return false;
317}
318
319
320void
321sc_module::wait()
322{
323 ::sc_core::wait();
324}
325
326void
327sc_module::wait(int i)
328{
329 ::sc_core::wait(i);
330}
331
332void
333sc_module::wait(const sc_event &e)
334{
335 ::sc_core::wait(e);
336}
337
338void
339sc_module::wait(const sc_event_or_list &eol)
340{
341 ::sc_core::wait(eol);
342}
343
344void
345sc_module::wait(const sc_event_and_list &eal)
346{
347 ::sc_core::wait(eal);
348}
349
350void
351sc_module::wait(const sc_time &t)
352{
353 ::sc_core::wait(t);
354}
355
356void
357sc_module::wait(double d, sc_time_unit u)
358{
359 ::sc_core::wait(d, u);
360}
361
362void
363sc_module::wait(const sc_time &t, const sc_event &e)
364{
365 ::sc_core::wait(t, e);
366}
367
368void
369sc_module::wait(double d, sc_time_unit u, const sc_event &e)
370{
371 ::sc_core::wait(d, u, e);
372}
373
374void
375sc_module::wait(const sc_time &t, const sc_event_or_list &eol)
376{
377 ::sc_core::wait(t, eol);
378}
379
380void
381sc_module::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
382{
383 ::sc_core::wait(d, u, eol);
384}
385
386void
387sc_module::wait(const sc_time &t, const sc_event_and_list &eal)
388{
389 ::sc_core::wait(t, eal);
390}
391
392void
393sc_module::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
394{
395 ::sc_core::wait(d, u, eal);
396}
397
398
399void
400sc_module::halt()
401{
402 ::sc_core::halt();
403}
404
405void
406sc_module::at_posedge(const sc_signal_in_if<bool> &s)
407{
408 ::sc_core::at_posedge(s);
409}
410
411void
412sc_module::at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
413{
414 ::sc_core::at_posedge(s);
415}
416
417void
418sc_module::at_negedge(const sc_signal_in_if<bool> &s)
419{
420 ::sc_core::at_negedge(s);
421}
422
423void
424sc_module::at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
425{
426 ::sc_core::at_negedge(s);
427}
428
429
430void
431next_trigger()
432{
433 sc_gem5::Process *p = sc_gem5::scheduler.current();
434 p->setDynamic(nullptr);
435}
436
437void
438next_trigger(const sc_event &e)
439{
440 sc_gem5::Process *p = sc_gem5::scheduler.current();
441 p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
442}
443
444void
445next_trigger(const sc_event_or_list &eol)
446{
447 sc_gem5::Process *p = sc_gem5::scheduler.current();
448 p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
449}
450
451void
452next_trigger(const sc_event_and_list &eal)
453{
454 sc_gem5::Process *p = sc_gem5::scheduler.current();
455 p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
456}
457
458void
459next_trigger(const sc_time &t)
460{
461 sc_gem5::Process *p = sc_gem5::scheduler.current();
462 p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
463}
464
465void
466next_trigger(double d, sc_time_unit u)
467{
468 next_trigger(sc_time(d, u));
469}
470
471void
472next_trigger(const sc_time &t, const sc_event &e)
473{
474 sc_gem5::Process *p = sc_gem5::scheduler.current();
475 p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
476}
477
478void
479next_trigger(double d, sc_time_unit u, const sc_event &e)
480{
481 next_trigger(sc_time(d, u), e);
482}
483
484void
485next_trigger(const sc_time &t, const sc_event_or_list &eol)
486{
487 sc_gem5::Process *p = sc_gem5::scheduler.current();
488 p->setDynamic(
489 new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
490}
491
492void
493next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
494{
495 next_trigger(sc_time(d, u), eol);
496}
497
498void
499next_trigger(const sc_time &t, const sc_event_and_list &eal)
500{
501 sc_gem5::Process *p = sc_gem5::scheduler.current();
502 p->setDynamic(
503 new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
504}
505
506void
507next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
508{
509 next_trigger(sc_time(d, u), eal);
510}
511
512bool
513timed_out()
514{
515 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
516 return false;
517}
518
519
520void
521wait()
522{
523 sc_gem5::Process *p = sc_gem5::scheduler.current();
524 p->setDynamic(nullptr);
525 sc_gem5::scheduler.yield();
526}
527
528void
529wait(int n)
530{
531 for (int i = 0; i < n; i++)
532 wait();
533}
534
535void
536wait(const sc_event &e)
537{
538 sc_gem5::Process *p = sc_gem5::scheduler.current();
539 p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
540 sc_gem5::scheduler.yield();
541}
542
543void
544wait(const sc_event_or_list &eol)
545{
546 sc_gem5::Process *p = sc_gem5::scheduler.current();
547 p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
548 sc_gem5::scheduler.yield();
549}
550
551void
552wait(const sc_event_and_list &eal)
553{
554 sc_gem5::Process *p = sc_gem5::scheduler.current();
555 p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
556 sc_gem5::scheduler.yield();
557}
558
559void
560wait(const sc_time &t)
561{
562 sc_gem5::Process *p = sc_gem5::scheduler.current();
563 p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
564 sc_gem5::scheduler.yield();
565}
566
567void
568wait(double d, sc_time_unit u)
569{
570 wait(sc_time(d, u));
571}
572
573void
574wait(const sc_time &t, const sc_event &e)
575{
576 sc_gem5::Process *p = sc_gem5::scheduler.current();
577 p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
578 sc_gem5::scheduler.yield();
579}
580
581void
582wait(double d, sc_time_unit u, const sc_event &e)
583{
584 wait(sc_time(d, u), e);
585}
586
587void
588wait(const sc_time &t, const sc_event_or_list &eol)
589{
590 sc_gem5::Process *p = sc_gem5::scheduler.current();
591 p->setDynamic(
592 new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
593 sc_gem5::scheduler.yield();
594}
595
596void
597wait(double d, sc_time_unit u, const sc_event_or_list &eol)
598{
599 wait(sc_time(d, u), eol);
600}
601
602void
603wait(const sc_time &t, const sc_event_and_list &eal)
604{
605 sc_gem5::Process *p = sc_gem5::scheduler.current();
606 p->setDynamic(
607 new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
608 sc_gem5::scheduler.yield();
609}
610
611void
612wait(double d, sc_time_unit u, const sc_event_and_list &eal)
613{
614 wait(sc_time(d, u), eal);
615}
616
617void
618halt()
619{
620 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
621}
622
623void
624at_posedge(const sc_signal_in_if<bool> &)
625{
626 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
627}
628
629void
630at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &)
631{
632 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
633}
634
635void
636at_negedge(const sc_signal_in_if<bool> &)
637{
638 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
639}
640
641void
642at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &)
643{
644 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
645}
646
647const char *
646sc_gen_unique_name(const char *)
648sc_gen_unique_name(const char *seed)
647{
649{
648 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
649 return "";
650 ::sc_gem5::Module *mod = ::sc_gem5::currentModule();
651 return mod ? mod->uniqueName(seed) :
652 ::sc_gem5::nameGen.gen(seed);
650}
651
652bool
653sc_hierarchical_name_exists(const char *name)
654{
655 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
656 return false;
657}
658
659bool
660sc_start_of_simulation_invoked()
661{
662 return ::sc_gem5::kernel->startOfSimulationComplete();
663}
664
665bool
666sc_end_of_simulation_invoked()
667{
668 return ::sc_gem5::kernel->endOfSimulationComplete();
669}
670
671sc_module *
672sc_module_sc_new(sc_module *mod)
673{
674 static std::vector<std::unique_ptr<sc_module> > modules;
675 modules.emplace_back(mod);
676 return mod;
677}
678
679} // namespace sc_core
653}
654
655bool
656sc_hierarchical_name_exists(const char *name)
657{
658 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
659 return false;
660}
661
662bool
663sc_start_of_simulation_invoked()
664{
665 return ::sc_gem5::kernel->startOfSimulationComplete();
666}
667
668bool
669sc_end_of_simulation_invoked()
670{
671 return ::sc_gem5::kernel->endOfSimulationComplete();
672}
673
674sc_module *
675sc_module_sc_new(sc_module *mod)
676{
677 static std::vector<std::unique_ptr<sc_module> > modules;
678 modules.emplace_back(mod);
679 return mod;
680}
681
682} // namespace sc_core