42#ifndef __MEM_DRAMSIM2_HH__
43#define __MEM_DRAMSIM2_HH__
46#include <unordered_map>
51#include "params/DRAMSim2.hh"
201 void init()
override;
AbstractMemory declaration.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
A ResponsePort is a specialization of a port.
An abstract memory represents a contiguous block of physical memory, with an associated address range...
Wrapper class to avoid having DRAMSim2 names like ClockDomain etc clashing with the normal gem5 world...
The memory port has to deal with its own flow control to avoid having unbounded storage that is impli...
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
MemoryPort(const std::string &_name, DRAMSim2 &_memory)
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the peer.
AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
DRAMSim2Wrapper wrapper
The actual DRAMSim2 wrapper.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool retryResp
Are we waiting for a retry for sending a response.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void accessAndRespond(PacketPtr pkt)
When a packet is ready, use the "access()" method in AbstractMemory to actually create the response p...
EventFunctionWrapper tickEvent
Event to schedule clock ticks.
unsigned int nbrOutstanding() const
std::unique_ptr< Packet > pendingDelete
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent c...
void writeComplete(unsigned id, uint64_t addr, uint64_t cycle)
Write completion callback.
bool retryReq
Is the connected port waiting for a retry from us.
std::unordered_map< Addr, std::queue< PacketPtr > > outstandingWrites
bool recvTimingReq(PacketPtr pkt)
Tick startTick
Keep track of when the wrapper is started.
unsigned int nbrOutstandingReads
Count the number of outstanding transactions so that we can block any further requests until there is...
Tick recvAtomic(PacketPtr pkt)
std::unordered_map< Addr, std::queue< PacketPtr > > outstandingReads
Keep track of what packets are outstanding per address, and do so separately for reads and writes.
void startup() override
startup() is the final initialization call before simulation.
void recvFunctional(PacketPtr pkt)
DRAMSim2(const Params &p)
EventFunctionWrapper sendResponseEvent
Event to schedule sending of responses.
void readComplete(unsigned id, uint64_t addr, uint64_t cycle)
Read completion callback.
unsigned int nbrOutstandingWrites
std::deque< PacketPtr > responseQueue
Queue to hold response packets until we can send them back.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void tick()
Progress the controller one clock cycle.
DRAMSim2Wrapper declaration.
DrainState
Object drain/handover states.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
Declaration of the queued port.