59 #ifndef __MEM_PORT_PROXY_HH__ 60 #define __MEM_PORT_PROXY_HH__ 98 panic(
"Port proxies should never receive snoops.");
102 PortProxy(SendFunctionalFunc func,
unsigned int cacheLineSize) :
103 sendFunctional(func), _cacheLineSize(cacheLineSize)
106 sendFunctional([&port](
PacketPtr pkt)->void {
120 void *
p,
int size)
const;
126 const void *p,
int size)
const;
132 uint8_t
v,
int size)
const;
182 fatal(
"readBlob(%#x, ...) failed", addr);
192 fatal(
"writeBlob(%#x, ...) failed", addr);
202 fatal(
"memsetBlob(%#x, ...) failed", addr);
208 template <
typename T>
214 template <
typename T>
221 template <
typename T>
228 template <
typename T>
244 fatal(
"writeString(%#x, ...) failed", addr);
260 fatal(
"readString(%#x, ...) failed", addr);
277 fatal(
"readString(%#x, ...) failed", addr);
282 template <
typename T>
287 readBlob(address, &data,
sizeof(T));
291 template <
typename T>
298 template <
typename T>
303 readBlob(address, &data,
sizeof(T));
304 return gtoh(data, byte_order);
307 template <
typename T>
311 data =
htog(data, byte_order);
315 #endif // __MEM_PORT_PROXY_HH__ A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
#define panic(...)
This implements a cprintf based panic() function.
#define fatal(...)
This implements a cprintf based fatal() function.
T gtoh(T value, ByteOrder guest_byte_order)
virtual bool tryWriteBlob(Addr addr, const void *p, int size) const
Write size bytes from p to address.
virtual bool tryReadBlob(Addr addr, void *p, int size) const
Methods to override in base classes.
void writeBlobPhys(Addr addr, Request::Flags flags, const void *p, int size) const
Write size bytes from p to physical address.
const unsigned int _cacheLineSize
Granularity of any transactions issued through this proxy.
void readBlobPhys(Addr addr, Request::Flags flags, void *p, int size) const
Fixed functionality for use in base classes.
void writeString(Addr addr, const char *str) const
Same as tryWriteString, but insists on success.
PortProxy(const MasterPort &port, unsigned int cacheLineSize)
T read(Addr address) const
Read sizeof(T) bytes from address and return as object T.
bool tryWriteString(Addr addr, const char *str) const
Write the string str into guest memory at address addr.
virtual bool tryMemsetBlob(Addr addr, uint8_t val, int size) const
Fill size bytes starting at addr with byte value val.
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
void memsetBlobPhys(Addr addr, Request::Flags flags, uint8_t v, int size) const
Fill size bytes starting at physical addr with byte value val.
T htog(T value, ByteOrder guest_byte_order)
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
void memsetBlob(Addr addr, uint8_t v, int size) const
Same as tryMemsetBlob, but insists on success.
void readString(char *str, Addr addr, size_t maxlen) const
Same as tryReadString, but insists on success.
SendFunctionalFunc sendFunctional
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...
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
This object is a proxy for a port or other object which implements the functional response protocol...
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
std::function< void(PacketPtr pkt)> SendFunctionalFunc
PortProxy(SendFunctionalFunc func, unsigned int cacheLineSize)
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void write(Addr address, const T &data) const
Write object T to address.
bool tryReadString(std::string &str, Addr addr) const
Reads the string at guest address addr into the std::string str.