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