50#include "debug/NoncoherentXBar.hh"
51#include "debug/XBar.hh"
62 for (
int i = 0;
i <
p.port_mem_side_ports_connection_count; ++
i) {
63 std::string portName =
csprintf(
"%s.mem_side_port[%d]",
name(),
i);
72 if (
p.port_default_connection_count) {
74 std::string portName =
name() +
".default";
83 for (
int i = 0;
i <
p.port_cpu_side_ports_connection_count; ++
i) {
84 std::string portName =
csprintf(
"%s.cpu_side_ports[%d]",
name(),
i);
115 if (!
reqLayers[mem_side_port_id]->tryTiming(src_port)) {
147 bool success =
memSidePorts[mem_side_port_id]->sendTimingReq(pkt);
157 reqLayers[mem_side_port_id]->failedTiming(src_port,
164 if (expect_response) {
169 reqLayers[mem_side_port_id]->succeededTiming(packetFinishTime);
172 pktCount[cpu_side_port_id][mem_side_port_id]++;
173 pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size;
186 const auto route_lookup =
routeTo.find(pkt->
req);
187 assert(route_lookup !=
routeTo.end());
188 const PortID cpu_side_port_id = route_lookup->second;
194 if (!
respLayers[cpu_side_port_id]->tryTiming(src_port)) {
227 respLayers[cpu_side_port_id]->succeededTiming(packetFinishTime);
230 pktCount[cpu_side_port_id][mem_side_port_id]++;
231 pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size;
243 reqLayers[mem_side_port_id]->recvRetry();
261 pktCount[cpu_side_port_id][mem_side_port_id]++;
262 pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size;
267 Tick response_latency = backdoor ?
268 mem_side_port->sendAtomicBackdoor(pkt, *backdoor) :
269 mem_side_port->sendAtomic(pkt);
277 pktCount[cpu_side_port_id][mem_side_port_id]++;
278 pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size;
284 return response_latency;
292 memSidePorts[dest_id]->sendMemBackdoorReq(req, backdoor);
301 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
311 if (
p->trySatisfyFunctional(pkt)) {
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 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.
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
std::vector< QueuedResponsePort * > cpuSidePorts
The memory-side ports and CPU-side ports of the crossbar.
const Cycles forwardLatency
statistics::Vector2d pktSize
void calcPacketTiming(PacketPtr pkt, Tick header_delay)
Calculate the timing parameters for the packet.
const Cycles responseLatency
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...
Cycles is a wrapper class for representing cycle counts, i.e.
const AddrRange & range() const
virtual std::string name() const
Declaration of the crossbar memory-side port type, one will be instantiated for each of the CPU-side ...
Declaration of the non-coherent crossbar CPU-side port type, one will be instantiated for each of the...
A non-coherent crossbar connects a number of non-snooping memory-side ports and cpu_sides,...
NoncoherentXBar(const NoncoherentXBarParams &p)
std::vector< RespLayer * > respLayers
Tick recvAtomicBackdoor(PacketPtr pkt, PortID cpu_side_port_id, MemBackdoorPtr *backdoor=nullptr)
void recvReqRetry(PortID mem_side_port_id)
virtual bool recvTimingReq(PacketPtr pkt, PortID cpu_side_port_id)
virtual bool recvTimingResp(PacketPtr pkt, PortID mem_side_port_id)
void recvMemBackdoorReq(const MemBackdoorReq &req, MemBackdoorPtr &backdoor)
virtual ~NoncoherentXBar()
void recvFunctional(PacketPtr pkt, PortID cpu_side_port_id)
std::vector< ReqLayer * > reqLayers
Declare the layers of this crossbar, one vector for requests and one for responses.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
bool needsResponse() const
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
int cmdToIndex() const
Return the index of this command.
RequestPtr req
A pointer to the original request.
bool isExpressSnoop() const
bool cacheResponding() const
const std::string name() const
Return port name (for DPRINTF).
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
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.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
Tick curTick()
The universal simulation clock.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
Declaration of a non-coherent crossbar.