process.hh revision 13196
112952Sgabeblack@google.com/*
212952Sgabeblack@google.com * Copyright 2018 Google, Inc.
312952Sgabeblack@google.com *
412952Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
512952Sgabeblack@google.com * modification, are permitted provided that the following conditions are
612952Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
712952Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
812952Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
912952Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1012952Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1112952Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1212952Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1312952Sgabeblack@google.com * this software without specific prior written permission.
1412952Sgabeblack@google.com *
1512952Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612952Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712952Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812952Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912952Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012952Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112952Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212952Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312952Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412952Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512952Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612952Sgabeblack@google.com *
2712952Sgabeblack@google.com * Authors: Gabe Black
2812952Sgabeblack@google.com */
2912952Sgabeblack@google.com
3012952Sgabeblack@google.com#ifndef __SYSTEMC_CORE_PROCESS_HH__
3112952Sgabeblack@google.com#define __SYSTEMC_CORE_PROCESS_HH__
3212952Sgabeblack@google.com
3312952Sgabeblack@google.com#include <functional>
3412997Sgabeblack@google.com#include <memory>
3512957Sgabeblack@google.com#include <vector>
3612952Sgabeblack@google.com
3712952Sgabeblack@google.com#include "base/fiber.hh"
3812957Sgabeblack@google.com#include "sim/eventq.hh"
3912957Sgabeblack@google.com#include "systemc/core/bindinfo.hh"
4013132Sgabeblack@google.com#include "systemc/core/event.hh"
4112953Sgabeblack@google.com#include "systemc/core/list.hh"
4212952Sgabeblack@google.com#include "systemc/core/object.hh"
4313063Sgabeblack@google.com#include "systemc/core/sched_event.hh"
4412952Sgabeblack@google.com#include "systemc/ext/core/sc_event.hh"
4512991Sgabeblack@google.com#include "systemc/ext/core/sc_export.hh"
4612957Sgabeblack@google.com#include "systemc/ext/core/sc_interface.hh"
4712952Sgabeblack@google.com#include "systemc/ext/core/sc_module.hh"
4812957Sgabeblack@google.com#include "systemc/ext/core/sc_port.hh"
4912952Sgabeblack@google.com#include "systemc/ext/core/sc_process_handle.hh"
5012997Sgabeblack@google.com#include "systemc/ext/utils/sc_report.hh"
5112952Sgabeblack@google.com
5213196Sgabeblack@google.comnamespace sc_core
5313196Sgabeblack@google.com{
5413196Sgabeblack@google.com
5513196Sgabeblack@google.comclass sc_join;
5613196Sgabeblack@google.com
5713196Sgabeblack@google.com} // namespace sc_core
5813196Sgabeblack@google.com
5912952Sgabeblack@google.comnamespace sc_gem5
6012952Sgabeblack@google.com{
6112952Sgabeblack@google.com
6213175Sgabeblack@google.comclass ScHalt
6313175Sgabeblack@google.com{};
6413175Sgabeblack@google.com
6512957Sgabeblack@google.comclass Sensitivity
6612957Sgabeblack@google.com{
6712957Sgabeblack@google.com  protected:
6812957Sgabeblack@google.com    Process *process;
6912957Sgabeblack@google.com
7012957Sgabeblack@google.com  public:
7112957Sgabeblack@google.com    Sensitivity(Process *p) : process(p) {}
7212957Sgabeblack@google.com    virtual ~Sensitivity() {}
7312957Sgabeblack@google.com
7413189Sgabeblack@google.com    void satisfy(bool timedOut=false);
7513189Sgabeblack@google.com
7613189Sgabeblack@google.com    virtual void notifyWork(Event *e) { satisfy(); }
7712957Sgabeblack@google.com    void notify(Event *e);
7812957Sgabeblack@google.com    void notify() { notify(nullptr); }
7912957Sgabeblack@google.com
8012957Sgabeblack@google.com    const std::string name();
8112957Sgabeblack@google.com};
8212957Sgabeblack@google.com
8312957Sgabeblack@google.comclass SensitivityTimeout : virtual public Sensitivity
8412957Sgabeblack@google.com{
8512957Sgabeblack@google.com  private:
8612962Sgabeblack@google.com    void timeout();
8713063Sgabeblack@google.com    ScEvent timeoutEvent;
8812957Sgabeblack@google.com
8912957Sgabeblack@google.com  public:
9012957Sgabeblack@google.com    SensitivityTimeout(Process *p, ::sc_core::sc_time t);
9112957Sgabeblack@google.com    ~SensitivityTimeout();
9212957Sgabeblack@google.com};
9312957Sgabeblack@google.com
9412957Sgabeblack@google.comclass SensitivityEvent : virtual public Sensitivity
9512957Sgabeblack@google.com{
9612957Sgabeblack@google.com  private:
9712957Sgabeblack@google.com    const ::sc_core::sc_event *event;
9812957Sgabeblack@google.com
9912957Sgabeblack@google.com  public:
10012957Sgabeblack@google.com    SensitivityEvent(Process *p, const ::sc_core::sc_event *e);
10112957Sgabeblack@google.com    ~SensitivityEvent();
10212957Sgabeblack@google.com};
10312957Sgabeblack@google.com
10412957Sgabeblack@google.com//XXX This sensitivity can't be reused. To reset it, it has to be deleted and
10512957Sgabeblack@google.com//recreated. That works for dynamic sensitivities, but not for static.
10612957Sgabeblack@google.com//Fortunately processes can't be statically sensitive to sc_event_and_lists.
10712957Sgabeblack@google.comclass SensitivityEventAndList : virtual public Sensitivity
10812957Sgabeblack@google.com{
10912957Sgabeblack@google.com  private:
11012957Sgabeblack@google.com    const ::sc_core::sc_event_and_list *list;
11112957Sgabeblack@google.com    int count;
11212957Sgabeblack@google.com
11312957Sgabeblack@google.com  public:
11412957Sgabeblack@google.com    SensitivityEventAndList(
11512957Sgabeblack@google.com            Process *p, const ::sc_core::sc_event_and_list *list);
11612957Sgabeblack@google.com    ~SensitivityEventAndList();
11712957Sgabeblack@google.com
11812962Sgabeblack@google.com    void notifyWork(Event *e) override;
11912957Sgabeblack@google.com};
12012957Sgabeblack@google.com
12112957Sgabeblack@google.comclass SensitivityEventOrList : virtual public Sensitivity
12212957Sgabeblack@google.com{
12312957Sgabeblack@google.com  private:
12412957Sgabeblack@google.com    const ::sc_core::sc_event_or_list *list;
12512957Sgabeblack@google.com
12612957Sgabeblack@google.com  public:
12712957Sgabeblack@google.com    SensitivityEventOrList(
12812957Sgabeblack@google.com            Process *p, const ::sc_core::sc_event_or_list *list);
12912957Sgabeblack@google.com    ~SensitivityEventOrList();
13012957Sgabeblack@google.com};
13112957Sgabeblack@google.com
13212957Sgabeblack@google.com// Combined sensitivities. These trigger when any of their parts do.
13312957Sgabeblack@google.com
13412957Sgabeblack@google.comclass SensitivityTimeoutAndEvent :
13512957Sgabeblack@google.com    public SensitivityTimeout, public SensitivityEvent
13612957Sgabeblack@google.com{
13712957Sgabeblack@google.com  public:
13812957Sgabeblack@google.com    SensitivityTimeoutAndEvent(
13912957Sgabeblack@google.com            Process *p, ::sc_core::sc_time t, const ::sc_core::sc_event *e) :
14012957Sgabeblack@google.com        Sensitivity(p), SensitivityTimeout(p, t), SensitivityEvent(p, e)
14112957Sgabeblack@google.com    {}
14213189Sgabeblack@google.com
14313189Sgabeblack@google.com    void notifyWork(Event *e) override { satisfy(e == nullptr); }
14412957Sgabeblack@google.com};
14512957Sgabeblack@google.com
14612957Sgabeblack@google.comclass SensitivityTimeoutAndEventAndList :
14712957Sgabeblack@google.com    public SensitivityTimeout, public SensitivityEventAndList
14812957Sgabeblack@google.com{
14912957Sgabeblack@google.com  public:
15012957Sgabeblack@google.com    SensitivityTimeoutAndEventAndList(
15112957Sgabeblack@google.com            Process *p, ::sc_core::sc_time t,
15212957Sgabeblack@google.com            const ::sc_core::sc_event_and_list *eal) :
15312957Sgabeblack@google.com        Sensitivity(p), SensitivityTimeout(p, t),
15412957Sgabeblack@google.com        SensitivityEventAndList(p, eal)
15512957Sgabeblack@google.com    {}
15613075Sgabeblack@google.com
15713075Sgabeblack@google.com    void notifyWork(Event *e) override;
15812957Sgabeblack@google.com};
15912957Sgabeblack@google.com
16012957Sgabeblack@google.comclass SensitivityTimeoutAndEventOrList :
16112957Sgabeblack@google.com    public SensitivityTimeout, public SensitivityEventOrList
16212957Sgabeblack@google.com{
16312957Sgabeblack@google.com  public:
16412957Sgabeblack@google.com    SensitivityTimeoutAndEventOrList(
16512957Sgabeblack@google.com            Process *p, ::sc_core::sc_time t,
16612957Sgabeblack@google.com            const ::sc_core::sc_event_or_list *eol) :
16712957Sgabeblack@google.com        Sensitivity(p), SensitivityTimeout(p, t),
16812957Sgabeblack@google.com        SensitivityEventOrList(p, eol)
16912957Sgabeblack@google.com    {}
17013189Sgabeblack@google.com
17113189Sgabeblack@google.com    void notifyWork(Event *e) override { satisfy(e == nullptr); }
17212957Sgabeblack@google.com};
17312957Sgabeblack@google.com
17412957Sgabeblack@google.comtypedef std::vector<Sensitivity *> Sensitivities;
17512957Sgabeblack@google.com
17612957Sgabeblack@google.com
17712957Sgabeblack@google.com/*
17812957Sgabeblack@google.com * Pending sensitivities. These are records of sensitivities to install later,
17912957Sgabeblack@google.com * once all the information to configure them is available.
18012957Sgabeblack@google.com */
18112957Sgabeblack@google.com
18212957Sgabeblack@google.comclass PendingSensitivity
18312957Sgabeblack@google.com{
18412957Sgabeblack@google.com  protected:
18512957Sgabeblack@google.com    Process *process;
18612957Sgabeblack@google.com
18712957Sgabeblack@google.com  public:
18812957Sgabeblack@google.com    virtual void finalize(Sensitivities &s) = 0;
18912957Sgabeblack@google.com    PendingSensitivity(Process *p) : process(p) {}
19012957Sgabeblack@google.com    virtual ~PendingSensitivity() {}
19112957Sgabeblack@google.com};
19212957Sgabeblack@google.com
19312957Sgabeblack@google.comclass PendingSensitivityEvent : public PendingSensitivity
19412957Sgabeblack@google.com{
19512957Sgabeblack@google.com  private:
19612957Sgabeblack@google.com    const sc_core::sc_event *event;
19712957Sgabeblack@google.com
19812957Sgabeblack@google.com  public:
19912957Sgabeblack@google.com    PendingSensitivityEvent(Process *p, const sc_core::sc_event *e) :
20012957Sgabeblack@google.com        PendingSensitivity(p), event(e) {}
20112957Sgabeblack@google.com
20212957Sgabeblack@google.com    void
20312957Sgabeblack@google.com    finalize(Sensitivities &s) override
20412957Sgabeblack@google.com    {
20512957Sgabeblack@google.com        s.push_back(new SensitivityEvent(process, event));
20612957Sgabeblack@google.com    }
20712957Sgabeblack@google.com};
20812957Sgabeblack@google.com
20912957Sgabeblack@google.comclass PendingSensitivityInterface : public PendingSensitivity
21012957Sgabeblack@google.com{
21112957Sgabeblack@google.com  private:
21212957Sgabeblack@google.com    const sc_core::sc_interface *interface;
21312957Sgabeblack@google.com
21412957Sgabeblack@google.com  public:
21512957Sgabeblack@google.com    PendingSensitivityInterface(Process *p, const sc_core::sc_interface *i) :
21612957Sgabeblack@google.com        PendingSensitivity(p), interface(i)
21712957Sgabeblack@google.com    {}
21812957Sgabeblack@google.com
21912957Sgabeblack@google.com    void
22012957Sgabeblack@google.com    finalize(Sensitivities &s) override
22112957Sgabeblack@google.com    {
22212957Sgabeblack@google.com        s.push_back(new SensitivityEvent(process,
22312957Sgabeblack@google.com                                         &interface->default_event()));
22412957Sgabeblack@google.com    }
22512957Sgabeblack@google.com};
22612957Sgabeblack@google.com
22712957Sgabeblack@google.comclass PendingSensitivityPort : public PendingSensitivity
22812957Sgabeblack@google.com{
22912957Sgabeblack@google.com  private:
23012957Sgabeblack@google.com    const sc_core::sc_port_base *port;
23112957Sgabeblack@google.com
23212957Sgabeblack@google.com  public:
23312957Sgabeblack@google.com    PendingSensitivityPort(Process *p, const sc_core::sc_port_base *pb) :
23412957Sgabeblack@google.com        PendingSensitivity(p), port(pb)
23512957Sgabeblack@google.com    {}
23612957Sgabeblack@google.com
23712957Sgabeblack@google.com    void
23812957Sgabeblack@google.com    finalize(Sensitivities &s) override
23912957Sgabeblack@google.com    {
24012957Sgabeblack@google.com        for (int i = 0; i < port->size(); i++) {
24112957Sgabeblack@google.com            const ::sc_core::sc_event *e =
24213053Sgabeblack@google.com                &port->_gem5Interface(i)->default_event();
24312957Sgabeblack@google.com            s.push_back(new SensitivityEvent(process, e));
24412957Sgabeblack@google.com        }
24512957Sgabeblack@google.com    }
24612957Sgabeblack@google.com};
24712957Sgabeblack@google.com
24812991Sgabeblack@google.comclass PendingSensitivityExport : public PendingSensitivity
24912991Sgabeblack@google.com{
25012991Sgabeblack@google.com  private:
25112991Sgabeblack@google.com    const sc_core::sc_export_base *exp;
25212991Sgabeblack@google.com
25312991Sgabeblack@google.com  public:
25412991Sgabeblack@google.com    PendingSensitivityExport(Process *p, const sc_core::sc_export_base *exp) :
25512991Sgabeblack@google.com        PendingSensitivity(p), exp(exp)
25612991Sgabeblack@google.com    {}
25712991Sgabeblack@google.com
25812991Sgabeblack@google.com    void
25912991Sgabeblack@google.com    finalize(Sensitivities &s) override
26012991Sgabeblack@google.com    {
26112991Sgabeblack@google.com        s.push_back(new SensitivityEvent(process,
26212991Sgabeblack@google.com                    &exp->get_interface()->default_event()));
26312991Sgabeblack@google.com    }
26412991Sgabeblack@google.com};
26512991Sgabeblack@google.com
26612957Sgabeblack@google.comclass PendingSensitivityFinder : public PendingSensitivity
26712957Sgabeblack@google.com{
26812957Sgabeblack@google.com  private:
26912957Sgabeblack@google.com    const sc_core::sc_event_finder *finder;
27012957Sgabeblack@google.com
27112957Sgabeblack@google.com  public:
27212957Sgabeblack@google.com    PendingSensitivityFinder(Process *p, const sc_core::sc_event_finder *f) :
27312957Sgabeblack@google.com        PendingSensitivity(p), finder(f)
27412957Sgabeblack@google.com    {}
27512957Sgabeblack@google.com
27612957Sgabeblack@google.com    void
27712957Sgabeblack@google.com    finalize(Sensitivities &s) override
27812957Sgabeblack@google.com    {
27913132Sgabeblack@google.com        const ::sc_core::sc_port_base *port = finder->port();
28013132Sgabeblack@google.com        int size = port->size();
28113132Sgabeblack@google.com        for (int i = 0; i < size; i++) {
28213132Sgabeblack@google.com            ::sc_core::sc_interface *interface = port->_gem5Interface(i);
28313132Sgabeblack@google.com            const ::sc_core::sc_event *event = &finder->find_event(interface);
28413132Sgabeblack@google.com            s.push_back(new SensitivityEvent(process, event));
28513132Sgabeblack@google.com        }
28612957Sgabeblack@google.com    }
28712957Sgabeblack@google.com};
28812957Sgabeblack@google.com
28912957Sgabeblack@google.comtypedef std::vector<PendingSensitivity *> PendingSensitivities;
29012957Sgabeblack@google.com
29112957Sgabeblack@google.com
29213087Sgabeblack@google.comclass Process : public ::sc_core::sc_process_b, public ListNode
29312952Sgabeblack@google.com{
29412952Sgabeblack@google.com  public:
29512952Sgabeblack@google.com    virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
29612961Sgabeblack@google.com    bool needsStart() const { return _needsStart; }
29713093Sgabeblack@google.com    void needsStart(bool ns) { _needsStart = ns; }
29812952Sgabeblack@google.com    bool dynamic() const { return _dynamic; }
29912952Sgabeblack@google.com    bool isUnwinding() const { return _isUnwinding; }
30012997Sgabeblack@google.com    void isUnwinding(bool v) { _isUnwinding = v; }
30112952Sgabeblack@google.com    bool terminated() const { return _terminated; }
30212952Sgabeblack@google.com
30312952Sgabeblack@google.com    void forEachKid(const std::function<void(Process *)> &work);
30412952Sgabeblack@google.com
30512952Sgabeblack@google.com    bool suspended() const { return _suspended; }
30612952Sgabeblack@google.com    bool disabled() const { return _disabled; }
30712952Sgabeblack@google.com
30812952Sgabeblack@google.com    void suspend(bool inc_kids);
30912952Sgabeblack@google.com    void resume(bool inc_kids);
31012952Sgabeblack@google.com    void disable(bool inc_kids);
31112952Sgabeblack@google.com    void enable(bool inc_kids);
31212952Sgabeblack@google.com
31312952Sgabeblack@google.com    void kill(bool inc_kids);
31412952Sgabeblack@google.com    void reset(bool inc_kids);
31512952Sgabeblack@google.com    virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids);
31612952Sgabeblack@google.com
31712952Sgabeblack@google.com    void injectException(ExceptionWrapperBase &exc);
31812952Sgabeblack@google.com    ExceptionWrapperBase *excWrapper;
31912952Sgabeblack@google.com
32012952Sgabeblack@google.com    void syncResetOn(bool inc_kids);
32112952Sgabeblack@google.com    void syncResetOff(bool inc_kids);
32212952Sgabeblack@google.com
32312952Sgabeblack@google.com    void incref() { refCount++; }
32412952Sgabeblack@google.com    void decref() { refCount--; }
32512952Sgabeblack@google.com
32612952Sgabeblack@google.com    const ::sc_core::sc_event &resetEvent() { return _resetEvent; }
32712952Sgabeblack@google.com    const ::sc_core::sc_event &terminatedEvent() { return _terminatedEvent; }
32812952Sgabeblack@google.com
32912953Sgabeblack@google.com    void setStackSize(size_t size) { stackSize = size; }
33012953Sgabeblack@google.com
33112957Sgabeblack@google.com    void finalize();
33212957Sgabeblack@google.com
33312953Sgabeblack@google.com    void run();
33412953Sgabeblack@google.com
33512957Sgabeblack@google.com    void addStatic(PendingSensitivity *);
33612957Sgabeblack@google.com    void setDynamic(Sensitivity *);
33712957Sgabeblack@google.com
33812959Sgabeblack@google.com    void satisfySensitivity(Sensitivity *);
33912959Sgabeblack@google.com
34012959Sgabeblack@google.com    void ready();
34112959Sgabeblack@google.com
34212953Sgabeblack@google.com    virtual Fiber *fiber() { return Fiber::primaryFiber(); }
34312953Sgabeblack@google.com
34412953Sgabeblack@google.com    static Process *newest() { return _newest; }
34512953Sgabeblack@google.com
34612997Sgabeblack@google.com    void lastReport(::sc_core::sc_report *report);
34712997Sgabeblack@google.com    ::sc_core::sc_report *lastReport() const;
34812997Sgabeblack@google.com
34913180Sgabeblack@google.com    bool hasStaticSensitivities() { return !staticSensitivities.empty(); }
35013180Sgabeblack@google.com    bool internal() { return _internal; }
35113189Sgabeblack@google.com    bool timedOut() { return _timedOut; }
35213189Sgabeblack@google.com    void timedOut(bool to) { _timedOut = to; }
35313180Sgabeblack@google.com
35413194Sgabeblack@google.com    bool dontInitialize() { return _dontInitialize; }
35513194Sgabeblack@google.com    void dontInitialize(bool di) { _dontInitialize = di; }
35613194Sgabeblack@google.com
35713196Sgabeblack@google.com    void joinWait(::sc_core::sc_join *join) { joinWaiters.push_back(join); }
35813196Sgabeblack@google.com
35912952Sgabeblack@google.com  protected:
36013180Sgabeblack@google.com    Process(const char *name, ProcessFuncWrapper *func, bool internal=false);
36112953Sgabeblack@google.com
36212953Sgabeblack@google.com    static Process *_newest;
36312952Sgabeblack@google.com
36412957Sgabeblack@google.com    virtual ~Process()
36512957Sgabeblack@google.com    {
36613072Sgabeblack@google.com        popListNode();
36712957Sgabeblack@google.com        delete func;
36812957Sgabeblack@google.com        for (auto s: staticSensitivities)
36912957Sgabeblack@google.com            delete s;
37012957Sgabeblack@google.com    }
37112952Sgabeblack@google.com
37212952Sgabeblack@google.com    ::sc_core::sc_event _resetEvent;
37312952Sgabeblack@google.com    ::sc_core::sc_event _terminatedEvent;
37412952Sgabeblack@google.com
37512952Sgabeblack@google.com    ProcessFuncWrapper *func;
37612952Sgabeblack@google.com    sc_core::sc_curr_proc_kind _procKind;
37713180Sgabeblack@google.com
37813180Sgabeblack@google.com    bool _internal;
37913180Sgabeblack@google.com
38013189Sgabeblack@google.com    // Needed to support the deprecated "timed_out" function.
38113189Sgabeblack@google.com    bool _timedOut;
38213189Sgabeblack@google.com
38313194Sgabeblack@google.com    bool _dontInitialize;
38413194Sgabeblack@google.com
38512961Sgabeblack@google.com    bool _needsStart;
38612952Sgabeblack@google.com    bool _dynamic;
38712952Sgabeblack@google.com    bool _isUnwinding;
38812952Sgabeblack@google.com    bool _terminated;
38912952Sgabeblack@google.com
39012998Sgabeblack@google.com    void terminate();
39112998Sgabeblack@google.com
39212952Sgabeblack@google.com    bool _suspended;
39312959Sgabeblack@google.com    bool _suspendedReady;
39412952Sgabeblack@google.com    bool _disabled;
39512952Sgabeblack@google.com
39612952Sgabeblack@google.com    bool _syncReset;
39712952Sgabeblack@google.com
39812952Sgabeblack@google.com    int refCount;
39912952Sgabeblack@google.com
40012953Sgabeblack@google.com    size_t stackSize;
40112957Sgabeblack@google.com
40212957Sgabeblack@google.com    Sensitivities staticSensitivities;
40312957Sgabeblack@google.com    PendingSensitivities pendingStaticSensitivities;
40412957Sgabeblack@google.com
40512957Sgabeblack@google.com    Sensitivity *dynamicSensitivity;
40612997Sgabeblack@google.com
40712997Sgabeblack@google.com    std::unique_ptr<::sc_core::sc_report> _lastReport;
40813196Sgabeblack@google.com
40913196Sgabeblack@google.com    std::vector<::sc_core::sc_join *> joinWaiters;
41012952Sgabeblack@google.com};
41112952Sgabeblack@google.com
41212957Sgabeblack@google.cominline void
41313189Sgabeblack@google.comSensitivity::satisfy(bool timedOut)
41412959Sgabeblack@google.com{
41513189Sgabeblack@google.com    process->timedOut(timedOut);
41612959Sgabeblack@google.com    process->satisfySensitivity(this);
41712959Sgabeblack@google.com}
41812959Sgabeblack@google.com
41912959Sgabeblack@google.cominline void
42012957Sgabeblack@google.comSensitivity::notify(Event *e)
42112957Sgabeblack@google.com{
42212957Sgabeblack@google.com    if (!process->disabled())
42312957Sgabeblack@google.com        notifyWork(e);
42412957Sgabeblack@google.com}
42512957Sgabeblack@google.com
42612957Sgabeblack@google.cominline const std::string
42712957Sgabeblack@google.comSensitivity::name()
42812957Sgabeblack@google.com{
42912957Sgabeblack@google.com    return std::string(process->name()) + ".timeout";
43012957Sgabeblack@google.com}
43112957Sgabeblack@google.com
43212952Sgabeblack@google.com} // namespace sc_gem5
43312952Sgabeblack@google.com
43412952Sgabeblack@google.com#endif  //__SYSTEMC_CORE_PROCESS_HH__
435