54 #include "debug/NoncoherentXBar.hh"
55 #include "debug/XBar.hh"
63 for (
int i = 0;
i < p->port_master_connection_count; ++
i) {
73 if (p->port_default_connection_count) {
75 std::string portName =
name() +
".default";
84 for (
int i = 0;
i < p->port_slave_connection_count; ++
i) {
117 if (!
reqLayers[master_port_id]->tryTiming(src_port)) {
149 bool success =
masterPorts[master_port_id]->sendTimingReq(pkt);
159 reqLayers[master_port_id]->failedTiming(src_port,
166 if (expect_response) {
171 reqLayers[master_port_id]->succeededTiming(packetFinishTime);
174 pktCount[slave_port_id][master_port_id]++;
175 pktSize[slave_port_id][master_port_id] += pkt_size;
188 const auto route_lookup =
routeTo.find(pkt->
req);
189 assert(route_lookup !=
routeTo.end());
190 const PortID slave_port_id = route_lookup->second;
196 if (!
respLayers[slave_port_id]->tryTiming(src_port)) {
228 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
231 pktCount[slave_port_id][master_port_id]++;
232 pktSize[slave_port_id][master_port_id] += pkt_size;
261 pktCount[slave_port_id][master_port_id]++;
262 pktSize[slave_port_id][master_port_id] += pkt_size;
274 pktCount[slave_port_id][master_port_id]++;
275 pktSize[slave_port_id][master_port_id] += pkt_size;
281 return response_latency;
290 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
300 if (
p->checkFunctional(pkt)) {
315 NoncoherentXBarParams::create()
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
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.
Declaration of the non-coherent crossbar slave port type, one will be instantiated for each of the ma...
virtual bool recvTimingResp(PacketPtr pkt, PortID master_port_id)
Function called by the port when the crossbar is recieving a Timing response packet.
const PortID InvalidPortID
std::vector< ReqLayer * > reqLayers
Declare the layers of this crossbar, one vector for requests and one for responses.
const std::string name() const
Return port name (for DPRINTF).
bool isExpressSnoop() const
std::vector< RespLayer * > respLayers
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 queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
A SlavePort is a specialisation of a port.
virtual void regStats()
stats
int cmdToIndex() const
Return the index of this command.
NoncoherentXBar(const NoncoherentXBarParams *p)
virtual bool recvTimingReq(PacketPtr pkt, PortID slave_port_id)
Function called by the port when the crossbar is recieving a Timing request packet.
The base crossbar contains the common elements of the non-coherent and coherent crossbar.
void recvFunctional(PacketPtr pkt, PortID slave_port_id)
Function called by the port when the crossbar is recieving a Functional transaction.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Tick curTick()
The current simulated tick.
void recvReqRetry(PortID master_port_id)
Timing function called by port when it is once again able to process requests.
std::string csprintf(const char *format, const Args &...args)
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Tick recvAtomic(PacketPtr pkt, PortID slave_port_id)
Function called by the port when the crossbar is recieving a Atomic transaction.
uint64_t Tick
Tick count type.
Stats::Vector transDist
Stats for transaction distribution and data passing through the crossbar.
const RequestPtr req
A pointer to the original request.
void calcPacketTiming(PacketPtr pkt, Tick header_delay)
Calculate the timing parameters for the packet.
bool needsResponse() const
bool cacheResponding() const
virtual ~NoncoherentXBar()
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
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...
A non-coherent crossbar connects a number of non-snooping masters and slaves, and routes the request ...
std::vector< MasterPort * > masterPorts
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
std::vector< QueuedSlavePort * > slavePorts
The master and slave ports of the crossbar.
virtual const std::string name() const
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Declaration of the crossbar master port type, one will be instantiated for each of the slave ports co...
Declaration of a non-coherent crossbar.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const Cycles forwardLatency
Cycles of forward latency.