sc_module.cc revision 13248
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>
3113135Sgabeblack@google.com#include <string>
3212901Sgabeblack@google.com#include <vector>
3312901Sgabeblack@google.com
3412837Sgabeblack@google.com#include "base/logging.hh"
3512982Sgabeblack@google.com#include "systemc/core/kernel.hh"
3612951Sgabeblack@google.com#include "systemc/core/module.hh"
3712953Sgabeblack@google.com#include "systemc/core/process_types.hh"
3813155Sgabeblack@google.com#include "systemc/ext/channel/sc_signal_in_if.hh"
3912837Sgabeblack@google.com#include "systemc/ext/core/sc_module.hh"
4012951Sgabeblack@google.com#include "systemc/ext/core/sc_module_name.hh"
4113155Sgabeblack@google.com#include "systemc/ext/dt/bit/sc_logic.hh"
4213135Sgabeblack@google.com#include "systemc/ext/utils/sc_report_handler.hh"
4312837Sgabeblack@google.com
4412952Sgabeblack@google.comnamespace sc_gem5
4512952Sgabeblack@google.com{
4612952Sgabeblack@google.com
4712952Sgabeblack@google.comProcess *
4812952Sgabeblack@google.comnewMethodProcess(const char *name, ProcessFuncWrapper *func)
4912952Sgabeblack@google.com{
5013135Sgabeblack@google.com    Method *p = new Method(name, func);
5113135Sgabeblack@google.com    if (::sc_core::sc_is_running()) {
5213135Sgabeblack@google.com        std::string name = p->name();
5313135Sgabeblack@google.com        delete p;
5413135Sgabeblack@google.com        SC_REPORT_ERROR("(E541) call to SC_METHOD in sc_module while "
5513135Sgabeblack@google.com                "simulation running", name.c_str());
5613135Sgabeblack@google.com        return nullptr;
5713135Sgabeblack@google.com    }
5812993Sgabeblack@google.com    scheduler.reg(p);
5912993Sgabeblack@google.com    return p;
6012952Sgabeblack@google.com}
6112952Sgabeblack@google.com
6212952Sgabeblack@google.comProcess *
6312952Sgabeblack@google.comnewThreadProcess(const char *name, ProcessFuncWrapper *func)
6412952Sgabeblack@google.com{
6513135Sgabeblack@google.com    Thread *p = new Thread(name, func);
6613135Sgabeblack@google.com    if (::sc_core::sc_is_running()) {
6713135Sgabeblack@google.com        std::string name = p->name();
6813135Sgabeblack@google.com        delete p;
6913135Sgabeblack@google.com        SC_REPORT_ERROR("(E542) call to SC_THREAD in sc_module while "
7013135Sgabeblack@google.com                "simulation running", name.c_str());
7113135Sgabeblack@google.com        return nullptr;
7213135Sgabeblack@google.com    }
7312993Sgabeblack@google.com    scheduler.reg(p);
7412993Sgabeblack@google.com    return p;
7512952Sgabeblack@google.com}
7612952Sgabeblack@google.com
7712952Sgabeblack@google.comProcess *
7812952Sgabeblack@google.comnewCThreadProcess(const char *name, ProcessFuncWrapper *func)
7912952Sgabeblack@google.com{
8013135Sgabeblack@google.com    CThread *p = new CThread(name, func);
8113135Sgabeblack@google.com    if (::sc_core::sc_is_running()) {
8213135Sgabeblack@google.com        std::string name = p->name();
8313135Sgabeblack@google.com        delete p;
8413135Sgabeblack@google.com        SC_REPORT_ERROR("(E543) call to SC_CTHREAD in sc_module while "
8513135Sgabeblack@google.com                "simulation running", name.c_str());
8613135Sgabeblack@google.com        return nullptr;
8713135Sgabeblack@google.com    }
8812993Sgabeblack@google.com    scheduler.reg(p);
8913194Sgabeblack@google.com    p->dontInitialize(true);
9012993Sgabeblack@google.com    return p;
9112952Sgabeblack@google.com}
9212952Sgabeblack@google.com
9313035Sgabeblack@google.comUniqueNameGen nameGen;
9413035Sgabeblack@google.com
9512952Sgabeblack@google.com} // namespace sc_gem5
9612952Sgabeblack@google.com
9712837Sgabeblack@google.comnamespace sc_core
9812837Sgabeblack@google.com{
9912837Sgabeblack@google.com
10013091Sgabeblack@google.comsc_bind_proxy::sc_bind_proxy(sc_interface &_interface) :
10112951Sgabeblack@google.com    _interface(&_interface), _port(nullptr)
10212951Sgabeblack@google.com{}
10312837Sgabeblack@google.com
10413091Sgabeblack@google.comsc_bind_proxy::sc_bind_proxy(sc_port_base &_port) :
10512951Sgabeblack@google.com    _interface(nullptr), _port(&_port)
10612951Sgabeblack@google.com{}
10712837Sgabeblack@google.com
10813091Sgabeblack@google.comconst sc_bind_proxy SC_BIND_PROXY_NUL(*(sc_port_base *)nullptr);
10912837Sgabeblack@google.com
11012982Sgabeblack@google.comsc_module::~sc_module() { delete _gem5_module; }
11112837Sgabeblack@google.com
11213091Sgabeblack@google.comconst sc_bind_proxy SC_BIND_PROXY_NIL(*(sc_port_base *)nullptr);
11312837Sgabeblack@google.com
11412837Sgabeblack@google.comvoid
11512837Sgabeblack@google.comsc_module::operator () (const sc_bind_proxy &p001,
11612837Sgabeblack@google.com                        const sc_bind_proxy &p002,
11712837Sgabeblack@google.com                        const sc_bind_proxy &p003,
11812837Sgabeblack@google.com                        const sc_bind_proxy &p004,
11912837Sgabeblack@google.com                        const sc_bind_proxy &p005,
12012837Sgabeblack@google.com                        const sc_bind_proxy &p006,
12112837Sgabeblack@google.com                        const sc_bind_proxy &p007,
12212837Sgabeblack@google.com                        const sc_bind_proxy &p008,
12312837Sgabeblack@google.com                        const sc_bind_proxy &p009,
12412837Sgabeblack@google.com                        const sc_bind_proxy &p010,
12512837Sgabeblack@google.com                        const sc_bind_proxy &p011,
12612837Sgabeblack@google.com                        const sc_bind_proxy &p012,
12712837Sgabeblack@google.com                        const sc_bind_proxy &p013,
12812837Sgabeblack@google.com                        const sc_bind_proxy &p014,
12912837Sgabeblack@google.com                        const sc_bind_proxy &p015,
13012837Sgabeblack@google.com                        const sc_bind_proxy &p016,
13112837Sgabeblack@google.com                        const sc_bind_proxy &p017,
13212837Sgabeblack@google.com                        const sc_bind_proxy &p018,
13312837Sgabeblack@google.com                        const sc_bind_proxy &p019,
13412837Sgabeblack@google.com                        const sc_bind_proxy &p020,
13512837Sgabeblack@google.com                        const sc_bind_proxy &p021,
13612837Sgabeblack@google.com                        const sc_bind_proxy &p022,
13712837Sgabeblack@google.com                        const sc_bind_proxy &p023,
13812837Sgabeblack@google.com                        const sc_bind_proxy &p024,
13912837Sgabeblack@google.com                        const sc_bind_proxy &p025,
14012837Sgabeblack@google.com                        const sc_bind_proxy &p026,
14112837Sgabeblack@google.com                        const sc_bind_proxy &p027,
14212837Sgabeblack@google.com                        const sc_bind_proxy &p028,
14312837Sgabeblack@google.com                        const sc_bind_proxy &p029,
14412837Sgabeblack@google.com                        const sc_bind_proxy &p030,
14512837Sgabeblack@google.com                        const sc_bind_proxy &p031,
14612837Sgabeblack@google.com                        const sc_bind_proxy &p032,
14712837Sgabeblack@google.com                        const sc_bind_proxy &p033,
14812837Sgabeblack@google.com                        const sc_bind_proxy &p034,
14912837Sgabeblack@google.com                        const sc_bind_proxy &p035,
15012837Sgabeblack@google.com                        const sc_bind_proxy &p036,
15112837Sgabeblack@google.com                        const sc_bind_proxy &p037,
15212837Sgabeblack@google.com                        const sc_bind_proxy &p038,
15312837Sgabeblack@google.com                        const sc_bind_proxy &p039,
15412837Sgabeblack@google.com                        const sc_bind_proxy &p040,
15512837Sgabeblack@google.com                        const sc_bind_proxy &p041,
15612837Sgabeblack@google.com                        const sc_bind_proxy &p042,
15712837Sgabeblack@google.com                        const sc_bind_proxy &p043,
15812837Sgabeblack@google.com                        const sc_bind_proxy &p044,
15912837Sgabeblack@google.com                        const sc_bind_proxy &p045,
16012837Sgabeblack@google.com                        const sc_bind_proxy &p046,
16112837Sgabeblack@google.com                        const sc_bind_proxy &p047,
16212837Sgabeblack@google.com                        const sc_bind_proxy &p048,
16312837Sgabeblack@google.com                        const sc_bind_proxy &p049,
16412837Sgabeblack@google.com                        const sc_bind_proxy &p050,
16512837Sgabeblack@google.com                        const sc_bind_proxy &p051,
16612837Sgabeblack@google.com                        const sc_bind_proxy &p052,
16712837Sgabeblack@google.com                        const sc_bind_proxy &p053,
16812837Sgabeblack@google.com                        const sc_bind_proxy &p054,
16912837Sgabeblack@google.com                        const sc_bind_proxy &p055,
17012837Sgabeblack@google.com                        const sc_bind_proxy &p056,
17112837Sgabeblack@google.com                        const sc_bind_proxy &p057,
17212837Sgabeblack@google.com                        const sc_bind_proxy &p058,
17312837Sgabeblack@google.com                        const sc_bind_proxy &p059,
17412837Sgabeblack@google.com                        const sc_bind_proxy &p060,
17512837Sgabeblack@google.com                        const sc_bind_proxy &p061,
17612837Sgabeblack@google.com                        const sc_bind_proxy &p062,
17712837Sgabeblack@google.com                        const sc_bind_proxy &p063,
17812837Sgabeblack@google.com                        const sc_bind_proxy &p064)
17912837Sgabeblack@google.com{
18013091Sgabeblack@google.com    std::vector<const ::sc_core::sc_bind_proxy *> proxies;
18113091Sgabeblack@google.com    auto insert = [&proxies](const ::sc_core::sc_bind_proxy &p) -> bool {
18213091Sgabeblack@google.com        if (!p.port() && !p.interface())
18313091Sgabeblack@google.com            return false;
18413091Sgabeblack@google.com        proxies.push_back(&p);
18513091Sgabeblack@google.com        return true;
18613091Sgabeblack@google.com    };
18713091Sgabeblack@google.com    insert(p001) && insert(p002) && insert(p003) && insert(p004) &&
18813091Sgabeblack@google.com    insert(p005) && insert(p006) && insert(p007) && insert(p008) &&
18913091Sgabeblack@google.com    insert(p009) && insert(p010) && insert(p011) && insert(p012) &&
19013091Sgabeblack@google.com    insert(p013) && insert(p014) && insert(p015) && insert(p016) &&
19113091Sgabeblack@google.com    insert(p017) && insert(p018) && insert(p019) && insert(p020) &&
19213091Sgabeblack@google.com    insert(p021) && insert(p022) && insert(p023) && insert(p024) &&
19313091Sgabeblack@google.com    insert(p025) && insert(p026) && insert(p027) && insert(p028) &&
19413091Sgabeblack@google.com    insert(p029) && insert(p030) && insert(p031) && insert(p032) &&
19513091Sgabeblack@google.com    insert(p033) && insert(p034) && insert(p035) && insert(p036) &&
19613091Sgabeblack@google.com    insert(p037) && insert(p038) && insert(p039) && insert(p040) &&
19713091Sgabeblack@google.com    insert(p041) && insert(p042) && insert(p043) && insert(p044) &&
19813091Sgabeblack@google.com    insert(p045) && insert(p046) && insert(p047) && insert(p048) &&
19913091Sgabeblack@google.com    insert(p049) && insert(p050) && insert(p051) && insert(p052) &&
20013091Sgabeblack@google.com    insert(p053) && insert(p054) && insert(p055) && insert(p056) &&
20113091Sgabeblack@google.com    insert(p057) && insert(p058) && insert(p059) && insert(p060) &&
20213091Sgabeblack@google.com    insert(p061) && insert(p062) && insert(p063) && insert(p064);
20313091Sgabeblack@google.com    _gem5_module->bindPorts(proxies);
20412837Sgabeblack@google.com}
20512837Sgabeblack@google.com
20612837Sgabeblack@google.comconst std::vector<sc_object *> &
20712837Sgabeblack@google.comsc_module::get_child_objects() const
20812837Sgabeblack@google.com{
20912951Sgabeblack@google.com    return _gem5_module->obj()->get_child_objects();
21012837Sgabeblack@google.com}
21112837Sgabeblack@google.com
21212837Sgabeblack@google.comconst std::vector<sc_event *> &
21312837Sgabeblack@google.comsc_module::get_child_events() const
21412837Sgabeblack@google.com{
21512951Sgabeblack@google.com    return _gem5_module->obj()->get_child_events();
21612837Sgabeblack@google.com}
21712837Sgabeblack@google.com
21812951Sgabeblack@google.comsc_module::sc_module() :
21913079Sgabeblack@google.com    sc_object(sc_gem5::newModuleChecked()->name()),
22012951Sgabeblack@google.com    _gem5_module(sc_gem5::currentModule())
22112951Sgabeblack@google.com{}
22212837Sgabeblack@google.com
22312951Sgabeblack@google.comsc_module::sc_module(const sc_module_name &) : sc_module() {}
22413191Sgabeblack@google.comsc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name))
22513191Sgabeblack@google.com{
22613191Sgabeblack@google.com    _gem5_module->deprecatedConstructor();
22713191Sgabeblack@google.com    SC_REPORT_WARNING("(W569) sc_module(const char*), "
22813191Sgabeblack@google.com            "sc_module(const std::string&) have been deprecated, use "
22913191Sgabeblack@google.com            "sc_module(const sc_module_name&)", _name);
23013191Sgabeblack@google.com}
23112951Sgabeblack@google.comsc_module::sc_module(const std::string &_name) :
23212951Sgabeblack@google.com    sc_module(sc_module_name(_name.c_str()))
23313191Sgabeblack@google.com{
23413191Sgabeblack@google.com    _gem5_module->deprecatedConstructor();
23513191Sgabeblack@google.com    SC_REPORT_WARNING("(W569) sc_module(const char*), "
23613191Sgabeblack@google.com            "sc_module(const std::string&) have been deprecated, use "
23713191Sgabeblack@google.com            "sc_module(const sc_module_name&)", _name.c_str());
23813191Sgabeblack@google.com}
23913191Sgabeblack@google.com
24013191Sgabeblack@google.comvoid
24113191Sgabeblack@google.comsc_module::end_module()
24213191Sgabeblack@google.com{
24313191Sgabeblack@google.com    _gem5_module->endModule();
24413191Sgabeblack@google.com}
24512928Sgabeblack@google.com
24612837Sgabeblack@google.comvoid
24712837Sgabeblack@google.comsc_module::reset_signal_is(const sc_in<bool> &, bool)
24812837Sgabeblack@google.com{
24912837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
25012837Sgabeblack@google.com}
25112837Sgabeblack@google.com
25212837Sgabeblack@google.comvoid
25312837Sgabeblack@google.comsc_module::reset_signal_is(const sc_inout<bool> &, bool)
25412837Sgabeblack@google.com{
25512837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
25612837Sgabeblack@google.com}
25712837Sgabeblack@google.com
25812837Sgabeblack@google.comvoid
25912837Sgabeblack@google.comsc_module::reset_signal_is(const sc_out<bool> &, bool)
26012837Sgabeblack@google.com{
26112837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
26212837Sgabeblack@google.com}
26312837Sgabeblack@google.com
26412837Sgabeblack@google.comvoid
26512837Sgabeblack@google.comsc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool)
26612837Sgabeblack@google.com{
26712837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
26812837Sgabeblack@google.com}
26912837Sgabeblack@google.com
27012837Sgabeblack@google.com
27112837Sgabeblack@google.comvoid
27212837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_in<bool> &, bool)
27312837Sgabeblack@google.com{
27412837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
27512837Sgabeblack@google.com}
27612837Sgabeblack@google.com
27712837Sgabeblack@google.comvoid
27812837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_inout<bool> &, bool)
27912837Sgabeblack@google.com{
28012837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
28112837Sgabeblack@google.com}
28212837Sgabeblack@google.com
28312837Sgabeblack@google.comvoid
28412837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_out<bool> &, bool)
28512837Sgabeblack@google.com{
28612837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
28712837Sgabeblack@google.com}
28812837Sgabeblack@google.com
28912837Sgabeblack@google.comvoid
29012837Sgabeblack@google.comsc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool)
29112837Sgabeblack@google.com{
29212837Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
29312837Sgabeblack@google.com}
29412837Sgabeblack@google.com
29512837Sgabeblack@google.com
29612837Sgabeblack@google.comvoid
29712837Sgabeblack@google.comsc_module::dont_initialize()
29812837Sgabeblack@google.com{
29913194Sgabeblack@google.com    ::sc_gem5::Process::newest()->dontInitialize(true);
30012837Sgabeblack@google.com}
30112837Sgabeblack@google.com
30212837Sgabeblack@google.comvoid
30312953Sgabeblack@google.comsc_module::set_stack_size(size_t size)
30412837Sgabeblack@google.com{
30512953Sgabeblack@google.com    ::sc_gem5::Process::newest()->setStackSize(size);
30612837Sgabeblack@google.com}
30712837Sgabeblack@google.com
30812837Sgabeblack@google.com
30912951Sgabeblack@google.comvoid sc_module::next_trigger() { ::sc_core::next_trigger(); }
31012951Sgabeblack@google.com
31112837Sgabeblack@google.comvoid
31212951Sgabeblack@google.comsc_module::next_trigger(const sc_event &e)
31312837Sgabeblack@google.com{
31412951Sgabeblack@google.com    ::sc_core::next_trigger(e);
31512837Sgabeblack@google.com}
31612837Sgabeblack@google.com
31712837Sgabeblack@google.comvoid
31812951Sgabeblack@google.comsc_module::next_trigger(const sc_event_or_list &eol)
31912837Sgabeblack@google.com{
32012951Sgabeblack@google.com    ::sc_core::next_trigger(eol);
32112837Sgabeblack@google.com}
32212837Sgabeblack@google.com
32312837Sgabeblack@google.comvoid
32412951Sgabeblack@google.comsc_module::next_trigger(const sc_event_and_list &eal)
32512837Sgabeblack@google.com{
32612951Sgabeblack@google.com    ::sc_core::next_trigger(eal);
32712837Sgabeblack@google.com}
32812837Sgabeblack@google.com
32912837Sgabeblack@google.comvoid
33012951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t)
33112837Sgabeblack@google.com{
33212951Sgabeblack@google.com    ::sc_core::next_trigger(t);
33312837Sgabeblack@google.com}
33412837Sgabeblack@google.com
33512837Sgabeblack@google.comvoid
33612951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u)
33712837Sgabeblack@google.com{
33812951Sgabeblack@google.com    ::sc_core::next_trigger(d, u);
33912837Sgabeblack@google.com}
34012837Sgabeblack@google.com
34112837Sgabeblack@google.comvoid
34212951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event &e)
34312837Sgabeblack@google.com{
34412951Sgabeblack@google.com    ::sc_core::next_trigger(t, e);
34512837Sgabeblack@google.com}
34612837Sgabeblack@google.com
34712837Sgabeblack@google.comvoid
34812951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event &e)
34912837Sgabeblack@google.com{
35012951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, e);
35112837Sgabeblack@google.com}
35212837Sgabeblack@google.com
35312837Sgabeblack@google.comvoid
35412951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event_or_list &eol)
35512837Sgabeblack@google.com{
35612951Sgabeblack@google.com    ::sc_core::next_trigger(t, eol);
35712837Sgabeblack@google.com}
35812837Sgabeblack@google.com
35912837Sgabeblack@google.comvoid
36012951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
36112837Sgabeblack@google.com{
36212951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, eol);
36312837Sgabeblack@google.com}
36412837Sgabeblack@google.com
36512837Sgabeblack@google.comvoid
36612951Sgabeblack@google.comsc_module::next_trigger(const sc_time &t, const sc_event_and_list &eal)
36712837Sgabeblack@google.com{
36812951Sgabeblack@google.com    ::sc_core::next_trigger(t, eal);
36912837Sgabeblack@google.com}
37012837Sgabeblack@google.com
37112837Sgabeblack@google.comvoid
37212951Sgabeblack@google.comsc_module::next_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
37312837Sgabeblack@google.com{
37412951Sgabeblack@google.com    ::sc_core::next_trigger(d, u, eal);
37512837Sgabeblack@google.com}
37612837Sgabeblack@google.com
37712837Sgabeblack@google.com
37812929Sgabeblack@google.combool
37912929Sgabeblack@google.comsc_module::timed_out()
38012929Sgabeblack@google.com{
38113189Sgabeblack@google.com    return ::sc_core::timed_out();
38212929Sgabeblack@google.com}
38312929Sgabeblack@google.com
38412929Sgabeblack@google.com
38512837Sgabeblack@google.comvoid
38612837Sgabeblack@google.comsc_module::wait()
38712837Sgabeblack@google.com{
38812951Sgabeblack@google.com    ::sc_core::wait();
38912837Sgabeblack@google.com}
39012837Sgabeblack@google.com
39112837Sgabeblack@google.comvoid
39212951Sgabeblack@google.comsc_module::wait(int i)
39312837Sgabeblack@google.com{
39412951Sgabeblack@google.com    ::sc_core::wait(i);
39512837Sgabeblack@google.com}
39612837Sgabeblack@google.com
39712837Sgabeblack@google.comvoid
39812951Sgabeblack@google.comsc_module::wait(const sc_event &e)
39912837Sgabeblack@google.com{
40012951Sgabeblack@google.com    ::sc_core::wait(e);
40112837Sgabeblack@google.com}
40212837Sgabeblack@google.com
40312837Sgabeblack@google.comvoid
40412951Sgabeblack@google.comsc_module::wait(const sc_event_or_list &eol)
40512837Sgabeblack@google.com{
40612951Sgabeblack@google.com    ::sc_core::wait(eol);
40712837Sgabeblack@google.com}
40812837Sgabeblack@google.com
40912837Sgabeblack@google.comvoid
41012951Sgabeblack@google.comsc_module::wait(const sc_event_and_list &eal)
41112837Sgabeblack@google.com{
41212951Sgabeblack@google.com    ::sc_core::wait(eal);
41312837Sgabeblack@google.com}
41412837Sgabeblack@google.com
41512837Sgabeblack@google.comvoid
41612951Sgabeblack@google.comsc_module::wait(const sc_time &t)
41712837Sgabeblack@google.com{
41812951Sgabeblack@google.com    ::sc_core::wait(t);
41912837Sgabeblack@google.com}
42012837Sgabeblack@google.com
42112837Sgabeblack@google.comvoid
42212951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u)
42312837Sgabeblack@google.com{
42412951Sgabeblack@google.com    ::sc_core::wait(d, u);
42512837Sgabeblack@google.com}
42612837Sgabeblack@google.com
42712837Sgabeblack@google.comvoid
42812951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event &e)
42912837Sgabeblack@google.com{
43012951Sgabeblack@google.com    ::sc_core::wait(t, e);
43112837Sgabeblack@google.com}
43212837Sgabeblack@google.com
43312837Sgabeblack@google.comvoid
43412951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event &e)
43512837Sgabeblack@google.com{
43612951Sgabeblack@google.com    ::sc_core::wait(d, u, e);
43712837Sgabeblack@google.com}
43812837Sgabeblack@google.com
43912837Sgabeblack@google.comvoid
44012951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event_or_list &eol)
44112837Sgabeblack@google.com{
44212951Sgabeblack@google.com    ::sc_core::wait(t, eol);
44312837Sgabeblack@google.com}
44412837Sgabeblack@google.com
44512837Sgabeblack@google.comvoid
44612951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event_or_list &eol)
44712837Sgabeblack@google.com{
44812951Sgabeblack@google.com    ::sc_core::wait(d, u, eol);
44912837Sgabeblack@google.com}
45012837Sgabeblack@google.com
45112837Sgabeblack@google.comvoid
45212951Sgabeblack@google.comsc_module::wait(const sc_time &t, const sc_event_and_list &eal)
45312837Sgabeblack@google.com{
45412951Sgabeblack@google.com    ::sc_core::wait(t, eal);
45512837Sgabeblack@google.com}
45612837Sgabeblack@google.com
45712837Sgabeblack@google.comvoid
45812951Sgabeblack@google.comsc_module::wait(double d, sc_time_unit u, const sc_event_and_list &eal)
45912837Sgabeblack@google.com{
46012951Sgabeblack@google.com    ::sc_core::wait(d, u, eal);
46112837Sgabeblack@google.com}
46212837Sgabeblack@google.com
46312837Sgabeblack@google.com
46412837Sgabeblack@google.comvoid
46512909Sgabeblack@google.comsc_module::halt()
46612909Sgabeblack@google.com{
46712951Sgabeblack@google.com    ::sc_core::halt();
46812909Sgabeblack@google.com}
46912909Sgabeblack@google.com
47012914Sgabeblack@google.comvoid
47112951Sgabeblack@google.comsc_module::at_posedge(const sc_signal_in_if<bool> &s)
47212914Sgabeblack@google.com{
47312951Sgabeblack@google.com    ::sc_core::at_posedge(s);
47412914Sgabeblack@google.com}
47512914Sgabeblack@google.com
47612914Sgabeblack@google.comvoid
47712951Sgabeblack@google.comsc_module::at_posedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
47812914Sgabeblack@google.com{
47912951Sgabeblack@google.com    ::sc_core::at_posedge(s);
48012914Sgabeblack@google.com}
48112914Sgabeblack@google.com
48212914Sgabeblack@google.comvoid
48312951Sgabeblack@google.comsc_module::at_negedge(const sc_signal_in_if<bool> &s)
48412914Sgabeblack@google.com{
48512951Sgabeblack@google.com    ::sc_core::at_negedge(s);
48612914Sgabeblack@google.com}
48712914Sgabeblack@google.com
48812914Sgabeblack@google.comvoid
48912951Sgabeblack@google.comsc_module::at_negedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
49012914Sgabeblack@google.com{
49112951Sgabeblack@google.com    ::sc_core::at_negedge(s);
49212914Sgabeblack@google.com}
49312914Sgabeblack@google.com
49412909Sgabeblack@google.com
49512909Sgabeblack@google.comvoid
49612837Sgabeblack@google.comnext_trigger()
49712837Sgabeblack@google.com{
49812958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
49913206Sgabeblack@google.com    p->cancelTimeout();
50013206Sgabeblack@google.com    p->clearDynamic();
50112837Sgabeblack@google.com}
50212837Sgabeblack@google.com
50312837Sgabeblack@google.comvoid
50412958Sgabeblack@google.comnext_trigger(const sc_event &e)
50512837Sgabeblack@google.com{
50612958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
50713206Sgabeblack@google.com    p->cancelTimeout();
50813207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEvent(p, &e);
50912837Sgabeblack@google.com}
51012837Sgabeblack@google.com
51112837Sgabeblack@google.comvoid
51212958Sgabeblack@google.comnext_trigger(const sc_event_or_list &eol)
51312837Sgabeblack@google.com{
51412958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
51513206Sgabeblack@google.com    p->cancelTimeout();
51613207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
51712837Sgabeblack@google.com}
51812837Sgabeblack@google.com
51912837Sgabeblack@google.comvoid
52012958Sgabeblack@google.comnext_trigger(const sc_event_and_list &eal)
52112837Sgabeblack@google.com{
52212958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
52313206Sgabeblack@google.com    p->cancelTimeout();
52413207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
52512837Sgabeblack@google.com}
52612837Sgabeblack@google.com
52712837Sgabeblack@google.comvoid
52812958Sgabeblack@google.comnext_trigger(const sc_time &t)
52912837Sgabeblack@google.com{
53012958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
53113206Sgabeblack@google.com    p->setTimeout(t);
53213206Sgabeblack@google.com    p->clearDynamic();
53312837Sgabeblack@google.com}
53412837Sgabeblack@google.com
53512837Sgabeblack@google.comvoid
53612951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u)
53712837Sgabeblack@google.com{
53812951Sgabeblack@google.com    next_trigger(sc_time(d, u));
53912837Sgabeblack@google.com}
54012837Sgabeblack@google.com
54112837Sgabeblack@google.comvoid
54212958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event &e)
54312837Sgabeblack@google.com{
54412958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
54513206Sgabeblack@google.com    p->setTimeout(t);
54613207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEvent(p, &e);
54712837Sgabeblack@google.com}
54812837Sgabeblack@google.com
54912837Sgabeblack@google.comvoid
55012951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event &e)
55112837Sgabeblack@google.com{
55212951Sgabeblack@google.com    next_trigger(sc_time(d, u), e);
55312837Sgabeblack@google.com}
55412837Sgabeblack@google.com
55512837Sgabeblack@google.comvoid
55612958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event_or_list &eol)
55712837Sgabeblack@google.com{
55812958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
55913206Sgabeblack@google.com    p->setTimeout(t);
56013207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
56112837Sgabeblack@google.com}
56212837Sgabeblack@google.com
56312837Sgabeblack@google.comvoid
56412951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event_or_list &eol)
56512837Sgabeblack@google.com{
56612951Sgabeblack@google.com    next_trigger(sc_time(d, u), eol);
56712837Sgabeblack@google.com}
56812837Sgabeblack@google.com
56912837Sgabeblack@google.comvoid
57012958Sgabeblack@google.comnext_trigger(const sc_time &t, const sc_event_and_list &eal)
57112837Sgabeblack@google.com{
57212958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
57313206Sgabeblack@google.com    p->setTimeout(t);
57413207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
57512837Sgabeblack@google.com}
57612837Sgabeblack@google.com
57712837Sgabeblack@google.comvoid
57812951Sgabeblack@google.comnext_trigger(double d, sc_time_unit u, const sc_event_and_list &eal)
57912837Sgabeblack@google.com{
58012951Sgabeblack@google.com    next_trigger(sc_time(d, u), eal);
58112837Sgabeblack@google.com}
58212837Sgabeblack@google.com
58312929Sgabeblack@google.combool
58412929Sgabeblack@google.comtimed_out()
58512929Sgabeblack@google.com{
58613189Sgabeblack@google.com    ::sc_gem5::Process *p = sc_gem5::scheduler.current();
58713189Sgabeblack@google.com    if (!p)
58813189Sgabeblack@google.com        return false;
58913189Sgabeblack@google.com    else
59013189Sgabeblack@google.com        return p->timedOut();
59112929Sgabeblack@google.com}
59212929Sgabeblack@google.com
59312837Sgabeblack@google.com
59413248Sgabeblack@google.comnamespace
59513248Sgabeblack@google.com{
59613248Sgabeblack@google.com
59713248Sgabeblack@google.combool
59813248Sgabeblack@google.comwaitErrorCheck(sc_gem5::Process *p)
59913248Sgabeblack@google.com{
60013248Sgabeblack@google.com    if (p->procKind() == SC_METHOD_PROC_) {
60113248Sgabeblack@google.com        SC_REPORT_ERROR(
60213248Sgabeblack@google.com                "(E519) wait() is only allowed in SC_THREADs and SC_CTHREADs",
60313248Sgabeblack@google.com                "\n        in SC_METHODs use next_trigger() instead");
60413248Sgabeblack@google.com        return true;
60513248Sgabeblack@google.com    }
60613248Sgabeblack@google.com    return false;
60713248Sgabeblack@google.com}
60813248Sgabeblack@google.com
60913248Sgabeblack@google.com} // anonymous namespace
61013248Sgabeblack@google.com
61112837Sgabeblack@google.comvoid
61212837Sgabeblack@google.comwait()
61312837Sgabeblack@google.com{
61412958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
61513248Sgabeblack@google.com    if (waitErrorCheck(p))
61613248Sgabeblack@google.com        return;
61713206Sgabeblack@google.com    p->cancelTimeout();
61813206Sgabeblack@google.com    p->clearDynamic();
61912958Sgabeblack@google.com    sc_gem5::scheduler.yield();
62012837Sgabeblack@google.com}
62112837Sgabeblack@google.com
62212837Sgabeblack@google.comvoid
62312958Sgabeblack@google.comwait(int n)
62412837Sgabeblack@google.com{
62513146Sgabeblack@google.com    if (n <= 0) {
62613146Sgabeblack@google.com        std::string msg = csprintf("n = %d", n);
62713146Sgabeblack@google.com        SC_REPORT_ERROR("(E525) wait(n) is only valid for n > 0", msg.c_str());
62813146Sgabeblack@google.com    }
62912958Sgabeblack@google.com    for (int i = 0; i < n; i++)
63012958Sgabeblack@google.com        wait();
63112837Sgabeblack@google.com}
63212837Sgabeblack@google.com
63312837Sgabeblack@google.comvoid
63412958Sgabeblack@google.comwait(const sc_event &e)
63512837Sgabeblack@google.com{
63612958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
63713248Sgabeblack@google.com    if (waitErrorCheck(p))
63813248Sgabeblack@google.com        return;
63913206Sgabeblack@google.com    p->cancelTimeout();
64013207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEvent(p, &e);
64112958Sgabeblack@google.com    sc_gem5::scheduler.yield();
64212837Sgabeblack@google.com}
64312837Sgabeblack@google.com
64412837Sgabeblack@google.comvoid
64512958Sgabeblack@google.comwait(const sc_event_or_list &eol)
64612837Sgabeblack@google.com{
64712958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
64813248Sgabeblack@google.com    if (waitErrorCheck(p))
64913248Sgabeblack@google.com        return;
65013206Sgabeblack@google.com    p->cancelTimeout();
65113207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
65212958Sgabeblack@google.com    sc_gem5::scheduler.yield();
65312837Sgabeblack@google.com}
65412837Sgabeblack@google.com
65512837Sgabeblack@google.comvoid
65612958Sgabeblack@google.comwait(const sc_event_and_list &eal)
65712837Sgabeblack@google.com{
65812958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
65913248Sgabeblack@google.com    if (waitErrorCheck(p))
66013248Sgabeblack@google.com        return;
66113206Sgabeblack@google.com    p->cancelTimeout();
66213207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
66312958Sgabeblack@google.com    sc_gem5::scheduler.yield();
66412837Sgabeblack@google.com}
66512837Sgabeblack@google.com
66612837Sgabeblack@google.comvoid
66712958Sgabeblack@google.comwait(const sc_time &t)
66812837Sgabeblack@google.com{
66912958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
67013248Sgabeblack@google.com    if (waitErrorCheck(p))
67113248Sgabeblack@google.com        return;
67213206Sgabeblack@google.com    p->setTimeout(t);
67313206Sgabeblack@google.com    p->clearDynamic();
67412958Sgabeblack@google.com    sc_gem5::scheduler.yield();
67512837Sgabeblack@google.com}
67612837Sgabeblack@google.com
67712837Sgabeblack@google.comvoid
67812951Sgabeblack@google.comwait(double d, sc_time_unit u)
67912837Sgabeblack@google.com{
68012951Sgabeblack@google.com    wait(sc_time(d, u));
68112837Sgabeblack@google.com}
68212837Sgabeblack@google.com
68312837Sgabeblack@google.comvoid
68412958Sgabeblack@google.comwait(const sc_time &t, const sc_event &e)
68512837Sgabeblack@google.com{
68612958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
68713248Sgabeblack@google.com    if (waitErrorCheck(p))
68813248Sgabeblack@google.com        return;
68913206Sgabeblack@google.com    p->setTimeout(t);
69013207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEvent(p, &e);
69112958Sgabeblack@google.com    sc_gem5::scheduler.yield();
69212837Sgabeblack@google.com}
69312837Sgabeblack@google.com
69412837Sgabeblack@google.comvoid
69512951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event &e)
69612837Sgabeblack@google.com{
69712951Sgabeblack@google.com    wait(sc_time(d, u), e);
69812837Sgabeblack@google.com}
69912837Sgabeblack@google.com
70012837Sgabeblack@google.comvoid
70112958Sgabeblack@google.comwait(const sc_time &t, const sc_event_or_list &eol)
70212837Sgabeblack@google.com{
70312958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
70413248Sgabeblack@google.com    if (waitErrorCheck(p))
70513248Sgabeblack@google.com        return;
70613206Sgabeblack@google.com    p->setTimeout(t);
70713207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol);
70812958Sgabeblack@google.com    sc_gem5::scheduler.yield();
70912837Sgabeblack@google.com}
71012837Sgabeblack@google.com
71112837Sgabeblack@google.comvoid
71212951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event_or_list &eol)
71312837Sgabeblack@google.com{
71412951Sgabeblack@google.com    wait(sc_time(d, u), eol);
71512837Sgabeblack@google.com}
71612837Sgabeblack@google.com
71712837Sgabeblack@google.comvoid
71812958Sgabeblack@google.comwait(const sc_time &t, const sc_event_and_list &eal)
71912837Sgabeblack@google.com{
72012958Sgabeblack@google.com    sc_gem5::Process *p = sc_gem5::scheduler.current();
72113248Sgabeblack@google.com    if (waitErrorCheck(p))
72213248Sgabeblack@google.com        return;
72313206Sgabeblack@google.com    p->setTimeout(t);
72413207Sgabeblack@google.com    ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal);
72512958Sgabeblack@google.com    sc_gem5::scheduler.yield();
72612837Sgabeblack@google.com}
72712837Sgabeblack@google.com
72812837Sgabeblack@google.comvoid
72912951Sgabeblack@google.comwait(double d, sc_time_unit u, const sc_event_and_list &eal)
73012837Sgabeblack@google.com{
73112951Sgabeblack@google.com    wait(sc_time(d, u), eal);
73212837Sgabeblack@google.com}
73312837Sgabeblack@google.com
73412909Sgabeblack@google.comvoid
73512909Sgabeblack@google.comhalt()
73612909Sgabeblack@google.com{
73713175Sgabeblack@google.com    ::sc_core::wait();
73813175Sgabeblack@google.com    throw ::sc_gem5::ScHalt();
73912909Sgabeblack@google.com}
74012909Sgabeblack@google.com
74112914Sgabeblack@google.comvoid
74213155Sgabeblack@google.comat_posedge(const sc_signal_in_if<bool> &s)
74312914Sgabeblack@google.com{
74413155Sgabeblack@google.com    while (s.read())
74513155Sgabeblack@google.com        wait();
74613155Sgabeblack@google.com    while (!s.read())
74713155Sgabeblack@google.com        wait();
74812914Sgabeblack@google.com}
74912914Sgabeblack@google.com
75012914Sgabeblack@google.comvoid
75113155Sgabeblack@google.comat_posedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
75212914Sgabeblack@google.com{
75313155Sgabeblack@google.com    while (s.read() == sc_dt::Log_1)
75413155Sgabeblack@google.com        wait();
75513155Sgabeblack@google.com    while (s.read() == sc_dt::Log_0)
75613155Sgabeblack@google.com        wait();
75712914Sgabeblack@google.com}
75812914Sgabeblack@google.com
75912914Sgabeblack@google.comvoid
76013155Sgabeblack@google.comat_negedge(const sc_signal_in_if<bool> &s)
76112914Sgabeblack@google.com{
76213155Sgabeblack@google.com    while (!s.read())
76313155Sgabeblack@google.com        wait();
76413155Sgabeblack@google.com    while (s.read())
76513155Sgabeblack@google.com        wait();
76612914Sgabeblack@google.com}
76712914Sgabeblack@google.com
76812914Sgabeblack@google.comvoid
76913155Sgabeblack@google.comat_negedge(const sc_signal_in_if<sc_dt::sc_logic> &s)
77012914Sgabeblack@google.com{
77113155Sgabeblack@google.com    while (s.read() == sc_dt::Log_0)
77213155Sgabeblack@google.com        wait();
77313155Sgabeblack@google.com    while (s.read() == sc_dt::Log_1)
77413155Sgabeblack@google.com        wait();
77512914Sgabeblack@google.com}
77612914Sgabeblack@google.com
77712837Sgabeblack@google.comconst char *
77813035Sgabeblack@google.comsc_gen_unique_name(const char *seed)
77912837Sgabeblack@google.com{
78013035Sgabeblack@google.com    ::sc_gem5::Module *mod = ::sc_gem5::currentModule();
78113035Sgabeblack@google.com    return mod ? mod->uniqueName(seed) :
78213035Sgabeblack@google.com        ::sc_gem5::nameGen.gen(seed);
78312837Sgabeblack@google.com}
78412837Sgabeblack@google.com
78512837Sgabeblack@google.combool
78612930Sgabeblack@google.comsc_hierarchical_name_exists(const char *name)
78712930Sgabeblack@google.com{
78812930Sgabeblack@google.com    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
78912930Sgabeblack@google.com    return false;
79012930Sgabeblack@google.com}
79112930Sgabeblack@google.com
79212930Sgabeblack@google.combool
79312837Sgabeblack@google.comsc_start_of_simulation_invoked()
79412837Sgabeblack@google.com{
79512982Sgabeblack@google.com    return ::sc_gem5::kernel->startOfSimulationComplete();
79612837Sgabeblack@google.com}
79712837Sgabeblack@google.com
79812837Sgabeblack@google.combool
79912837Sgabeblack@google.comsc_end_of_simulation_invoked()
80012837Sgabeblack@google.com{
80112982Sgabeblack@google.com    return ::sc_gem5::kernel->endOfSimulationComplete();
80212837Sgabeblack@google.com}
80312837Sgabeblack@google.com
80412901Sgabeblack@google.comsc_module *
80512901Sgabeblack@google.comsc_module_sc_new(sc_module *mod)
80612901Sgabeblack@google.com{
80712901Sgabeblack@google.com    static std::vector<std::unique_ptr<sc_module> > modules;
80812901Sgabeblack@google.com    modules.emplace_back(mod);
80912901Sgabeblack@google.com    return mod;
81012901Sgabeblack@google.com}
81112901Sgabeblack@google.com
81212837Sgabeblack@google.com} // namespace sc_core
813