process_types.hh (13131:bf07048d69e4) process_types.hh (13180:79e680f62779)
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:
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 {}
43
44 const char *kind() const override { return "sc_method_process"; }
45
46 sc_core::sc_curr_proc_kind
47 procKind() const override
48 {
49 return sc_core::SC_METHOD_PROC_;
50 }
51};
52
53class Thread : public Process
54{
55 public:
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)
58 {}
59
60 ~Thread() { delete ctx; }
61
62 const char *kind() const override { return "sc_thread_process"; }
63
64 void throw_it(ExceptionWrapperBase &exc, bool inc_kids) override;
65

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

98 friend class Context;
99
100 Context *ctx;
101};
102
103class CThread : public Thread
104{
105 public:
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)
107 {
108 // We'll be in the initialization list now, but we shouldn't be.
109 popListNode();
110 }
111
112 const char *kind() const override { return "sc_cthread_process"; }
113
114 sc_core::sc_curr_proc_kind
115 procKind() const override
116 {
117 return sc_core::SC_CTHREAD_PROC_;
118 }
119};
120
121} // namespace sc_gem5
122
123#endif //__SYSTEMC_CORE_PROCESS_TYPES_HH__
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__