gem5 v24.0.0.0
|
Functions | |
template<typename T = Ret> | |
CallerType & | gem5::Coroutine< Arg, Ret >::CallerType::operator() (typename std::enable_if_t< !std::is_same_v< T, void >, T > param) |
operator() is the way we can jump outside the coroutine and return a value to the caller. | |
template<typename T = Ret> | |
std::enable_if_t< std::is_same_v< T, void >, CallerType > & | gem5::Coroutine< Arg, Ret >::CallerType::operator() () |
operator() is the way we can jump outside the coroutine | |
template<typename T = Arg> | |
std::enable_if_t<!std::is_same_v< T, void >, T > | gem5::Coroutine< Arg, Ret >::CallerType::get () |
get() is the way we can extrapolate arguments from the coroutine caller. | |
gem5::Coroutine< Arg, Ret >::Coroutine (std::function< void(CallerType &)> f, bool run_coroutine=true) | |
Coroutine constructor. | |
virtual | gem5::Coroutine< Arg, Ret >::~Coroutine () |
template<typename T = Arg> | |
Coroutine & | gem5::Coroutine< Arg, Ret >::operator() (typename std::enable_if_t<!std::is_same_v< T, void >, T > param) |
Coroutine interface. | |
template<typename T = Arg> | |
std::enable_if_t< std::is_same_v< T, void >, Coroutine > & | gem5::Coroutine< Arg, Ret >::operator() () |
operator() is the way we can jump inside the coroutine. | |
template<typename T = Ret> | |
std::enable_if_t<!std::is_same_v< T, void >, T > | gem5::Coroutine< Arg, Ret >::get () |
get() is the way we can extrapolate return values (yielded) from the coroutine. | |
gem5::Coroutine< Arg, Ret >::operator bool () const | |
Check if coroutine is still running. | |
gem5::Coroutine< Arg, Ret >::Coroutine ()=delete | |
gem5::Coroutine< Arg, Ret >::Coroutine (const Coroutine &rhs)=delete | |
Coroutine & | gem5::Coroutine< Arg, Ret >::operator= (const Coroutine &rhs)=delete |
These methods relate to the Coroutine interface.
|
delete |
|
delete |
|
inline |
Coroutine constructor.
The only way to construct a coroutine is to pass it the routine it needs to run. The first argument of the function should be a reference to the Coroutine<Arg,Ret>::caller_type which the routine will use as a way for yielding to the caller. The optional second boolean argument controls if the Coroutine should be run on creation, which mimics Boost's Coroutine semantics by default. This can be disabled as an optimization to avoid unnecessary context switches on Coroutine creation.
f | task run by the coroutine |
run_coroutine | set to false to disable running the coroutine immediately after it is created |
Definition at line 185 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::call().
|
inline |
get() is the way we can extrapolate arguments from the coroutine caller.
The coroutine blocks, waiting for the value, unless it is already available; otherwise caller execution is resumed, and coroutine won't execute until a value is pushed from the caller.
Definition at line 141 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::argsChannel, gem5::Coroutine< Arg, Ret >::CallerType::callerFiber, gem5::Coroutine< Arg, Ret >::CallerType::coro, and gem5::Fiber::run().
Referenced by gem5::SMMUTranslationProcess::completeTransaction(), gem5::ItsProcess::doRead(), gem5::SMMUProcess::doRead(), gem5::ItsProcess::doWrite(), gem5::SMMUProcess::doWrite(), and gem5::ItsTranslation::main().
|
inline |
get() is the way we can extrapolate return values (yielded) from the coroutine.
The caller blocks, waiting for the value, unless it is already available; otherwise coroutine execution is resumed, and caller won't execute until a value is yielded back from the coroutine.
Definition at line 249 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::call(), gem5::Coroutine< Arg, Ret >::caller, and gem5::Coroutine< Arg, Ret >::CallerType::retChannel.
|
inline |
Check if coroutine is still running.
Definition at line 266 of file coroutine.hh.
References gem5::Fiber::finished().
|
inline |
operator() is the way we can jump outside the coroutine
This method is generated only if the coroutine doesn't return a value (Ret = void)
Definition at line 121 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::CallerType::callerFiber, and gem5::Fiber::run().
|
inline |
operator() is the way we can jump outside the coroutine and return a value to the caller.
This method is generated only if the coroutine returns a value (Ret != void)
Definition at line 102 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::CallerType::callerFiber, gem5::Coroutine< Arg, Ret >::CallerType::retChannel, and gem5::Fiber::run().
|
inline |
operator() is the way we can jump inside the coroutine.
This method is generated only if the coroutine takes no arguments. (Arg = void)
Definition at line 229 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::call().
|
inline |
Coroutine interface.
operator() is the way we can jump inside the coroutine and passing arguments.
This method is generated only if the coroutine takes arguments (Arg != void)
Definition at line 212 of file coroutine.hh.
References gem5::Coroutine< Arg, Ret >::argsChannel, and gem5::Coroutine< Arg, Ret >::call().
|
delete |
|
inlinevirtual |
Definition at line 196 of file coroutine.hh.