gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
The Fiber API.

These methods relate to the Fiber interface. More...

Functions

virtual gem5::Fiber::~Fiber ()
 
void gem5::Fiber::run ()
 Start executing the fiber represented by this object.
 
bool gem5::Fiber::finished () const
 Returns whether the "main" function of this fiber has finished.
 
bool gem5::Fiber::started () const
 Returns whether the "main" function of this fiber has started.
 
static Fibergem5::Fiber::currentFiber ()
 Get a pointer to the current running Fiber.
 
static Fibergem5::Fiber::primaryFiber ()
 Get a pointer to the primary Fiber.
 

Variables

static const size_t gem5::Fiber::DefaultStackSize = 0x50000
 
 gem5::Fiber::Fiber (size_t stack_size=DefaultStackSize)
 
 gem5::Fiber::Fiber (Fiber *link, size_t stack_size=DefaultStackSize)
 

Detailed Description

These methods relate to the Fiber interface.

Function Documentation

◆ currentFiber()

Fiber * gem5::Fiber::currentFiber ( )
static

Get a pointer to the current running Fiber.

Definition at line 185 of file fiber.cc.

References Fiber().

Referenced by gem5::Coroutine< PacketPtr, ItsAction >::call().

◆ Fiber() [1/2]

gem5::Fiber::Fiber ( Fiber * link,
size_t stack_size = DefaultStackSize )

Definition at line 88 of file fiber.cc.

References _finished, _started, fatal, Fiber(), guardPage, guardPageSize, link, stack, and stackSize.

◆ Fiber() [2/2]

gem5::Fiber::Fiber ( size_t stack_size = DefaultStackSize)
Parameters
Linkpoints to another fiber which will start executing when this fiber's main function returns.
stack_sizeis the size of the stack available to this fiber.

Definition at line 85 of file fiber.cc.

References Fiber(), and primaryFiber().

Referenced by sc_gem5::Thread::Context::Context(), gem5::Coroutine< PacketPtr, ItsAction >::Coroutine(), currentFiber(), Fiber(), Fiber(), LinkedFiber::LinkedFiber(), primaryFiber(), run(), sc_gem5::ScMainFiber::ScMainFiber(), and TEST().

◆ finished()

bool gem5::Fiber::finished ( ) const
inline

Returns whether the "main" function of this fiber has finished.

Definition at line 109 of file fiber.hh.

References _finished.

Referenced by gem5::Coroutine< PacketPtr, ItsAction >::operator bool().

◆ primaryFiber()

Fiber * gem5::Fiber::primaryFiber ( )
static

Get a pointer to the primary Fiber.

This Fiber represents the thread of execution started by the OS, and which has a Fiber attached to it after the fact.

Definition at line 186 of file fiber.cc.

References Fiber().

Referenced by a(), c(), Fiber(), sc_gem5::Process::fiber(), sc_gem5::Scheduler::start(), TEST(), TEST(), and sc_gem5::Scheduler::yield().

◆ run()

void gem5::Fiber::run ( )

Start executing the fiber represented by this object.

This function will "return" when the current fiber is switched back to later on.

Definition at line 166 of file fiber.cc.

References _finished, _started, createContext(), Fiber(), jmp, and panic_if.

Referenced by gem5::Coroutine< PacketPtr, ItsAction >::call(), sc_gem5::Scheduler::start(), TEST(), and sc_gem5::Scheduler::yield().

◆ started()

bool gem5::Fiber::started ( ) const
inline

Returns whether the "main" function of this fiber has started.

Definition at line 116 of file fiber.hh.

References _started.

Referenced by TEST().

◆ ~Fiber()

gem5::Fiber::~Fiber ( )
virtual

Definition at line 112 of file fiber.cc.

References guardPage, guardPageSize, panic_if, stack, and stackSize.

Variable Documentation

◆ DefaultStackSize

const size_t gem5::Fiber::DefaultStackSize = 0x50000
static

Definition at line 77 of file fiber.hh.


Generated on Mon May 26 2025 09:19:17 for gem5 by doxygen 1.13.2