gem5  v22.0.0.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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). More...
 

Protected Attributes

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

Detailed Description

Definition at line 66 of file simulate.cc.

Constructor & Destructor Documentation

◆ SimulatorThreads() [1/3]

gem5::SimulatorThreads::SimulatorThreads ( )
delete

◆ SimulatorThreads() [2/3]

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

◆ SimulatorThreads() [3/3]

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

Definition at line 73 of file simulate.cc.

References threads.

◆ ~SimulatorThreads()

gem5::SimulatorThreads::~SimulatorThreads ( )
inline

Definition at line 81 of file simulate.cc.

References terminateThreads().

Member Function Documentation

◆ operator=()

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

◆ runUntilLocalExit()

void gem5::SimulatorThreads::runUntilLocalExit ( )
inline

◆ terminateThreads()

void gem5::SimulatorThreads::terminateThreads ( )
inline

Definition at line 118 of file simulate.cc.

References barrier, gem5::VegaISA::t, terminate, threads, and gem5::Barrier::wait().

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 151 of file simulate.cc.

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

Referenced by runUntilLocalExit().

Member Data Documentation

◆ barrier

Barrier gem5::SimulatorThreads::barrier
protected

Definition at line 165 of file simulate.cc.

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

◆ numQueues

uint32_t gem5::SimulatorThreads::numQueues
protected

Definition at line 163 of file simulate.cc.

Referenced by runUntilLocalExit().

◆ terminate

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

Definition at line 162 of file simulate.cc.

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

◆ threads

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

Definition at line 164 of file simulate.cc.

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


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

Generated on Thu Jul 28 2022 13:33:13 for gem5 by doxygen 1.8.17