Go to the documentation of this file.
51 #include "debug/SerialLink.hh"
52 #include "params/SerialLink.hh"
58 Cycles _delay,
int _resp_limit,
61 :
ResponsePort(_name, &_serial_link), serial_link(_serial_link),
62 mem_side_port(_mem_side_port), delay(_delay),
63 ranges(_ranges.begin(), _ranges.end()),
64 outstandingResponses(0), retryReq(false),
65 respQueueLimit(_resp_limit),
73 _cpu_side_port,
Cycles _delay,
75 :
RequestPort(_name, &_serial_link), serial_link(_serial_link),
76 cpu_side_port(_cpu_side_port), delay(_delay), reqQueueLimit(_req_limit),
96 if (if_name ==
"mem_side_port")
98 else if (if_name ==
"cpu_side_port")
110 fatal(
"Both ports of a serial_link must be connected.\n");
125 return transmitList.size() == reqQueueLimit;
148 * serial_link.link_speed));
149 Tick t = serial_link.clockEdge(cycles);
171 transmitList.size(), outstandingResponses);
177 }
else if ( !retryReq ) {
181 if (expects_response) {
182 if (respQueueFull()) {
188 assert(outstandingResponses != respQueueLimit);
189 ++outstandingResponses;
209 serial_link.num_lanes * serial_link.link_speed));
210 Tick t = serial_link.clockEdge(cycles);
245 if (transmitList.empty()) {
249 assert(transmitList.size() != reqQueueLimit);
262 if (transmitList.empty()) {
272 assert(!transmitList.empty());
281 pkt->
getAddr(), transmitList.size());
283 if (sendTimingReq(pkt)) {
285 transmitList.pop_front();
290 if (!transmitList.empty()) {
296 serial_link.num_lanes * serial_link.link_speed));
297 Tick t = serial_link.clockEdge(cycles);
315 assert(!transmitList.empty());
324 pkt->
getAddr(), outstandingResponses);
326 if (sendTimingResp(pkt)) {
328 transmitList.pop_front();
331 assert(outstandingResponses != 0);
332 --outstandingResponses;
335 if (!transmitList.empty()) {
341 serial_link.num_lanes * serial_link.link_speed));
342 Tick t = serial_link.clockEdge(cycles);
384 for (
auto i = transmitList.begin();
i != transmitList.end(); ++
i) {
406 auto i = transmitList.begin();
408 while (
i != transmitList.end() && !found) {
426 SerialLinkParams::create()
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
#define fatal(...)
This implements a cprintf based fatal() function.
void trySendTiming()
Handle send event, scheduled when the packet at the head of the response queue is ready to transmit (...
uint64_t link_speed
Speed of each link (Gb/s) in this serial link.
A ResponsePort is a specialization of a port.
bool cacheResponding() const
SerialLinkResponsePort(const std::string &_name, SerialLink &_serial_link, SerialLinkRequestPort &_mem_side_port, Cycles _delay, int _resp_limit, const std::vector< AddrRange > &_ranges)
Constructor for the SerialLinkResponsePort.
void recvFunctional(PacketPtr pkt)
When receiving a Functional request from the peer port, pass it to the serial_link.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Tick recvAtomic(PacketPtr pkt)
When receiving a Atomic requestfrom the peer port, pass it to the serial_link.
uint64_t Tick
Tick count type.
void schedTimingResp(PacketPtr pkt, Tick when)
Queue a response packet to be sent out later and also schedule a send if necessary.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
void schedTimingReq(PacketPtr pkt, Tick when)
Queue a request packet to be sent out later and also schedule a send if necessary.
bool recvTimingReq(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the serial_link.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
SerialLinkResponsePort cpu_side_port
Response port of the serial_link.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
void recvRespRetry()
When receiving a retry request from the peer port, pass it to the serial_link.
T divCeil(const T &a, const U &b)
AddrRangeList getAddrRanges() const
When receiving a address range request the peer port, pass it to the serial_link.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
bool trySatisfyFunctional(PacketPtr pkt)
Check a functional request against the packets in our request queue.
Ports are used to interface objects to each other.
bool needsResponse() const
void recvReqRetry()
When receiving a retry request from the peer port, pass it to the serial_link.
SerialLink(SerialLinkParams *p)
bool reqQueueFull() const
Is this side blocked from accepting new request packets.
unsigned int respQueueLimit
Max queue size for reserved responses.
bool respQueueFull() const
Is this side blocked from accepting new response packets.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
void retryStalledReq()
Retry any stalled request that we have failed to accept at an earlier point in time.
virtual const std::string name() const
SerialLink is a simple variation of the Bridge class, with the ability to account for the latency of ...
bool recvTimingResp(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the serial_link.
Cycles ticksToCycles(Tick t) const
unsigned int outstandingResponses
Counter to track the outstanding responses.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
A deferred packet stores a packet along with its scheduled transmission time.
bool isConnected() const
Is this port currently connected to a peer?
Cycles is a wrapper class for representing cycle counts, i.e.
Port on the side that forwards requests and receives responses.
SerialLinkRequestPort(const std::string &_name, SerialLink &_serial_link, SerialLinkResponsePort &_cpu_side_port, Cycles _delay, int _req_limit)
Constructor for the SerialLinkRequestPort.
The port on the side that receives requests and sends responses.
void trySendTiming()
Handle send event, scheduled when the packet at the head of the outbound queue is ready to transmit (...
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
void sendRangeChange() const
Called by the owner to send a range change.
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
unsigned num_lanes
Number of parallel lanes in this serial link.
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
SerialLinkRequestPort mem_side_port
Request port of the serial_link.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17