40#include "params/MemDelay.hh"
41#include "params/SimpleMemDelay.hh"
60 fatal(
"Memory delay is not connected on both sides.\n");
67 if (if_name ==
"mem_side_port") {
69 }
else if (if_name ==
"cpu_side_port") {
99 parent.responsePort.schedTimingResp(pkt, when);
107 if (
parent.trySatisfyFunctional(pkt)) {
110 parent.responsePort.sendFunctionalSnoop(pkt);
117 const Tick delay =
parent.delaySnoopResp(pkt);
119 return delay +
parent.responsePort.sendAtomicSnoop(pkt);
125 parent.responsePort.sendTimingSnoopReq(pkt);
141 return delay +
parent.requestPort.sendAtomic(pkt);
155 parent.requestPort.schedTimingReq(pkt, when);
163 if (
parent.trySatisfyFunctional(pkt)) {
166 parent.requestPort.sendFunctional(pkt);
175 parent.requestPort.schedTimingSnoopResp(pkt, when);
ClockedObject(const ClockedObjectParams &p)
Tick recvAtomicSnoop(PacketPtr pkt) override
Receive an atomic snoop request packet from our peer.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
RequestPort(const std::string &_name, MemDelay &_parent)
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the peer.
ResponsePort(const std::string &_name, MemDelay &_parent)
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the peer.
bool recvTimingSnoopResp(PacketPtr pkt) override
Receive a timing snoop response from the peer.
Tick recvAtomic(PacketPtr pkt) override
Receive an atomic request packet from the peer.
bool trySatisfyFunctional(PacketPtr pkt)
MemDelay(const MemDelayParams ¶ms)
RespPacketQueue respQueue
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
SnoopRespPacketQueue snoopRespQueue
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
ResponsePort responsePort
virtual std::string name() 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.
Ports are used to interface objects to each other.
QueuedRequestPort(const std::string &name, ReqPacketQueue &req_queue, SnoopRespPacketQueue &snoop_resp_queue, PortID id=InvalidPortID)
Create a QueuedPort with a given name, and a supplied implementation of two packet queues.
ReqPacketQueue & reqQueue
Packet queue used to store outgoing requests.
SnoopRespPacketQueue & snoopRespQueue
Packet queue used to store outgoing snoop responses.
RespPacketQueue & respQueue
Packet queue used to store outgoing responses.
QueuedResponsePort(const std::string &name, RespPacketQueue &resp_queue, PortID id=InvalidPortID)
Create a QueuedPort with a given name, owner, and a supplied implementation of a packet queue.
const Tick writeRespDelay
Tick delayReq(PacketPtr pkt) override
Delay a request by some number of ticks.
SimpleMemDelay(const SimpleMemDelayParams ¶ms)
Tick delayResp(PacketPtr pkt) override
Delay a response by some number of ticks.
#define fatal(...)
This implements a cprintf based fatal() function.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Copyright (c) 2024 Arm Limited All rights reserved.
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.