32#ifndef __MEM_TOKEN_PORT_HH__
33#define __MEM_TOKEN_PORT_HH__
42class TokenResponsePort;
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
const std::string name() const
Return port name (for DPRINTF).
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
A ResponsePort is a specialization of a port.
Abstract superclass for simulation objects.
int getMaxTokenCount() const
Return the maximum possible tokens.
void acquireTokens(int num_tokens)
Decrement the number of available tokens by num_tokens.
bool haveTokens(int num_tokens)
Query is num_tokens tokens are available.
void recvTokens(int num_tokens)
Increment the number of available tokens by num_tokens.
void recvTokens(int num_tokens)
Receive tokens returned by the response port.
void acquireTokens(int num_tokens)
Acquire tokens by decrementing the number of available tokens across the port.
void bind(Port &peer) override
Bind this request port to response port.
TokenManager * tokenManager
bool haveTokens(int num_tokens)
Query if there are at least num_tokens tokens available to acquire.
void setTokenManager(TokenManager *_tokenManager)
Specify a token manger, which will handle tracking of tokens for a TokenRequestPort/ResponseRequestPo...
TokenRequestPort(const std::string &name, SimObject *owner, PortID id=InvalidPortID)
void unbind() override
Unbind port.
void unbind() override
Unbind this response port and associated request port.
bool sendTimingResp(PacketPtr pkt)
void sendTokens(int num_tokens)
Return num_tokens tokens back to the request port.
TokenRequestPort * tokenRequestPort
TokenResponsePort(const std::string &name, PortID id=InvalidPortID)
bool trySatisfyFunctional(PacketPtr)
void bind(Port &peer) override
Bind this response port to a request port.
std::deque< PacketPtr > respQueue
void recvRespRetry() override
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
ClockedObject declaration and implementation.
Copyright (c) 2024 Arm Limited All rights reserved.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.