sc_module.cc revision 12958
112837Sgabeblack@google.com/*
212837Sgabeblack@google.com * Copyright 2018 Google, Inc.
312837Sgabeblack@google.com *
412837Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
512837Sgabeblack@google.com * modification, are permitted provided that the following conditions are
612837Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
712837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
812837Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
912837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1012837Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1112837Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1212837Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1312837Sgabeblack@google.com * this software without specific prior written permission.
1412837Sgabeblack@google.com *
1512837Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612837Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712837Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812837Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912837Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012837Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112837Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212837Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312837Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412837Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512837Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612837Sgabeblack@google.com *
2712837Sgabeblack@google.com * Authors: Gabe Black
2812837Sgabeblack@google.com */
2912837Sgabeblack@google.com
3012901Sgabeblack@google.com#include <memory>
3112901Sgabeblack@google.com#include <vector>
3212901Sgabeblack@google.com
3312837Sgabeblack@google.com#include "base/logging.hh"
3412951Sgabeblack@google.com#include "systemc/core/module.hh"
3512953Sgabeblack@google.com#include "systemc/core/process_types.hh"
3612837Sgabeblack@google.com#include "systemc/ext/core/sc_module.hh"
3712951Sgabeblack@google.com#include "systemc/ext/core/sc_module_name.hh"
3812837Sgabeblack@google.com
3912952Sgabeblack@google.comnamespace sc_gem5
4012952Sgabeblack@google.com{
4112952Sgabeblack@google.com
4212952Sgabeblack@google.comProcess *
4312952Sgabeblack@google.comnewMethodProcess(const char *name, ProcessFuncWrapper *func)
4412952Sgabeblack@google.com{
4512952Sgabeblack@google.com    return new Method(name, func);
4612952Sgabeblack@google.com}
4712952Sgabeblack@google.com
4812952Sgabeblack@google.comProcess *
4912952Sgabeblack@google.comnewThreadProcess(const char *name, ProcessFuncWrapper *func)
5012952Sgabeblack@google.com{
5112952Sgabeblack@google.com    return new Thread(name, func);
5212952Sgabeblack@google.com}
5312952Sgabeblack@google.com
5412952Sgabeblack@google.comProcess *
5512952Sgabeblack@google.comnewCThreadProcess(const char *name, ProcessFuncWrapper *func)
5612952Sgabeblack@google.com{
5712952Sgabeblack@google.com    return new CThread(name, func);
5812952Sgabeblack@google.com}
5912952Sgabeblack@google.com
6012952Sgabeblack@google.com} // namespace sc_gem5
6112952Sgabeblack@google.com
6212837Sgabeblack@google.comnamespace sc_core
6312837Sgabeblack@google.com{
6412837Sgabeblack@google.com
6512951Sgabeblack@google.comsc_bind_proxy::sc_bind_proxy(const sc_interface &_interface) :
6612951Sgabeblack@google.com    _interface(&_interface), _port(nullptr)
6712951Sgabeblack@google.com{}
6812837Sgabeblack@google.com
6912951Sgabeblack@google.comsc_bind_proxy::sc_bind_proxy(const sc_port_base &_port) :
7012951Sgabeblack@google.com    _interface(nullptr), _port(&_port)
7112951Sgabeblack@google.com{}
7212837Sgabeblack@google.com
7312837Sgabeblack@google.comconst sc_bind_proxy SC_BIND_PROXY_NUL(*(const sc_port_base *)nullptr);
7412837Sgabeblack@google.com
7512951Sgabeblack@google.comsc_module::~sc_module() {}
7612837Sgabeblack@google.com
7712837Sgabeblack@google.comconst sc_bind_proxy SC_BIND_PROXY_NIL(*(const sc_port_base *)nullptr);
7812837Sgabeblack@google.com
7912837Sgabeblack@google.comvoid
8012837Sgabeblack@google.comsc_module::operator () (const sc_bind_proxy &p001,
8112837Sgabeblack@google.com                        const sc_bind_proxy &p002,
8212837Sgabeblack@google.com                        const sc_bind_proxy &p003,
8312837Sgabeblack@google.com                        const sc_bind_proxy &p004,
8412837Sgabeblack@google.com                        const sc_bind_proxy &p005,
8512837Sgabeblack@google.com                        const sc_bind_proxy &p006,
8612837Sgabeblack@google.com                        const sc_bind_proxy &p007,
8712837Sgabeblack@google.com                        const sc_bind_proxy &p008,
8812837Sgabeblack@google.com                        const sc_bind_proxy &p009,
8912837Sgabeblack@google.com                        const sc_bind_proxy &p010,
9012837Sgabeblack@google.com                        const sc_bind_proxy &p011,
9112837Sgabeblack@google.com                        const sc_bind_proxy &p012,
9212837Sgabeblack@google.com                        const sc_bind_proxy &p013,
9312837Sgabeblack@google.com                        const sc_bind_proxy &p014,
9412837Sgabeblack@google.com                        const sc_bind_proxy &p015,
9512837Sgabeblack@google.com                        const sc_bind_proxy &p016,
9612837Sgabeblack@google.com                        const sc_bind_proxy &p017,
9712837Sgabeblack@google.com                        const sc_bind_proxy &p018,
9812837Sgabeblack@google.com                        const sc_bind_proxy &p019,
9912837Sgabeblack@google.com                        const sc_bind_proxy &p020,
10012837Sgabeblack@google.com                        const sc_bind_proxy &p021,
10112837Sgabeblack@google.com                        const sc_bind_proxy &p022,
10212837Sgabeblack@google.com                        const sc_bind_proxy &p023,
10312837Sgabeblack@google.com                        const sc_bind_proxy &p024,
10412837Sgabeblack@google.com                        const sc_bind_proxy &p025,
10512837Sgabeblack@google.com                        const sc_bind_proxy &p026,
10612837Sgabeblack@google.com                        const sc_bind_proxy &p027,
10712837Sgabeblack@google.com                        const sc_bind_proxy &p028,
10812837Sgabeblack@google.com                        const sc_bind_proxy &p029,
10912837Sgabeblack@google.com                        const sc_bind_proxy &p030,
11012837Sgabeblack@google.com                        const sc_bind_proxy &p031,
11112837Sgabeblack@google.com                        const sc_bind_proxy &p032,
11212837Sgabeblack@google.com                        const sc_bind_proxy &p033,
11312837Sgabeblack@google.com                        const sc_bind_proxy &p034,
11412837Sgabeblack@google.com                        const sc_bind_proxy &p035,
11512837Sgabeblack@google.com                        const sc_bind_proxy &p036,
11612837Sgabeblack@google.com                        const sc_bind_proxy &p037,
11712837Sgabeblack@google.com                        const sc_bind_proxy &p038,
11812837Sgabeblack@google.com                        const sc_bind_proxy &p039,
11912837Sgabeblack@google.com                        const sc_bind_proxy &p040,
12012837Sgabeblack@google.com                        const sc_bind_proxy &p041,
12112837Sgabeblack@google.com                        const sc_bind_proxy &p042,
12212837Sgabeblack@google.com                        const sc_bind_proxy &p043,
12312837Sgabeblack@google.com                        const sc_bind_proxy &p044,
12412837Sgabeblack@google.com                        const sc_bind_proxy &p045,
12512837Sgabeblack@google.com                        const sc_bind_proxy &p046,
12612837Sgabeblack@google.com                        const sc_bind_proxy &p047,
12712837Sgabeblack@google.com                        const sc_bind_proxy &p048,
12812837Sgabeblack@google.com                        const sc_bind_proxy &p049,
12912837Sgabeblack@google.com                        const sc_bind_proxy &p050,
13012837Sgabeblack@google.com                        const sc_bind_proxy &p051,
13112837Sgabeblack@google.com                        const sc_bind_proxy &p052,
13212837Sgabeblack@google.com                        const sc_bind_proxy &p053,
13312837Sgabeblack@google.com                        const sc_bind_proxy &p054,
13412837Sgabeblack@google.com                        const sc_bind_proxy &p055,
13512837Sgabeblack@google.com                        const sc_bind_proxy &p056,
13612837Sgabeblack@google.com                        const sc_bind_proxy &p057,
13712837Sgabeblack@google.com                        const sc_bind_proxy &p058,
13812837Sgabeblack@google.com                        const sc_bind_proxy &p059,
13912837Sgabeblack@google.com                        const sc_bind_proxy &p060,
14012837Sgabeblack@google.com                        const sc_bind_proxy &p061,
14112837Sgabeblack@google.com                        const sc_bind_proxy &p062,
14212837Sgabeblack@google.com                        const sc_bind_proxy &p063,
14312837Sgabeblack@google.com                        const sc_bind_proxy &p064)
14412837Sgabeblack@google.com{
14512837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
14612837Sgabeblack@google.com}
14712837Sgabeblack@google.com
14812837Sgabeblack@google.comconst std::vector<sc_object *> &
14912837Sgabeblack@google.comsc_module::get_child_objects() const
15012837Sgabeblack@google.com{
15112951Sgabeblack@google.com    return _gem5_module->obj()->get_child_objects();
15212837Sgabeblack@google.com}
15312837Sgabeblack@google.com
15412837Sgabeblack@google.comconst std::vector<sc_event *> &
15512837Sgabeblack@google.comsc_module::get_child_events() const
15612837Sgabeblack@google.com{
15712951Sgabeblack@google.com    return _gem5_module->obj()->get_child_events();
15812837Sgabeblack@google.com}
15912837Sgabeblack@google.com
16012951Sgabeblack@google.comsc_module::sc_module() :
16112952Sgabeblack@google.com    sc_object(sc_gem5::newModule()->name()),
16212951Sgabeblack@google.com    _gem5_module(sc_gem5::currentModule())
16312951Sgabeblack@google.com{}
16412837Sgabeblack@google.com
16512951Sgabeblack@google.comsc_module::sc_module(const sc_module_name &) : sc_module() {}
16612951Sgabeblack@google.comsc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name)) {}
16712951Sgabeblack@google.comsc_module::sc_module(const std::string &_name) :
16812951Sgabeblack@google.com    sc_module(sc_module_name(_name.c_str()))
16912951Sgabeblack@google.com{}
17012928Sgabeblack@google.com
17112837Sgabeblack@google.comvoid
17212837Sgabeblack@google.comsc_module::reset_signal_is(const sc_in<bool> &, bool)
17312837Sgabeblack@google.com{
17412837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
17512837Sgabeblack@google.com}
17612837Sgabeblack@google.com
17712837Sgabeblack@google.comvoid
17812837Sgabeblack@google.comsc_module::reset_signal_is(const sc_inout<bool> &, bool)
17912837Sgabeblack@google.com{
18012837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
18112837Sgabeblack@google.com}
18212837Sgabeblack@google.com
18312837Sgabeblack@google.comvoid
18412837Sgabeblack@google.comsc_module::reset_signal_is(const sc_out<bool> &, bool)
18512837Sgabeblack@google.com{
18612837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
18712837Sgabeblack@google.com}
18812837Sgabeblack@google.com
18912837Sgabeblack@google.comvoid
19012837Sgabeblack@google.comsc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool)
19112837Sgabeblack@google.com{
19212837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
19312837Sgabeblack@google.com}
19412837Sgabeblack@google.com
19512837Sgabeblack@google.com
19612837Sgabeblack@google.comvoid
19712837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_in<bool> &, bool)
19812837Sgabeblack@google.com{
19912837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
20012837Sgabeblack@google.com}
20112837Sgabeblack@google.com
20212837Sgabeblack@google.comvoid
20312837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_inout<bool> &, bool)
20412837Sgabeblack@google.com{
20512837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
20612837Sgabeblack@google.com}
20712837Sgabeblack@google.com
20812837Sgabeblack@google.comvoid
20912837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_out<bool> &, bool)
21012837Sgabeblack@google.com{
21112837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
21212837Sgabeblack@google.com}
21312837Sgabeblack@google.com
21412837Sgabeblack@google.comvoid
21512837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool)
21612837Sgabeblack@google.com{
21712837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
21812837Sgabeblack@google.com}
21912837Sgabeblack@google.com
22012837Sgabeblack@google.com
22112837Sgabeblack@google.comvoid
22212837Sgabeblack@google.comsc_module::dont_initialize()
22312837Sgabeblack@google.com{
22412953Sgabeblack@google.com    ::sc_gem5::Process::newest()->dontInitialize();
22512837Sgabeblack@google.com}
22612837Sgabeblack@google.com
22712837Sgabeblack@google.comvoid
22812953Sgabeblack@google.comsc_module::set_stack_size(size_t size)
22912837Sgabeblack@google.com{
23012953Sgabeblack@google.com    ::sc_gem5::Process::newest()->setStackSize(size);
23112837Sgabeblack@google.com}
23212837Sgabeblack@google.com
23312837Sgabeblack@google.com
23412951Sgabeblack@google.comvoid sc_module::next_trigger() { ::sc_core::next_trigger(); }
23512951Sgabeblack@google.com
23612837Sgabeblack@google.comvoid
23712951Sgabeblack@google.comsc_module::next_trigger(const sc_event &e)
23812837Sgabeblack@google.com{
23912951Sgabeblack@google.com    ::sc_core::next_trigger(e);
24012837Sgabeblack@google.com}
24112837Sgabeblack@google.com
24212837Sgabeblack@google.comvoid
24312951Sgabeblack@google.comsc_module::next_trigger(const sc_event_or_list &eol)
24412837Sgabeblack@google.com{
24512951Sgabeblack@google.com    ::sc_core::next_trigger(eol);
24612837Sgabeblack@google.com}
24712837Sgabeblack@google.com
24812837Sgabeblack@google.comvoid
24912951Sgabeblack@google.comsc_module::next_trigger(const sc_event_and_list &eal)
25012837Sgabeblack@google.com{
25112951Sgabeblack@google.com    ::sc_core::next_trigger(eal);
25212837Sgabeblack@google.com}
25312837Sgabeblack@google.com
25412837Sgabeblack@google.comvoid
25512951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t)
25612837Sgabeblack@google.com{
25712951Sgabeblack@google.com    ::sc_core::next_trigger(t);
25812837Sgabeblack@google.com}
25912837Sgabeblack@google.com
26012837Sgabeblack@google.comvoid
26112951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u)
26212837Sgabeblack@google.com{
26312951Sgabeblack@google.com    ::sc_core::next_trigger(d, u);
26412837Sgabeblack@google.com}
26512837Sgabeblack@google.com
26612837Sgabeblack@google.comvoid
26712951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event &e)
26812837Sgabeblack@google.com{
26912951Sgabeblack@google.com    ::sc_core::next_trigger(t, e);
27012837Sgabeblack@google.com}
27112837Sgabeblack@google.com
27212837Sgabeblack@google.comvoid
27312951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event &e)
27412837Sgabeblack@google.com{
27512951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, e);
27612837Sgabeblack@google.com}
27712837Sgabeblack@google.com
27812837Sgabeblack@google.comvoid
27912951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event_or_list &eol)
28012837Sgabeblack@google.com{
28112951Sgabeblack@google.com    ::sc_core::next_trigger(t, eol);
28212837Sgabeblack@google.com}
28312837Sgabeblack@google.com
28412837Sgabeblack@google.comvoid
28512951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
28612837Sgabeblack@google.com{
28712951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, eol);
28812837Sgabeblack@google.com}
28912837Sgabeblack@google.com
29012837Sgabeblack@google.comvoid
29112951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event_and_list &eal)
29212837Sgabeblack@google.com{
29312951Sgabeblack@google.com    ::sc_core::next_trigger(t, eal);
29412837Sgabeblack@google.com}
29512837Sgabeblack@google.com
29612837Sgabeblack@google.comvoid
29712951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
29812837Sgabeblack@google.com{
29912951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, eal);
30012837Sgabeblack@google.com}
30112837Sgabeblack@google.com
30212837Sgabeblack@google.com
30312929Sgabeblack@google.combool
30412929Sgabeblack@google.comsc_module::timed_out()
30512929Sgabeblack@google.com{
30612929Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
30712929Sgabeblack@google.com    return false;
30812929Sgabeblack@google.com}
30912929Sgabeblack@google.com
31012929Sgabeblack@google.com
31112837Sgabeblack@google.comvoid
31212837Sgabeblack@google.comsc_module::wait()
31312837Sgabeblack@google.com{
31412951Sgabeblack@google.com    ::sc_core::wait();
31512837Sgabeblack@google.com}
31612837Sgabeblack@google.com
31712837Sgabeblack@google.comvoid
31812951Sgabeblack@google.comsc_module::wait(int i)
31912837Sgabeblack@google.com{
32012951Sgabeblack@google.com    ::sc_core::wait(i);
32112837Sgabeblack@google.com}
32212837Sgabeblack@google.com
32312837Sgabeblack@google.comvoid
32412951Sgabeblack@google.comsc_module::wait(const sc_event &e)
32512837Sgabeblack@google.com{
32612951Sgabeblack@google.com    ::sc_core::wait(e);
32712837Sgabeblack@google.com}
32812837Sgabeblack@google.com
32912837Sgabeblack@google.comvoid
33012951Sgabeblack@google.comsc_module::wait(const sc_event_or_list &eol)
33112837Sgabeblack@google.com{
33212951Sgabeblack@google.com    ::sc_core::wait(eol);
33312837Sgabeblack@google.com}
33412837Sgabeblack@google.com
33512837Sgabeblack@google.comvoid
33612951Sgabeblack@google.comsc_module::wait(const sc_event_and_list &eal)
33712837Sgabeblack@google.com{
33812951Sgabeblack@google.com    ::sc_core::wait(eal);
33912837Sgabeblack@google.com}
34012837Sgabeblack@google.com
34112837Sgabeblack@google.comvoid
34212951Sgabeblack@google.comsc_module::wait(const sc_time &t)
34312837Sgabeblack@google.com{
34412951Sgabeblack@google.com    ::sc_core::wait(t);
34512837Sgabeblack@google.com}
34612837Sgabeblack@google.com
34712837Sgabeblack@google.comvoid
34812951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u)
34912837Sgabeblack@google.com{
35012951Sgabeblack@google.com    ::sc_core::wait(d, u);
35112837Sgabeblack@google.com}
35212837Sgabeblack@google.com
35312837Sgabeblack@google.comvoid
35412951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event &e)
35512837Sgabeblack@google.com{
35612951Sgabeblack@google.com    ::sc_core::wait(t, e);
35712837Sgabeblack@google.com}
35812837Sgabeblack@google.com
35912837Sgabeblack@google.comvoid
36012951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event &e)
36112837Sgabeblack@google.com{
36212951Sgabeblack@google.com    ::sc_core::wait(d, u, e);
36312837Sgabeblack@google.com}
36412837Sgabeblack@google.com
36512837Sgabeblack@google.comvoid
36612951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event_or_list &eol)
36712837Sgabeblack@google.com{
36812951Sgabeblack@google.com    ::sc_core::wait(t, eol);
36912837Sgabeblack@google.com}
37012837Sgabeblack@google.com
37112837Sgabeblack@google.comvoid
37212951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
37312837Sgabeblack@google.com{
37412951Sgabeblack@google.com    ::sc_core::wait(d, u, eol);
37512837Sgabeblack@google.com}
37612837Sgabeblack@google.com
37712837Sgabeblack@google.comvoid
37812951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event_and_list &eal)
37912837Sgabeblack@google.com{
38012951Sgabeblack@google.com    ::sc_core::wait(t, eal);
38112837Sgabeblack@google.com}
38212837Sgabeblack@google.com
38312837Sgabeblack@google.comvoid
38412951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
38512837Sgabeblack@google.com{
38612951Sgabeblack@google.com    ::sc_core::wait(d, u, eal);
38712837Sgabeblack@google.com}
38812837Sgabeblack@google.com
38912837Sgabeblack@google.com
39012837Sgabeblack@google.comvoid
39112909Sgabeblack@google.comsc_module::halt()
39212909Sgabeblack@google.com{
39312951Sgabeblack@google.com    ::sc_core::halt();
39412909Sgabeblack@google.com}
39512909Sgabeblack@google.com
39612914Sgabeblack@google.comvoid
39712951Sgabeblack@google.comsc_module::at_posedge(const sc_signal_in_if<bool> &s)
39812914Sgabeblack@google.com{
39912951Sgabeblack@google.com    ::sc_core::at_posedge(s);
40012914Sgabeblack@google.com}
40112914Sgabeblack@google.com
40212914Sgabeblack@google.comvoid
40312951Sgabeblack@google.comsc_module::at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
40412914Sgabeblack@google.com{
40512951Sgabeblack@google.com    ::sc_core::at_posedge(s);
40612914Sgabeblack@google.com}
40712914Sgabeblack@google.com
40812914Sgabeblack@google.comvoid
40912951Sgabeblack@google.comsc_module::at_negedge(const sc_signal_in_if<bool> &s)
41012914Sgabeblack@google.com{
41112951Sgabeblack@google.com    ::sc_core::at_negedge(s);
41212914Sgabeblack@google.com}
41312914Sgabeblack@google.com
41412914Sgabeblack@google.comvoid
41512951Sgabeblack@google.comsc_module::at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
41612914Sgabeblack@google.com{
41712951Sgabeblack@google.com    ::sc_core::at_negedge(s);
41812914Sgabeblack@google.com}
41912914Sgabeblack@google.com
42012909Sgabeblack@google.com
42112909Sgabeblack@google.comvoid
42212837Sgabeblack@google.comnext_trigger()
42312837Sgabeblack@google.com{
42412958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
42512958Sgabeblack@google.com    p->setDynamic(nullptr);
42612837Sgabeblack@google.com}
42712837Sgabeblack@google.com
42812837Sgabeblack@google.comvoid
42912958Sgabeblack@google.comnext_trigger(const sc_event &e)
43012837Sgabeblack@google.com{
43112958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
43212958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
43312837Sgabeblack@google.com}
43412837Sgabeblack@google.com
43512837Sgabeblack@google.comvoid
43612958Sgabeblack@google.comnext_trigger(const sc_event_or_list &eol)
43712837Sgabeblack@google.com{
43812958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
43912958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
44012837Sgabeblack@google.com}
44112837Sgabeblack@google.com
44212837Sgabeblack@google.comvoid
44312958Sgabeblack@google.comnext_trigger(const sc_event_and_list &eal)
44412837Sgabeblack@google.com{
44512958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
44612958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
44712837Sgabeblack@google.com}
44812837Sgabeblack@google.com
44912837Sgabeblack@google.comvoid
45012958Sgabeblack@google.comnext_trigger(const sc_time &t)
45112837Sgabeblack@google.com{
45212958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
45312958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
45412837Sgabeblack@google.com}
45512837Sgabeblack@google.com
45612837Sgabeblack@google.comvoid
45712951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u)
45812837Sgabeblack@google.com{
45912951Sgabeblack@google.com    next_trigger(sc_time(d, u));
46012837Sgabeblack@google.com}
46112837Sgabeblack@google.com
46212837Sgabeblack@google.comvoid
46312958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event &e)
46412837Sgabeblack@google.com{
46512958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
46612958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
46712837Sgabeblack@google.com}
46812837Sgabeblack@google.com
46912837Sgabeblack@google.comvoid
47012951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event &e)
47112837Sgabeblack@google.com{
47212951Sgabeblack@google.com    next_trigger(sc_time(d, u), e);
47312837Sgabeblack@google.com}
47412837Sgabeblack@google.com
47512837Sgabeblack@google.comvoid
47612958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event_or_list &eol)
47712837Sgabeblack@google.com{
47812958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
47912958Sgabeblack@google.com    p->setDynamic(
48012958Sgabeblack@google.com            new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
48112837Sgabeblack@google.com}
48212837Sgabeblack@google.com
48312837Sgabeblack@google.comvoid
48412951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
48512837Sgabeblack@google.com{
48612951Sgabeblack@google.com    next_trigger(sc_time(d, u), eol);
48712837Sgabeblack@google.com}
48812837Sgabeblack@google.com
48912837Sgabeblack@google.comvoid
49012958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event_and_list &eal)
49112837Sgabeblack@google.com{
49212958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
49312958Sgabeblack@google.com    p->setDynamic(
49412958Sgabeblack@google.com            new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
49512837Sgabeblack@google.com}
49612837Sgabeblack@google.com
49712837Sgabeblack@google.comvoid
49812951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
49912837Sgabeblack@google.com{
50012951Sgabeblack@google.com    next_trigger(sc_time(d, u), eal);
50112837Sgabeblack@google.com}
50212837Sgabeblack@google.com
50312929Sgabeblack@google.combool
50412929Sgabeblack@google.comtimed_out()
50512929Sgabeblack@google.com{
50612929Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
50712929Sgabeblack@google.com    return false;
50812929Sgabeblack@google.com}
50912929Sgabeblack@google.com
51012837Sgabeblack@google.com
51112837Sgabeblack@google.comvoid
51212837Sgabeblack@google.comwait()
51312837Sgabeblack@google.com{
51412958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
51512958Sgabeblack@google.com    p->setDynamic(nullptr);
51612958Sgabeblack@google.com    sc_gem5::scheduler.yield();
51712837Sgabeblack@google.com}
51812837Sgabeblack@google.com
51912837Sgabeblack@google.comvoid
52012958Sgabeblack@google.comwait(int n)
52112837Sgabeblack@google.com{
52212958Sgabeblack@google.com    for (int i = 0; i < n; i++)
52312958Sgabeblack@google.com        wait();
52412837Sgabeblack@google.com}
52512837Sgabeblack@google.com
52612837Sgabeblack@google.comvoid
52712958Sgabeblack@google.comwait(const sc_event &e)
52812837Sgabeblack@google.com{
52912958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
53012958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEvent(p, &e));
53112958Sgabeblack@google.com    sc_gem5::scheduler.yield();
53212837Sgabeblack@google.com}
53312837Sgabeblack@google.com
53412837Sgabeblack@google.comvoid
53512958Sgabeblack@google.comwait(const sc_event_or_list &eol)
53612837Sgabeblack@google.com{
53712958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
53812958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEventOrList(p, &eol));
53912958Sgabeblack@google.com    sc_gem5::scheduler.yield();
54012837Sgabeblack@google.com}
54112837Sgabeblack@google.com
54212837Sgabeblack@google.comvoid
54312958Sgabeblack@google.comwait(const sc_event_and_list &eal)
54412837Sgabeblack@google.com{
54512958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
54612958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityEventAndList(p, &eal));
54712958Sgabeblack@google.com    sc_gem5::scheduler.yield();
54812837Sgabeblack@google.com}
54912837Sgabeblack@google.com
55012837Sgabeblack@google.comvoid
55112958Sgabeblack@google.comwait(const sc_time &t)
55212837Sgabeblack@google.com{
55312958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
55412958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityTimeout(p, t));
55512958Sgabeblack@google.com    sc_gem5::scheduler.yield();
55612837Sgabeblack@google.com}
55712837Sgabeblack@google.com
55812837Sgabeblack@google.comvoid
55912951Sgabeblack@google.comwait(double d, sc_time_unit u)
56012837Sgabeblack@google.com{
56112951Sgabeblack@google.com    wait(sc_time(d, u));
56212837Sgabeblack@google.com}
56312837Sgabeblack@google.com
56412837Sgabeblack@google.comvoid
56512958Sgabeblack@google.comwait(const sc_time &t, const sc_event &e)
56612837Sgabeblack@google.com{
56712958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
56812958Sgabeblack@google.com    p->setDynamic(new ::sc_gem5::SensitivityTimeoutAndEvent(p, t, &e));
56912958Sgabeblack@google.com    sc_gem5::scheduler.yield();
57012837Sgabeblack@google.com}
57112837Sgabeblack@google.com
57212837Sgabeblack@google.comvoid
57312951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event &e)
57412837Sgabeblack@google.com{
57512951Sgabeblack@google.com    wait(sc_time(d, u), e);
57612837Sgabeblack@google.com}
57712837Sgabeblack@google.com
57812837Sgabeblack@google.comvoid
57912958Sgabeblack@google.comwait(const sc_time &t, const sc_event_or_list &eol)
58012837Sgabeblack@google.com{
58112958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
58212958Sgabeblack@google.com    p->setDynamic(
58312958Sgabeblack@google.com            new ::sc_gem5::SensitivityTimeoutAndEventOrList(p, t, &eol));
58412958Sgabeblack@google.com    sc_gem5::scheduler.yield();
58512837Sgabeblack@google.com}
58612837Sgabeblack@google.com
58712837Sgabeblack@google.comvoid
58812951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event_or_list &eol)
58912837Sgabeblack@google.com{
59012951Sgabeblack@google.com    wait(sc_time(d, u), eol);
59112837Sgabeblack@google.com}
59212837Sgabeblack@google.com
59312837Sgabeblack@google.comvoid
59412958Sgabeblack@google.comwait(const sc_time &t, const sc_event_and_list &eal)
59512837Sgabeblack@google.com{
59612958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
59712958Sgabeblack@google.com    p->setDynamic(
59812958Sgabeblack@google.com            new ::sc_gem5::SensitivityTimeoutAndEventAndList(p, t, &eal));
59912958Sgabeblack@google.com    sc_gem5::scheduler.yield();
60012837Sgabeblack@google.com}
60112837Sgabeblack@google.com
60212837Sgabeblack@google.comvoid
60312951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event_and_list &eal)
60412837Sgabeblack@google.com{
60512951Sgabeblack@google.com    wait(sc_time(d, u), eal);
60612837Sgabeblack@google.com}
60712837Sgabeblack@google.com
60812909Sgabeblack@google.comvoid
60912909Sgabeblack@google.comhalt()
61012909Sgabeblack@google.com{
61112909Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
61212909Sgabeblack@google.com}
61312909Sgabeblack@google.com
61412914Sgabeblack@google.comvoid
61512914Sgabeblack@google.comat_posedge(const sc_signal_in_if<bool> &)
61612914Sgabeblack@google.com{
61712914Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
61812914Sgabeblack@google.com}
61912914Sgabeblack@google.com
62012914Sgabeblack@google.comvoid
62112914Sgabeblack@google.comat_posedge(const sc_signal_in_if<sc_dt::sc_logic> &)
62212914Sgabeblack@google.com{
62312914Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
62412914Sgabeblack@google.com}
62512914Sgabeblack@google.com
62612914Sgabeblack@google.comvoid
62712914Sgabeblack@google.comat_negedge(const sc_signal_in_if<bool> &)
62812914Sgabeblack@google.com{
62912914Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
63012914Sgabeblack@google.com}
63112914Sgabeblack@google.com
63212914Sgabeblack@google.comvoid
63312914Sgabeblack@google.comat_negedge(const sc_signal_in_if<sc_dt::sc_logic> &)
63412914Sgabeblack@google.com{
63512914Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
63612914Sgabeblack@google.com}
63712914Sgabeblack@google.com
63812837Sgabeblack@google.comconst char *
63912837Sgabeblack@google.comsc_gen_unique_name(const char *)
64012837Sgabeblack@google.com{
64112837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
64212837Sgabeblack@google.com    return "";
64312837Sgabeblack@google.com}
64412837Sgabeblack@google.com
64512837Sgabeblack@google.combool
64612930Sgabeblack@google.comsc_hierarchical_name_exists(const char *name)
64712930Sgabeblack@google.com{
64812930Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
64912930Sgabeblack@google.com    return false;
65012930Sgabeblack@google.com}
65112930Sgabeblack@google.com
65212930Sgabeblack@google.combool
65312837Sgabeblack@google.comsc_start_of_simulation_invoked()
65412837Sgabeblack@google.com{
65512837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
65612837Sgabeblack@google.com    return false;
65712837Sgabeblack@google.com}
65812837Sgabeblack@google.com
65912837Sgabeblack@google.combool
66012837Sgabeblack@google.comsc_end_of_simulation_invoked()
66112837Sgabeblack@google.com{
66212837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
66312837Sgabeblack@google.com    return false;
66412837Sgabeblack@google.com}
66512837Sgabeblack@google.com
66612901Sgabeblack@google.comsc_module *
66712901Sgabeblack@google.comsc_module_sc_new(sc_module *mod)
66812901Sgabeblack@google.com{
66912901Sgabeblack@google.com    static std::vector<std::unique_ptr<sc_module> > modules;
67012901Sgabeblack@google.com    modules.emplace_back(mod);
67112901Sgabeblack@google.com    return mod;
67212901Sgabeblack@google.com}
67312901Sgabeblack@google.com
67412837Sgabeblack@google.com} // namespace sc_core
675