gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
TokenManager Class Reference

#include <token_port.hh>

Public Member Functions

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

Protected Attributes

int maxTokens
 
int availableTokens
 

Detailed Description

Definition at line 129 of file token_port.hh.

Constructor & Destructor Documentation

◆ TokenManager()

TokenManager::TokenManager ( int  init_tokens)

Definition at line 143 of file token_port.cc.

References availableTokens, and maxTokens.

◆ ~TokenManager()

TokenManager::~TokenManager ( )
inline

Definition at line 140 of file token_port.hh.

Member Function Documentation

◆ acquireTokens()

void TokenManager::acquireTokens ( int  num_tokens)

Decrement the number of available tokens by num_tokens.

Definition at line 174 of file token_port.cc.

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

Referenced by TokenRequestPort::acquireTokens().

◆ getMaxTokenCount()

int TokenManager::getMaxTokenCount ( ) const

Return the maximum possible tokens.

Definition at line 150 of file token_port.cc.

References maxTokens.

◆ haveTokens()

bool TokenManager::haveTokens ( int  num_tokens)

Query is num_tokens tokens are available.

Definition at line 168 of file token_port.cc.

References availableTokens.

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

◆ recvTokens()

void TokenManager::recvTokens ( int  num_tokens)

Increment the number of available tokens by num_tokens.

Definition at line 156 of file token_port.cc.

References availableTokens, DPRINTF, maxTokens, and panic_if.

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

Member Data Documentation

◆ availableTokens

int TokenManager::availableTokens
protected

Definition at line 136 of file token_port.hh.

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

◆ maxTokens

int TokenManager::maxTokens
protected

Definition at line 133 of file token_port.hh.

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


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

Generated on Wed Sep 30 2020 14:02:33 for gem5 by doxygen 1.8.17