1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 25 unchanged lines hidden (view full) ---

34#include "systemc/core/scheduler.hh"
35
36namespace sc_gem5
37{
38
39class Method : public Process
40{
41 public:
42 Method(const char *name, ProcessFuncWrapper *func) : Process(name, func) {}
42 Method(const char *name, ProcessFuncWrapper *func, bool internal=false) :
43 Process(name, func, internal)
44 {}
45
46 const char *kind() const override { return "sc_method_process"; }
47
48 sc_core::sc_curr_proc_kind
49 procKind() const override
50 {
51 return sc_core::SC_METHOD_PROC_;
52 }
53};
54
55class Thread : public Process
56{
57 public:
56 Thread(const char *name, ProcessFuncWrapper *func) :
57 Process(name, func), ctx(nullptr)
58 Thread(const char *name, ProcessFuncWrapper *func, bool internal=false) :
59 Process(name, func, internal), ctx(nullptr)
60 {}
61
62 ~Thread() { delete ctx; }
63
64 const char *kind() const override { return "sc_thread_process"; }
65
66 void throw_it(ExceptionWrapperBase &exc, bool inc_kids) override;
67

--- 32 unchanged lines hidden (view full) ---

100 friend class Context;
101
102 Context *ctx;
103};
104
105class CThread : public Thread
106{
107 public:
106 CThread(const char *name, ProcessFuncWrapper *func) : Thread(name, func)
108 CThread(const char *name, ProcessFuncWrapper *func, bool internal=false) :
109 Thread(name, func, internal)
110 {
111 // We'll be in the initialization list now, but we shouldn't be.
112 popListNode();
113 }
114
115 const char *kind() const override { return "sc_cthread_process"; }
116
117 sc_core::sc_curr_proc_kind
118 procKind() const override
119 {
120 return sc_core::SC_CTHREAD_PROC_;
121 }
122};
123
124} // namespace sc_gem5
125
126#endif //__SYSTEMC_CORE_PROCESS_TYPES_HH__