89f74c7f2d7bdfc5193171c869b0f2a2e5910349
2 * Copyright 2018 Google, Inc.
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.
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.
33 #include "base/logging.hh"
34 #include "systemc/core/module.hh"
35 #include "systemc/ext/core/sc_module.hh"
36 #include "systemc/ext/core/sc_module_name.hh"
41 sc_bind_proxy::sc_bind_proxy(const sc_interface
&_interface
) :
42 _interface(&_interface
), _port(nullptr)
45 sc_bind_proxy::sc_bind_proxy(const sc_port_base
&_port
) :
46 _interface(nullptr), _port(&_port
)
49 const sc_bind_proxy
SC_BIND_PROXY_NUL(*(const sc_port_base
*)nullptr);
51 sc_module::~sc_module() {}
53 const sc_bind_proxy
SC_BIND_PROXY_NIL(*(const sc_port_base
*)nullptr);
56 sc_module::operator () (const sc_bind_proxy
&p001
,
57 const sc_bind_proxy
&p002
,
58 const sc_bind_proxy
&p003
,
59 const sc_bind_proxy
&p004
,
60 const sc_bind_proxy
&p005
,
61 const sc_bind_proxy
&p006
,
62 const sc_bind_proxy
&p007
,
63 const sc_bind_proxy
&p008
,
64 const sc_bind_proxy
&p009
,
65 const sc_bind_proxy
&p010
,
66 const sc_bind_proxy
&p011
,
67 const sc_bind_proxy
&p012
,
68 const sc_bind_proxy
&p013
,
69 const sc_bind_proxy
&p014
,
70 const sc_bind_proxy
&p015
,
71 const sc_bind_proxy
&p016
,
72 const sc_bind_proxy
&p017
,
73 const sc_bind_proxy
&p018
,
74 const sc_bind_proxy
&p019
,
75 const sc_bind_proxy
&p020
,
76 const sc_bind_proxy
&p021
,
77 const sc_bind_proxy
&p022
,
78 const sc_bind_proxy
&p023
,
79 const sc_bind_proxy
&p024
,
80 const sc_bind_proxy
&p025
,
81 const sc_bind_proxy
&p026
,
82 const sc_bind_proxy
&p027
,
83 const sc_bind_proxy
&p028
,
84 const sc_bind_proxy
&p029
,
85 const sc_bind_proxy
&p030
,
86 const sc_bind_proxy
&p031
,
87 const sc_bind_proxy
&p032
,
88 const sc_bind_proxy
&p033
,
89 const sc_bind_proxy
&p034
,
90 const sc_bind_proxy
&p035
,
91 const sc_bind_proxy
&p036
,
92 const sc_bind_proxy
&p037
,
93 const sc_bind_proxy
&p038
,
94 const sc_bind_proxy
&p039
,
95 const sc_bind_proxy
&p040
,
96 const sc_bind_proxy
&p041
,
97 const sc_bind_proxy
&p042
,
98 const sc_bind_proxy
&p043
,
99 const sc_bind_proxy
&p044
,
100 const sc_bind_proxy
&p045
,
101 const sc_bind_proxy
&p046
,
102 const sc_bind_proxy
&p047
,
103 const sc_bind_proxy
&p048
,
104 const sc_bind_proxy
&p049
,
105 const sc_bind_proxy
&p050
,
106 const sc_bind_proxy
&p051
,
107 const sc_bind_proxy
&p052
,
108 const sc_bind_proxy
&p053
,
109 const sc_bind_proxy
&p054
,
110 const sc_bind_proxy
&p055
,
111 const sc_bind_proxy
&p056
,
112 const sc_bind_proxy
&p057
,
113 const sc_bind_proxy
&p058
,
114 const sc_bind_proxy
&p059
,
115 const sc_bind_proxy
&p060
,
116 const sc_bind_proxy
&p061
,
117 const sc_bind_proxy
&p062
,
118 const sc_bind_proxy
&p063
,
119 const sc_bind_proxy
&p064
)
121 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
124 const std::vector
<sc_object
*> &
125 sc_module::get_child_objects() const
127 return _gem5_module
->obj()->get_child_objects();
130 const std::vector
<sc_event
*> &
131 sc_module::get_child_events() const
133 return _gem5_module
->obj()->get_child_events();
136 sc_module::sc_module() :
137 sc_object(sc_gem5::currentModule()->name()),
138 _gem5_module(sc_gem5::currentModule())
141 sc_module::sc_module(const sc_module_name
&) : sc_module() {}
142 sc_module::sc_module(const char *_name
) : sc_module(sc_module_name(_name
)) {}
143 sc_module::sc_module(const std::string
&_name
) :
144 sc_module(sc_module_name(_name
.c_str()))
148 sc_module::reset_signal_is(const sc_in
<bool> &, bool)
150 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
154 sc_module::reset_signal_is(const sc_inout
<bool> &, bool)
156 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
160 sc_module::reset_signal_is(const sc_out
<bool> &, bool)
162 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
166 sc_module::reset_signal_is(const sc_signal_in_if
<bool> &, bool)
168 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
173 sc_module::async_reset_signal_is(const sc_in
<bool> &, bool)
175 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
179 sc_module::async_reset_signal_is(const sc_inout
<bool> &, bool)
181 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
185 sc_module::async_reset_signal_is(const sc_out
<bool> &, bool)
187 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
191 sc_module::async_reset_signal_is(const sc_signal_in_if
<bool> &, bool)
193 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
198 sc_module::dont_initialize()
200 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
204 sc_module::set_stack_size(size_t)
206 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
210 void sc_module::next_trigger() { ::sc_core::next_trigger(); }
213 sc_module::next_trigger(const sc_event
&e
)
215 ::sc_core::next_trigger(e
);
219 sc_module::next_trigger(const sc_event_or_list
&eol
)
221 ::sc_core::next_trigger(eol
);
225 sc_module::next_trigger(const sc_event_and_list
&eal
)
227 ::sc_core::next_trigger(eal
);
231 sc_module::next_trigger(const sc_time
&t
)
233 ::sc_core::next_trigger(t
);
237 sc_module::next_trigger(double d
, sc_time_unit u
)
239 ::sc_core::next_trigger(d
, u
);
243 sc_module::next_trigger(const sc_time
&t
, const sc_event
&e
)
245 ::sc_core::next_trigger(t
, e
);
249 sc_module::next_trigger(double d
, sc_time_unit u
, const sc_event
&e
)
251 ::sc_core::next_trigger(d
, u
, e
);
255 sc_module::next_trigger(const sc_time
&t
, const sc_event_or_list
&eol
)
257 ::sc_core::next_trigger(t
, eol
);
261 sc_module::next_trigger(double d
, sc_time_unit u
, const sc_event_or_list
&eol
)
263 ::sc_core::next_trigger(d
, u
, eol
);
267 sc_module::next_trigger(const sc_time
&t
, const sc_event_and_list
&eal
)
269 ::sc_core::next_trigger(t
, eal
);
273 sc_module::next_trigger(double d
, sc_time_unit u
, const sc_event_and_list
&eal
)
275 ::sc_core::next_trigger(d
, u
, eal
);
280 sc_module::timed_out()
282 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
294 sc_module::wait(int i
)
300 sc_module::wait(const sc_event
&e
)
306 sc_module::wait(const sc_event_or_list
&eol
)
308 ::sc_core::wait(eol
);
312 sc_module::wait(const sc_event_and_list
&eal
)
314 ::sc_core::wait(eal
);
318 sc_module::wait(const sc_time
&t
)
324 sc_module::wait(double d
, sc_time_unit u
)
326 ::sc_core::wait(d
, u
);
330 sc_module::wait(const sc_time
&t
, const sc_event
&e
)
332 ::sc_core::wait(t
, e
);
336 sc_module::wait(double d
, sc_time_unit u
, const sc_event
&e
)
338 ::sc_core::wait(d
, u
, e
);
342 sc_module::wait(const sc_time
&t
, const sc_event_or_list
&eol
)
344 ::sc_core::wait(t
, eol
);
348 sc_module::wait(double d
, sc_time_unit u
, const sc_event_or_list
&eol
)
350 ::sc_core::wait(d
, u
, eol
);
354 sc_module::wait(const sc_time
&t
, const sc_event_and_list
&eal
)
356 ::sc_core::wait(t
, eal
);
360 sc_module::wait(double d
, sc_time_unit u
, const sc_event_and_list
&eal
)
362 ::sc_core::wait(d
, u
, eal
);
373 sc_module::at_posedge(const sc_signal_in_if
<bool> &s
)
375 ::sc_core::at_posedge(s
);
379 sc_module::at_posedge(const sc_signal_in_if
<sc_dt::sc_logic
> &s
)
381 ::sc_core::at_posedge(s
);
385 sc_module::at_negedge(const sc_signal_in_if
<bool> &s
)
387 ::sc_core::at_negedge(s
);
391 sc_module::at_negedge(const sc_signal_in_if
<sc_dt::sc_logic
> &s
)
393 ::sc_core::at_negedge(s
);
400 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
404 next_trigger(const sc_event
&)
406 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
410 next_trigger(const sc_event_or_list
&)
412 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
416 next_trigger(const sc_event_and_list
&)
418 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
422 next_trigger(const sc_time
&)
424 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
428 next_trigger(double d
, sc_time_unit u
)
430 next_trigger(sc_time(d
, u
));
434 next_trigger(const sc_time
&, const sc_event
&)
436 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
440 next_trigger(double d
, sc_time_unit u
, const sc_event
&e
)
442 next_trigger(sc_time(d
, u
), e
);
446 next_trigger(const sc_time
&, const sc_event_or_list
&)
448 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
452 next_trigger(double d
, sc_time_unit u
, const sc_event_or_list
&eol
)
454 next_trigger(sc_time(d
, u
), eol
);
458 next_trigger(const sc_time
&, const sc_event_and_list
&)
460 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
464 next_trigger(double d
, sc_time_unit u
, const sc_event_and_list
&eal
)
466 next_trigger(sc_time(d
, u
), eal
);
472 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
480 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
486 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
490 wait(const sc_event
&)
492 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
496 wait(const sc_event_or_list
&)
498 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
502 wait(const sc_event_and_list
&)
504 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
508 wait(const sc_time
&)
510 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
514 wait(double d
, sc_time_unit u
)
520 wait(const sc_time
&, const sc_event
&)
522 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
526 wait(double d
, sc_time_unit u
, const sc_event
&e
)
528 wait(sc_time(d
, u
), e
);
532 wait(const sc_time
&, const sc_event_or_list
&)
534 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
538 wait(double d
, sc_time_unit u
, const sc_event_or_list
&eol
)
540 wait(sc_time(d
, u
), eol
);
544 wait(const sc_time
&, const sc_event_and_list
&)
546 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
550 wait(double d
, sc_time_unit u
, const sc_event_and_list
&eal
)
552 wait(sc_time(d
, u
), eal
);
558 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
562 at_posedge(const sc_signal_in_if
<bool> &)
564 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
568 at_posedge(const sc_signal_in_if
<sc_dt::sc_logic
> &)
570 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
574 at_negedge(const sc_signal_in_if
<bool> &)
576 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
580 at_negedge(const sc_signal_in_if
<sc_dt::sc_logic
> &)
582 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
586 sc_gen_unique_name(const char *)
588 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
593 sc_hierarchical_name_exists(const char *name
)
595 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
600 sc_start_of_simulation_invoked()
602 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
607 sc_end_of_simulation_invoked()
609 warn("%s not implemented.\n", __PRETTY_FUNCTION__
);
614 sc_module_sc_new(sc_module
*mod
)
616 static std::vector
<std::unique_ptr
<sc_module
> > modules
;
617 modules
.emplace_back(mod
);
621 } // namespace sc_core