28#ifndef __SYSTEMC_EXT_CORE_SC_SPAWN_HH__
29#define __SYSTEMC_EXT_CORE_SC_SPAWN_HH__
40class sc_spawn_options;
59template <
typename T,
typename R>
71 const ::sc_core::sc_spawn_options *);
132 template <
typename T>
157 auto func = new ::sc_gem5::ProcessObjFuncWrapper<T>(
object);
164sc_spawn(
typename T::result_type *r_p, T
object,
const char *name_p=
nullptr,
167 auto func = new ::sc_gem5::ProcessObjRetFuncWrapper<
168 T,
typename T::result_type>(object, r_p);
175 ::sc_core::sc_process_handle forkees[] = {
179 ::sc_core::sc_join join; \
180 for (int i = 0; i < sizeof(forkees) / sizeof(forkees[0]); i++) \
181 join.add_process(forkees[i]); \
188 ::sc_core::sc_join join; \
189 for (int i = 0; i < sizeof(forkees) / sizeof(forkees[0]); i++) \
190 join.add_process(forkees[i]); \
191 join.wait_clocked(); \
197template <
typename F,
typename... Args>
199 decltype(std::bind(std::forward<F>(
f), std::forward<Args>(args)...))
201 return std::bind(std::forward<F>(
f), std::forward<Args>(args)...);
205auto sc_ref(T &&v) ->
decltype(std::ref(std::forward<T>(v)))
207 return std::ref(std::forward<T>(v));
211auto sc_cref(T &&v) ->
decltype(std::cref(std::forward<T>(v)))
213 return std::cref(std::forward<T>(v));
225using namespace std::placeholders;
std::vector< const sc_event * > _events
std::vector< sc_port_base * > _ports
sc_spawn_options(const sc_spawn_options &)
std::vector< Reset< const sc_signal_in_if< bool > > > _if_resets
void set_sensitivity(const sc_event *)
std::vector< sc_interface * > _interfaces
sc_spawn_options & operator=(const sc_spawn_options &)
std::vector< sc_export_base * > _exports
std::vector< Reset< const sc_out< bool > > > _out_resets
std::vector< Reset< const sc_inout< bool > > > _inout_resets
void async_reset_signal_is(const sc_in< bool > &, bool)
std::vector< sc_event_finder * > _finders
void reset_signal_is(const sc_in< bool > &, bool)
std::vector< Reset< const sc_in< bool > > > _in_resets
sc_process_handle sc_spawn(T object, const char *name_p=nullptr, const sc_spawn_options *opt_p=nullptr)
auto sc_cref(T &&v) -> decltype(std::cref(std::forward< T >(v)))
auto sc_bind(F &&f, Args &&...args) -> decltype(std::bind(std::forward< F >(f), std::forward< Args >(args)...))
auto sc_ref(T &&v) -> decltype(std::ref(std::forward< T >(v)))
Process * spawnWork(ProcessFuncWrapper *func, const char *name, const ::sc_core::sc_spawn_options *opts)
Reset(T *t, bool v, bool s)
ProcessObjFuncWrapper(T t)
ProcessObjRetFuncWrapper(T t, R *r)
const std::string & name()