51 #ifndef __MEM_XBAR_HH__
52 #define __MEM_XBAR_HH__
55 #include <unordered_map>
61 #include "params/BaseXBar.hh"
92 template <
typename SrcType,
typename DstType>
186 virtual void sendRetry(SrcType* retry_port) = 0;
263 Layer(_port, _xbar, _name) {}
282 Layer(_port, _xbar, _name) {}
301 const std::string&
_name) :
302 Layer(_port, _xbar, _name) {}
330 std::unordered_map<RequestPtr, PortID>
routeTo;
471 #endif //__MEM_XBAR_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
State
We declare an enum to track the state of the layer.
RespLayer(SlavePort &_port, BaseXBar &_xbar, const std::string &_name)
Create a response layer and give it a name.
void recvRetry()
Handle a retry from a neighbouring module.
PortID findPort(Addr addr)
Find which port connected to this crossbar (if any) should be given a packet with this address...
virtual void regStats()
Register statistics for this object.
Cycles is a wrapper class for representing cycle counts, i.e.
const std::string name() const
Get the crossbar layer's name.
void updatePortCache(short id, const AddrRange &range)
EventWrapper< Layer,&Layer::releaseLayer > releaseEvent
event used to schedule a release of the layer
const PortID InvalidPortID
DrainState
Object drain/handover states.
Stats::Formula utilization
PortID defaultPortID
Port that handles requests that don't match any of the interfaces.
std::unordered_map< RequestPtr, PortID > routeTo
Remember where request packets came from so that we can route responses to the appropriate port...
const Cycles responseLatency
Cycles of response latency.
A vector of scalar stats.
A SlavePort is a specialisation of a port.
virtual void sendRetryResp()
Send a retry to the slave port that previously attempted a sendTimingResp to this master port and fai...
std::vector< bool > gotAddrRanges
Remember for each of the master ports of the crossbar if we got an address range from the connected s...
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
void sendRetrySnoopResp()
Send a retry to the master port that previously attempted a sendTimingSnoopResp to this slave port an...
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
This is a simple scalar statistic, like a counter.
SnoopRespLayer(MasterPort &_port, BaseXBar &_xbar, const std::string &_name)
Create a snoop response layer and give it a name.
void sendRetry(MasterPort *retry_port)
Sending the actual retry, in a manner specific to the individual layers.
AddrRangeMap< PortID > portMap
The base crossbar contains the common elements of the non-coherent and coherent crossbar.
void succeededTiming(Tick busy_time)
Deal with a destination port accepting a packet by potentially removing the source port from the retr...
PortID checkPortCache(Addr addr) const
Interface for objects that might require draining before checkpointing.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
AddrRangeList xbarRanges
all contigous ranges seen by this crossbar
A layer is an internal crossbar arbitration point with its own flow control.
Declaration of the queued port.
const uint32_t width
the width of the xbar in bytes
void sendRetry(SlavePort *retry_port)
Sending the actual retry, in a manner specific to the individual layers.
uint64_t Tick
Tick count type.
Stats::Vector transDist
Stats for transaction distribution and data passing through the crossbar.
BaseXBar(const BaseXBarParams *p)
ReqLayer(MasterPort &_port, BaseXBar &_xbar, const std::string &_name)
Create a request layer and give it a name.
std::string _name
A name for this layer.
void calcPacketTiming(PacketPtr pkt, Tick header_delay)
Calculate the timing parameters for the packet.
void sendRetry(SlavePort *retry_port)
Sending the actual retry, in a manner specific to the individual layers.
DstType & port
The destination port this layer converges at.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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...
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...
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
const Cycles frontendLatency
Cycles of front-end pipeline including the delay to accept the request and to decode the address...
BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
std::vector< MasterPort * > masterPorts
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.
std::vector< QueuedSlavePort * > slavePorts
The master and slave ports of the crossbar.
virtual const std::string name() const
void occupyLayer(Tick until)
Occupy the layer until until.
void releaseLayer()
Release the layer after being occupied and return to an idle state where we proceed to send a retry t...
void sendRetryReq()
Send a retry to the master port that previously attempted a sendTimingReq to this slave port and fail...
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
DrainState drain() override
Drain according to the normal semantics, so that the crossbar can tell the layer to drain...
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
Layer(DstType &_port, BaseXBar &_xbar, const std::string &_name)
Create a layer and give it a name.
void regStats()
Register stats for the layer.
bool tryTiming(SrcType *src_port)
Determine if the layer accepts a packet from a specific port.
Stats::Scalar occupancy
Stats for occupancy and utilization.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const Cycles forwardLatency
Cycles of forward latency.
AddrRangeList getAddrRanges() const
Return the address ranges the crossbar is responsible for.
A 2-Dimensional vecto of scalar stats.
SrcType * waitingForPeer
Track who is waiting for the retry when receiving it from a peer.
const bool useDefaultRange
If true, use address range provided by default device.
void retryWaiting()
Send a retry to the port at the head of waitingForLayer.
virtual void recvRangeChange(PortID master_port_id)
Function called by the port when the crossbar is recieving a range change.
State state
track the state of the layer
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
A function used to return the port associated with this object.