42 masterPort(
name() +
"-master", *this),
43 slavePort(
name() +
"-slave", *this)
51 fatal(
"Address mapper is not connected on both sides.\n");
57 if (if_name ==
"master") {
59 }
else if (if_name ==
"slave") {
111 if (needsResponse && !cacheResponding) {
139 if (receivedState == NULL)
140 panic(
"AddrMapper %s got a response without sender state\n",
155 delete receivedState;
181 fatal(
"AddrMapper doesn't support remapping of snooping requests\n");
205 originalRanges(p->original_ranges),
206 remappedRanges(p->remapped_ranges)
209 fatal(
"AddrMapper: original and shadowed range list must " 214 fatal(
"AddrMapper: original and shadowed range list elements" 215 " aren't all of the same size\n");
220 RangeAddrMapperParams::create()
#define panic(...)
This implements a cprintf based panic() function.
MapperMasterPort masterPort
Instance of master port, facing the memory side.
AddrMapper(const AddrMapperParams *params)
Ports are used to interface objects to each other.
Addr origAddr
The original address the packet was destined for.
void sendRangeChange() const
Called by the owner to send a range change.
Tick recvAtomicSnoop(PacketPtr pkt)
#define fatal(...)
This implements a cprintf based fatal() function.
void recvTimingSnoopReq(PacketPtr pkt)
const std::string & name()
MapperSlavePort slavePort
Instance of slave port, i.e.
bool sendTimingSnoopResp(PacketPtr pkt)
Attempt to send a timing snoop response packet to the slave port by calling its corresponding receive...
Tick sendAtomicSnoop(PacketPtr pkt)
Send an atomic snoop request packet, where the data is moved and the state is updated in zero time...
bool cacheResponding() const
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
bool isConnected() const
Is this port currently connected to a peer?
virtual void sendRetryResp()
Send a retry to the slave port that previously attempted a sendTimingResp to this master port and fai...
std::vector< AddrRange > originalRanges
This contains a list of ranges the should be remapped.
void sendFunctionalSnoop(PacketPtr pkt) const
Send a functional snoop request packet, where the data is instantly updated everywhere in the memory ...
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
RangeAddrMapper(const RangeAddrMapperParams *p)
bool sendTimingResp(PacketPtr pkt)
Attempt to send a timing response to the master port by calling its corresponding receive function...
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
bool needsResponse() const
SenderState * predecessor
uint64_t Tick
Tick count type.
void recvFunctional(PacketPtr pkt)
bool recvTimingReq(PacketPtr pkt)
virtual Addr remapAddr(Addr addr) const =0
This function does the actual remapping of one address to another.
bool recvTimingResp(PacketPtr pkt)
bool isSnooping() const
Find out if the peer master port is snooping or not.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
AddrRangeList getAddrRanges() const
bool recvTimingSnoopResp(PacketPtr pkt)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual const std::string name() const
void setAddr(Addr _addr)
Update the address of this packet mid-transaction.
An address mapper changes the packet addresses in going from the slave port side of the mapper to the...
void sendRetryReq()
Send a retry to the master port that previously attempted a sendTimingReq to this slave port and fail...
SenderState * senderState
This packet's sender state.
Tick recvAtomic(PacketPtr pkt)
Range address mapper that maps a set of original ranges to a set of remapped ranges, where a specific range is of the same size (original and remapped), only with an offset.
void sendTimingSnoopReq(PacketPtr pkt)
Attempt to send a timing snoop request packet to the master port by calling its corresponding receive...
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...
void recvFunctionalSnoop(PacketPtr pkt)
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time...
std::vector< AddrRange > remappedRanges
This contains a list of ranges that addresses should be remapped to.
Abstract superclass for simulation objects.
Addr remapAddr(Addr addr) const
This function does the actual remapping of one address to another.