Go to the documentation of this file.
36 #include "debug/TokenPort.hh"
93 auto *request_port =
dynamic_cast<RequestPort*
>(&peer);
94 if (!token_request_port && !request_port) {
95 fatal(
"Attempt to bind port %s to unsupported response port %s.",
97 }
else if (token_request_port) {
103 }
else if (request_port) {
120 "Attempted to retry a response when no retry was queued!\n");
159 DPRINTF(TokenPort,
"Received %d tokens, have %d\n",
163 "More tokens available than the maximum after recvTokens!\n");
176 "Attempted to acquire more tokens than are available!\n");
180 DPRINTF(TokenPort,
"Acquired %d tokens, have %d\n",
#define fatal(...)
This implements a cprintf based fatal() function.
TokenManager * tokenManager
const std::string name() const
Return port name (for DPRINTF).
void bind(Port &peer) override
Bind this request port to a response port.
bool haveTokens(int num_tokens)
Query is num_tokens tokens are available.
void responderUnbind()
Called by the request port to unbind.
void recvTokens(int num_tokens)
Receive tokens returned by the response port.
void bind(Port &peer) override
Bind this request port to response port.
void unbind() override
Unbind this response port and associated request port.
void setTokenManager(TokenManager *_tokenManager)
Specify a token manger, which will handle tracking of tokens for a TokenRequestPort/ResponseRequestPo...
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
bool haveTokens(int num_tokens)
Query if there are at least num_tokens tokens available to acquire.
std::deque< PacketPtr > respQueue
TokenManager(int init_tokens)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void recvRespRetry() override
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
void acquireTokens(int num_tokens)
Acquire tokens by decrementing the number of available tokens across the port.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Ports are used to interface objects to each other.
void sendTokens(int num_tokens)
Return num_tokens tokens back to the request port.
void bind(Port &peer) override
Bind this response port to a request port.
void recvTokens(int num_tokens)
Increment the number of available tokens by num_tokens.
int getMaxTokenCount() const
Return the maximum possible tokens.
bool sendTimingResp(PacketPtr pkt)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
TokenRequestPort * tokenRequestPort
void acquireTokens(int num_tokens)
Decrement the number of available tokens by num_tokens.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17