45 memSidePort(
name() +
"-mem_side_port", *this),
46 cpuSidePort(
name() +
"-cpu_side_port", *this)
54 fatal(
"Address mapper is not connected on both sides.\n");
60 if (if_name ==
"mem_side_port") {
62 }
else if (if_name ==
"cpu_side_port") {
95 if (backdoor !=
nullptr) {
127 if (backdoor !=
nullptr) {
140 if (needsResponse && !cacheResponding) {
168 if (receivedState == NULL)
169 panic(
"AddrMapper %s got a response without sender state\n",
184 delete receivedState;
210 fatal(
"AddrMapper doesn't support remapping of snooping requests\n");
234 originalRanges(
p.original_ranges),
235 remappedRanges(
p.remapped_ranges),
236 backdoorManager(originalRanges, remappedRanges)
239 fatal(
"AddrMapper: original and shadowed range list must "
244 fatal(
"AddrMapper: original and shadowed range list elements"
245 " aren't all of the same size\n");
Addr origAddr
The original address the packet was destined for.
An address mapper changes the packet addresses in going from the response port side of the mapper to ...
MapperRequestPort memSidePort
Instance of request port, facing the memory side.
virtual MemBackdoorPtr getRevertedBackdoor(MemBackdoorPtr &backdoor, const AddrRange &range)=0
This function returns a backdoor that fulfills the initiator request, based on the target backdoor at...
virtual void recvRangeChange()
Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
MapperResponsePort cpuSidePort
Instance of response port, i.e.
Tick recvAtomicSnoop(PacketPtr pkt)
bool recvTimingResp(PacketPtr pkt)
void recvMemBackdoorReq(const MemBackdoorReq &req, MemBackdoorPtr &backdoor)
void recvFunctionalSnoop(PacketPtr pkt)
bool recvTimingReq(PacketPtr pkt)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void recvTimingSnoopReq(PacketPtr pkt)
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void recvFunctional(PacketPtr pkt)
bool recvTimingSnoopResp(PacketPtr pkt)
Tick recvAtomic(PacketPtr pkt)
virtual Addr remapAddr(Addr addr) const =0
This function does the actual remapping of one address to another.
AddrMapper(const AddrMapperParams ¶ms)
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
MemBackdoorPtr getRevertedBackdoor(MemBackdoorPtr backdoor, const AddrRange &pkt_range)
const AddrRange & range() const
MemBackdoor::Flags flags() const
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
AddrRange getAddrRange() const
Get address range to which this packet belongs.
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
bool needsResponse() const
SenderState * senderState
This packet's sender state.
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
bool cacheResponding() const
Ports are used to interface objects to each other.
bool isConnected() const
Is this port currently connected to a peer?
MemBackdoorPtr getRevertedBackdoor(MemBackdoorPtr &backdoor, const AddrRange &range) override
This function returns a backdoor that fulfills the initiator request, based on the target backdoor at...
std::vector< AddrRange > originalRanges
This contains a list of ranges the should be remapped.
std::vector< AddrRange > remappedRanges
This contains a list of ranges that addresses should be remapped to.
RangeAddrMapper(const RangeAddrMapperParams &p)
Addr remapAddr(Addr addr) const override
This function does the actual remapping of one address to another.
AddrRangeList getAddrRanges() const override
BackdoorManager backdoorManager
void sendMemBackdoorReq(const MemBackdoorReq &req, MemBackdoorPtr &backdoor)
Send a request for a back door to a range of memory.
virtual void sendRetryResp()
Send a retry to the response port that previously attempted a sendTimingResp to this request port and...
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
bool sendTimingSnoopResp(PacketPtr pkt)
Attempt to send a timing snoop response packet to the response port by calling its corresponding rece...
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
Tick sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
Send an atomic request packet like above, but also request a backdoor to the data being accessed.
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the request port by calling its corresponding receive function.
void sendFunctionalSnoop(PacketPtr pkt) const
Send a functional snoop request packet, where the data is instantly updated everywhere in the memory ...
Tick sendAtomicSnoop(PacketPtr pkt)
Send an atomic snoop request packet, where the data is moved and the state is updated in zero time,...
void sendTimingSnoopReq(PacketPtr pkt)
Attempt to send a timing snoop request packet to the request port by calling its corresponding receiv...
bool isSnooping() const
Find out if the peer request port is snooping or not.
void sendRangeChange() const
Called by the owner to send a range change.
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
Abstract superclass for simulation objects.
Addr end() const
Get the end address of the range.
Addr start() const
Get the start address of the range.
#define panic(...)
This implements a cprintf based panic() function.
#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 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
SenderState * predecessor
const std::string & name()