Go to the documentation of this file.
51 #include "debug/SerialLink.hh"
52 #include "params/SerialLink.hh"
61 Cycles _delay,
int _resp_limit,
65 mem_side_port(_mem_side_port), delay(_delay),
66 ranges(_ranges.begin(), _ranges.end()),
67 outstandingResponses(0), retryReq(false),
68 respQueueLimit(_resp_limit),
76 _cpu_side_port,
Cycles _delay,
79 cpu_side_port(_cpu_side_port), delay(_delay), reqQueueLimit(_req_limit),
98 if (if_name ==
"mem_side_port")
100 else if (if_name ==
"cpu_side_port")
112 fatal(
"Both ports of a serial_link must be connected.\n");
127 return transmitList.size() == reqQueueLimit;
150 * serial_link.link_speed));
151 Tick t = serial_link.clockEdge(cycles);
173 transmitList.size(), outstandingResponses);
179 }
else if ( !retryReq ) {
183 if (expects_response) {
184 if (respQueueFull()) {
190 assert(outstandingResponses != respQueueLimit);
191 ++outstandingResponses;
211 serial_link.num_lanes * serial_link.link_speed));
212 Tick t = serial_link.clockEdge(cycles);
247 if (transmitList.empty()) {
251 assert(transmitList.size() != reqQueueLimit);
264 if (transmitList.empty()) {
274 assert(!transmitList.empty());
283 pkt->
getAddr(), transmitList.size());
285 if (sendTimingReq(pkt)) {
287 transmitList.pop_front();
292 if (!transmitList.empty()) {
298 serial_link.num_lanes * serial_link.link_speed));
299 Tick t = serial_link.clockEdge(cycles);
317 assert(!transmitList.empty());
326 pkt->
getAddr(), outstandingResponses);
328 if (sendTimingResp(pkt)) {
330 transmitList.pop_front();
333 assert(outstandingResponses != 0);
334 --outstandingResponses;
337 if (!transmitList.empty()) {
343 serial_link.num_lanes * serial_link.link_speed));
344 Tick t = serial_link.clockEdge(cycles);
386 for (
auto i = transmitList.begin();
i != transmitList.end(); ++
i) {
408 auto i = transmitList.begin();
410 while (
i != transmitList.end() && !found) {
Tick curTick()
The universal simulation clock.
#define fatal(...)
This implements a cprintf based fatal() function.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
unsigned int outstandingResponses
Counter to track the outstanding responses.
bool trySatisfyFunctional(PacketPtr pkt)
Check a functional request against the packets in our request queue.
unsigned int respQueueLimit
Max queue size for reserved responses.
bool recvTimingResp(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the serial_link.
void recvReqRetry()
When receiving a retry request from the peer port, pass it to the serial_link.
Tick recvAtomic(PacketPtr pkt)
When receiving a Atomic requestfrom the peer port, pass it to the serial_link.
Port on the side that forwards requests and receives responses.
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
SerialLink is a simple variation of the Bridge class, with the ability to account for the latency of ...
bool cacheResponding() const
void retryStalledReq()
Retry any stalled request that we have failed to accept at an earlier point in time.
bool respQueueFull() const
Is this side blocked from accepting new response packets.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Cycles is a wrapper class for representing cycle counts, i.e.
AddrRangeList getAddrRanges() const
When receiving a address range request 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...
uint64_t link_speed
Speed of each link (Gb/s) in this serial link.
SerialLinkRequestPort(const std::string &_name, SerialLink &_serial_link, SerialLinkResponsePort &_cpu_side_port, Cycles _delay, int _req_limit)
Constructor for the SerialLinkRequestPort.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void schedTimingResp(PacketPtr pkt, Tick when)
Queue a response packet to be sent out later and also schedule a send if necessary.
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void recvRespRetry()
When receiving a retry request from the peer port, pass it to the serial_link.
void schedTimingReq(PacketPtr pkt, Tick when)
Queue a request packet to be sent out later and also schedule a send if necessary.
uint64_t Tick
Tick count type.
SerialLink(const SerialLinkParams &p)
bool isConnected() const
Is this port currently connected to a peer?
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
bool recvTimingReq(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the serial_link.
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 popLabel()
Pop label for PrintReq (safe to call unconditionally).
void trySendTiming()
Handle send event, scheduled when the packet at the head of the response queue is ready to transmit (...
bool needsResponse() const
void recvFunctional(PacketPtr pkt)
When receiving a Functional request from the peer port, pass it to the serial_link.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void sendRangeChange() const
Called by the owner to send a range change.
void trySendTiming()
Handle send event, scheduled when the packet at the head of the outbound queue is ready to transmit (...
static constexpr T divCeil(const T &a, const U &b)
A ResponsePort is a specialization of a port.
SerialLinkResponsePort cpu_side_port
Response port of the serial_link.
Ports are used to interface objects to each other.
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
unsigned num_lanes
Number of parallel lanes in this serial link.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
Cycles ticksToCycles(Tick t) const
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
A deferred packet stores a packet along with its scheduled transmission time.
bool reqQueueFull() const
Is this side blocked from accepting new request packets.
SerialLinkRequestPort mem_side_port
Request port of the serial_link.
The port on the side that receives requests and sends responses.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17