Go to the documentation of this file.
45 #include "debug/Drain.hh"
49 port(
name() +
".port", *this), latency(
p->latency),
50 latency_var(
p->latency_var), bandwidth(
p->bandwidth), isBusy(false),
51 retryReq(false), retryResp(false),
53 dequeueEvent([
this]{ dequeue(); },
name())
114 "Should only see read and writes at memory controller, "
173 !
i->pkt->matchAddr(pkt))
219 DPRINTF(Drain,
"Draining of SimpleMemory complete\n");
243 if (if_name !=
"port") {
254 DPRINTF(Drain,
"SimpleMemory Queue has requests, waiting to drain\n");
270 ranges.push_back(
memory.getAddrRange());
277 return memory.recvAtomic(pkt);
284 return memory.recvAtomicBackdoor(pkt, _backdoor);
290 memory.recvFunctional(pkt);
296 return memory.recvTimingReq(pkt);
306 SimpleMemoryParams::create()
bool scheduled() const
Determine if the current event is scheduled.
std::list< DeferredPacket > packetQueue
Internal (unbounded) storage to mimic the delay caused by the actual memory access.
A ResponsePort is a specialization of a port.
EventFunctionWrapper dequeueEvent
Tick recvAtomic(PacketPtr pkt) override
Receive an atomic request packet from the peer.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool cacheResponding() const
void release()
Release the memory after being busy and send a retry if a request was rejected in the meanwhile.
Tick getLatency() const
Detemine the latency.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
Tick recvAtomic(PacketPtr pkt)
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
void reschedule(Event &event, Tick when, bool always=false)
void recvFunctional(PacketPtr pkt)
The simple memory is a basic single-ported memory controller with a configurable throughput and laten...
uint64_t Tick
Tick count type.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the peer.
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
bool recvTimingReq(PacketPtr pkt)
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
void functionalAccess(PacketPtr pkt)
Perform an untimed memory read or write without changing anything but the memory itself.
bool retryResp
Remember if we failed to send a response and are awaiting a retry.
@ Drained
Buffers drained, ready for serialization/handover.
DrainState
Object drain/handover states.
Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &_backdoor)
An abstract memory represents a contiguous block of physical memory, with an associated address range...
void recvRespRetry() override
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
void schedule(Event &event, Tick when)
EventFunctionWrapper releaseEvent
void access(PacketPtr pkt)
Perform an untimed memory access and update all the state (e.g.
void dequeue()
Dequeue a packet from our internal packet queue and move it to the port where it will be sent as soon...
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
SimpleMemory(const SimpleMemoryParams *p)
bool retryReq
Remember if we have to retry an outstanding request that arrived while we were busy.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Ports are used to interface objects to each other.
bool needsResponse() const
A deferred packet stores a packet along with its scheduled transmission time.
void signalDrainDone() const
Signal that an object is drained.
bool isBusy
Track the state of the memory as either idle or busy, no need for an enum with only two states.
AddrRangeList getAddrRanges() const override
Get a list of the non-overlapping address ranges the owner is responsible for.
const double bandwidth
Bandwidth in ticks per byte.
const std::string & name()
std::unique_ptr< Packet > pendingDelete
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent c...
DrainState drainState() const
Return the current drain state of an object.
virtual const std::string name() const
Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &_backdoor) override
Default implementations.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the peer.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool isConnected() const
Is this port currently connected to a peer?
const Tick latency_var
Fudge factor added to the latency.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
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.
const Tick latency
Latency from that a request is accepted until the response is ready to be sent.
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
@ Draining
Draining buffers pending serialization/handover.
MemoryPort(const std::string &_name, SimpleMemory &_memory)
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17