gem5 v24.0.0.0
|
A layer is an internal crossbar arbitration point with its own flow control. More...
#include <xbar.hh>
Public Member Functions | |
Layer (DstType &_port, BaseXBar &_xbar, const std::string &_name) | |
Create a layer and give it a name. | |
DrainState | drain () override |
Drain according to the normal semantics, so that the crossbar can tell the layer to drain, and pass an event to signal back when drained. | |
const std::string | name () const |
bool | tryTiming (SrcType *src_port) |
Determine if the layer accepts a packet from a specific port. | |
void | succeededTiming (Tick busy_time) |
Deal with a destination port accepting a packet by potentially removing the source port from the retry list (if retrying) and occupying the layer accordingly. | |
void | failedTiming (SrcType *src_port, Tick busy_time) |
Deal with a destination port not accepting a packet by potentially adding the source port to the retry list (if not already at the front) and occupying the layer accordingly. | |
void | occupyLayer (Tick until) |
void | retryWaiting () |
Send a retry to the port at the head of waitingForLayer. | |
void | recvRetry () |
Handle a retry from a neighbouring module. | |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Protected Member Functions | |
virtual void | sendRetry (SrcType *retry_port)=0 |
Sending the actual retry, in a manner specific to the individual layers. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Private Types | |
enum | State { IDLE , BUSY , RETRY } |
We declare an enum to track the state of the layer. More... | |
Private Member Functions | |
void | releaseLayer () |
Release the layer after being occupied and return to an idle state where we proceed to send a retry to any potential waiting port, or drain if asked to do so. | |
Private Attributes | |
DstType & | port |
The destination port this layer converges at. | |
BaseXBar & | xbar |
The crossbar this layer is a part of. | |
std::string | _name |
State | state |
std::deque< SrcType * > | waitingForLayer |
A deque of ports that retry should be called on because the original send was delayed due to a busy layer. | |
SrcType * | waitingForPeer |
Track who is waiting for the retry when receiving it from a peer. | |
EventFunctionWrapper | releaseEvent |
statistics::Scalar | occupancy |
Stats for occupancy and utilization. | |
statistics::Formula | utilization |
A layer is an internal crossbar arbitration point with its own flow control.
Each layer is a converging multiplexer tree. By instantiating one layer per destination port (and per packet type, i.e. request, response, snoop request and snoop response), we model full crossbar structures like AXI, ACE, PCIe, etc.
The template parameter, PortClass, indicates the destination port type for the layer. The retry list holds either memory-side ports or CPU-side ports, depending on the direction of the layer. Thus, a request layer has a retry list containing CPU-side ports, whereas a response layer holds memory-side ports.
|
private |
We declare an enum to track the state of the layer.
The starting point is an idle state where the layer is waiting for a packet to arrive. Upon arrival, the layer transitions to the busy state, where it remains either until the packet transfer is done, or the header time is spent. Once the layer leaves the busy state, it can either go back to idle, if no packets have arrived while it was busy, or the layer goes on to retry the first port in waitingForLayer. A similar transition takes place from idle to retry if the layer receives a retry from one of its connected ports. The retry state lasts until the port in questions calls sendTiming and returns control to the layer, or goes to a busy state if the port does not immediately react to the retry by calling sendTiming.
Enumerator | |
---|---|
IDLE | |
BUSY | |
RETRY |
gem5::BaseXBar::Layer< SrcType, DstType >::Layer | ( | DstType & | _port, |
BaseXBar & | _xbar, | ||
const std::string & | _name ) |
|
overridevirtual |
Drain according to the normal semantics, so that the crossbar can tell the layer to drain, and pass an event to signal back when drained.
de | drain event to call once drained |
Implements gem5::Drainable.
Definition at line 598 of file xbar.cc.
References DPRINTF, gem5::Drained, gem5::Draining, and state.
void gem5::BaseXBar::Layer< SrcType, DstType >::failedTiming | ( | SrcType * | src_port, |
Tick | busy_time ) |
Deal with a destination port not accepting a packet by potentially adding the source port to the retry list (if not already at the front) and occupying the layer accordingly.
src_port | Source port |
busy_time | Time to spend as a result of a failed send |
Definition at line 229 of file xbar.cc.
References gem5::scmi::BUSY, and state.
|
inline |
Definition at line 117 of file xbar.hh.
References gem5::BaseXBar::Layer< SrcType, DstType >::_name.
void gem5::BaseXBar::Layer< SrcType, DstType >::occupyLayer | ( | Tick | until | ) |
Definition at line 165 of file xbar.cc.
References gem5::scmi::BUSY, gem5::curTick(), DPRINTF, and state.
void gem5::BaseXBar::Layer< SrcType, DstType >::recvRetry | ( | ) |
Handle a retry from a neighbouring module.
This wraps retryWaiting by verifying that there are ports waiting before calling retryWaiting.
Definition at line 310 of file xbar.cc.
References gem5::scmi::BUSY, and state.
|
private |
Release the layer after being occupied and return to an idle state where we proceed to send a retry to any potential waiting port, or drain if asked to do so.
Definition at line 251 of file xbar.cc.
References gem5::scmi::BUSY, DPRINTF, gem5::Draining, and state.
void gem5::BaseXBar::Layer< SrcType, DstType >::retryWaiting | ( | ) |
Send a retry to the port at the head of waitingForLayer.
The caller must ensure that the list is not empty.
Definition at line 275 of file xbar.cc.
References gem5::scmi::BUSY, and state.
|
protectedpure virtual |
Sending the actual retry, in a manner specific to the individual layers.
Note that for a RequestPort, there is both a RequestLayer and a SnoopResponseLayer using the same port, but using different functions for the flow control.
Implemented in gem5::BaseXBar::ReqLayer, gem5::BaseXBar::RespLayer, and gem5::BaseXBar::SnoopRespLayer.
void gem5::BaseXBar::Layer< SrcType, DstType >::succeededTiming | ( | Tick | busy_time | ) |
Deal with a destination port accepting a packet by potentially removing the source port from the retry list (if retrying) and occupying the layer accordingly.
busy_time | Time to spend as a result of a successful send |
Definition at line 217 of file xbar.cc.
References gem5::scmi::BUSY, and state.
bool gem5::BaseXBar::Layer< SrcType, DstType >::tryTiming | ( | SrcType * | src_port | ) |
Determine if the layer accepts a packet from a specific port.
If not, the port in question is also added to the retry list. In either case the state of the layer is updated accordingly.
port | Source port presenting the packet |
Definition at line 186 of file xbar.cc.
References gem5::scmi::BUSY, and state.
|
private |
Definition at line 185 of file xbar.hh.
Referenced by gem5::BaseXBar::Layer< SrcType, DstType >::name().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |