gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::SimulatorThreads Class Reference

Public Member Functions

 SimulatorThreads ()=delete
 
 SimulatorThreads (const SimulatorThreads &)=delete
 
SimulatorThreadsoperator= (SimulatorThreads &)=delete
 
 SimulatorThreads (uint32_t num_queues)
 
 ~SimulatorThreads ()
 
void runUntilLocalExit ()
 
void terminateThreads ()
 

Protected Member Functions

void thread_main (EventQueue *queue)
 The main function for all subordinate threads (i.e., all threads other than the main thread).
 

Protected Attributes

std::atomic< bool > terminate
 
uint32_t numQueues
 
std::vector< std::thread > threads
 
Barrier barrier
 

Detailed Description

Definition at line 68 of file simulate.cc.

Constructor & Destructor Documentation

◆ SimulatorThreads() [1/3]

gem5::SimulatorThreads::SimulatorThreads ( )
delete

Referenced by operator=(), and SimulatorThreads().

◆ SimulatorThreads() [2/3]

gem5::SimulatorThreads::SimulatorThreads ( const SimulatorThreads & )
delete

References SimulatorThreads().

◆ SimulatorThreads() [3/3]

gem5::SimulatorThreads::SimulatorThreads ( uint32_t num_queues)
inline

Definition at line 75 of file simulate.cc.

References barrier, numQueues, terminate, and threads.

◆ ~SimulatorThreads()

gem5::SimulatorThreads::~SimulatorThreads ( )
inline

Definition at line 83 of file simulate.cc.

References terminateThreads().

Member Function Documentation

◆ operator=()

SimulatorThreads & gem5::SimulatorThreads::operator= ( SimulatorThreads & )
delete

References SimulatorThreads().

◆ runUntilLocalExit()

void gem5::SimulatorThreads::runUntilLocalExit ( )
inline

◆ terminateThreads()

void gem5::SimulatorThreads::terminateThreads ( )
inline

Definition at line 120 of file simulate.cc.

References barrier, gem5::ArmISA::t, terminate, and threads.

Referenced by ~SimulatorThreads().

◆ thread_main()

void gem5::SimulatorThreads::thread_main ( EventQueue * queue)
inlineprotected

The main function for all subordinate threads (i.e., all threads other than the main thread).

These threads start by waiting on threadBarrier. Once all threads have arrived at threadBarrier, they enter the simulation loop concurrently. When they exit the loop, they return to waiting on threadBarrier. This process is repeated until the simulation terminates.

Definition at line 153 of file simulate.cc.

References barrier, gem5::doSimLoop(), and terminate.

Referenced by runUntilLocalExit().

Member Data Documentation

◆ barrier

Barrier gem5::SimulatorThreads::barrier
protected

Definition at line 167 of file simulate.cc.

Referenced by runUntilLocalExit(), SimulatorThreads(), terminateThreads(), and thread_main().

◆ numQueues

uint32_t gem5::SimulatorThreads::numQueues
protected

Definition at line 165 of file simulate.cc.

Referenced by runUntilLocalExit(), and SimulatorThreads().

◆ terminate

std::atomic<bool> gem5::SimulatorThreads::terminate
protected

Definition at line 164 of file simulate.cc.

Referenced by runUntilLocalExit(), SimulatorThreads(), terminateThreads(), and thread_main().

◆ threads

std::vector<std::thread> gem5::SimulatorThreads::threads
protected

Definition at line 166 of file simulate.cc.

Referenced by runUntilLocalExit(), SimulatorThreads(), and terminateThreads().


The documentation for this class was generated from the following file:

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