46#ifndef __MEM_XBAR_HH__
47#define __MEM_XBAR_HH__
50#include <unordered_map>
55#include "params/BaseXBar.hh"
90 template <
typename SrcType,
typename DstType>
248 const std::string&
_name) :
271 const std::string&
_name) :
294 const std::string&
_name) :
327 std::unordered_map<RequestPtr, PortID>
routeTo;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
The AddrRangeMap uses an STL map to implement an interval tree for address decoding.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
A layer is an internal crossbar arbitration point with its own flow control.
statistics::Formula utilization
State
We declare an enum to track the state of the layer.
statistics::Scalar occupancy
Stats for occupancy and utilization.
void recvRetry()
Handle a retry from a neighbouring module.
DrainState drain() override
Drain according to the normal semantics, so that the crossbar can tell the layer to drain,...
std::deque< SrcType * > waitingForLayer
A deque of ports that retry should be called on because the original send was delayed due to a busy l...
bool tryTiming(SrcType *src_port)
Determine if the layer accepts a packet from a specific port.
const std::string name() const
EventFunctionWrapper releaseEvent
Layer(DstType &_port, BaseXBar &_xbar, const std::string &_name)
Create a layer and give it a name.
SrcType * waitingForPeer
Track who is waiting for the retry when receiving it from a peer.
void occupyLayer(Tick until)
void retryWaiting()
Send a retry to the port at the head of waitingForLayer.
DstType & port
The destination port this layer converges at.
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 retr...
void releaseLayer()
Release the layer after being occupied and return to an idle state where we proceed to send a retry t...
void succeededTiming(Tick busy_time)
Deal with a destination port accepting a packet by potentially removing the source port from the retr...
virtual void sendRetry(SrcType *retry_port)=0
Sending the actual retry, in a manner specific to the individual layers.
BaseXBar & xbar
The crossbar this layer is a part of.
void sendRetry(ResponsePort *retry_port) override
Sending the actual retry, in a manner specific to the individual layers.
ReqLayer(RequestPort &_port, BaseXBar &_xbar, const std::string &_name)
Create a request layer and give it a name.
RespLayer(ResponsePort &_port, BaseXBar &_xbar, const std::string &_name)
Create a response layer and give it a name.
void sendRetry(RequestPort *retry_port) override
Sending the actual retry, in a manner specific to the individual layers.
void sendRetry(ResponsePort *retry_port) override
Sending the actual retry, in a manner specific to the individual layers.
SnoopRespLayer(RequestPort &_port, BaseXBar &_xbar, const std::string &_name)
Create a snoop response layer and give it a name.
The base crossbar contains the common elements of the non-coherent and coherent crossbar.
PortID defaultPortID
Port that handles requests that don't match any of the interfaces.
std::vector< RequestPort * > memSidePorts
const Cycles headerLatency
Cycles the layer is occupied processing the packet header.
const Cycles frontendLatency
Cycles of front-end pipeline including the delay to accept the request and to decode the address.
PortID findPort(AddrRange addr_range, PacketPtr pkt=nullptr)
Find which port connected to this crossbar (if any) should be given a packet with this address range.
statistics::Vector transDist
Stats for transaction distribution and data passing through the crossbar.
const bool useDefaultRange
If true, use address range provided by default device.
PortID findPort(PacketPtr pkt)
std::unordered_map< RequestPtr, PortID > routeTo
Remember where request packets came from so that we can route responses to the appropriate port.
statistics::Vector2d pktCount
BaseXBar(const BaseXBarParams &p)
std::vector< QueuedResponsePort * > cpuSidePorts
The memory-side ports and CPU-side ports of the crossbar.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
A function used to return the port associated with this object.
void regStats() override
Callback to set stat parameters.
const Cycles forwardLatency
AddrRangeList xbarRanges
all contigous ranges seen by this crossbar
AddrRangeMap< PortID, 3 > portMap
const uint32_t width
the width of the xbar in bytes
statistics::Vector2d pktSize
std::vector< bool > gotAddrRanges
Remember for each of the memory-side ports of the crossbar if we got an address range from the connec...
virtual void recvRangeChange(PortID mem_side_port_id)
Function called by the port when the crossbar is recieving a range change.
void calcPacketTiming(PacketPtr pkt, Tick header_delay)
Calculate the timing parameters for the packet.
const Cycles responseLatency
AddrRangeList getAddrRanges() const
Return the address ranges the crossbar is responsible for.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Cycles is a wrapper class for representing cycle counts, i.e.
Interface for objects that might require draining before checkpointing.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
AddrRange getAddrRange() const
Get address range to which this packet belongs.
Ports are used to interface objects to each other.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
virtual void sendRetryResp()
Send a retry to the response port that previously attempted a sendTimingResp to this request port and...
A ResponsePort is a specialization of a port.
void sendRetrySnoopResp()
Send a retry to the request port that previously attempted a sendTimingSnoopResp to this response por...
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
This is a simple scalar statistic, like a counter.
A 2-Dimensional vecto of scalar stats.
A vector of scalar stats.
ClockedObject declaration and implementation.
DrainState
Object drain/handover states.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
Declaration of the queued port.