gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::TokenManager Class Reference

#include <token_port.hh>

Public Member Functions

 TokenManager (int init_tokens)
 
 ~TokenManager ()
 
int getMaxTokenCount () const
 Return the maximum possible tokens.
 
void recvTokens (int num_tokens)
 Increment the number of available tokens by num_tokens.
 
bool haveTokens (int num_tokens)
 Query is num_tokens tokens are available.
 
void acquireTokens (int num_tokens)
 Decrement the number of available tokens by num_tokens.
 

Protected Attributes

int maxTokens
 
int availableTokens
 

Detailed Description

Definition at line 130 of file token_port.hh.

Constructor & Destructor Documentation

◆ TokenManager()

gem5::TokenManager::TokenManager ( int init_tokens)

Definition at line 142 of file token_port.cc.

References availableTokens, and maxTokens.

◆ ~TokenManager()

gem5::TokenManager::~TokenManager ( )
inline

Definition at line 141 of file token_port.hh.

Member Function Documentation

◆ acquireTokens()

void gem5::TokenManager::acquireTokens ( int num_tokens)

Decrement the number of available tokens by num_tokens.

Definition at line 173 of file token_port.cc.

References availableTokens, DPRINTF, haveTokens(), and panic_if.

Referenced by gem5::TokenRequestPort::acquireTokens().

◆ getMaxTokenCount()

int gem5::TokenManager::getMaxTokenCount ( ) const

Return the maximum possible tokens.

Definition at line 149 of file token_port.cc.

References maxTokens.

◆ haveTokens()

bool gem5::TokenManager::haveTokens ( int num_tokens)

Query is num_tokens tokens are available.

Definition at line 167 of file token_port.cc.

References availableTokens.

Referenced by acquireTokens(), and gem5::TokenRequestPort::haveTokens().

◆ recvTokens()

void gem5::TokenManager::recvTokens ( int num_tokens)

Increment the number of available tokens by num_tokens.

Definition at line 155 of file token_port.cc.

References availableTokens, DPRINTF, maxTokens, and panic_if.

Referenced by gem5::GlobalMemPipeline::exec(), gem5::LocalMemPipeline::exec(), gem5::Wavefront::exec(), and gem5::TokenRequestPort::recvTokens().

Member Data Documentation

◆ availableTokens

int gem5::TokenManager::availableTokens
protected

Definition at line 137 of file token_port.hh.

Referenced by acquireTokens(), haveTokens(), recvTokens(), and TokenManager().

◆ maxTokens

int gem5::TokenManager::maxTokens
protected

Definition at line 134 of file token_port.hh.

Referenced by getMaxTokenCount(), recvTokens(), and TokenManager().


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

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0