57 #ifndef __MEM_PORT_PROXY_HH__ 58 #define __MEM_PORT_PROXY_HH__ 96 panic(
"Port proxies should never receive snoops.");
100 PortProxy(SendFunctionalFunc func,
unsigned int cacheLineSize) :
101 sendFunctional(func), _cacheLineSize(cacheLineSize)
104 sendFunctional([&port](
PacketPtr pkt)->void {
118 void *
p,
int size)
const;
124 const void *p,
int size)
const;
130 uint8_t
v,
int size)
const;
180 fatal(
"readBlob(%#x, ...) failed", addr);
190 fatal(
"writeBlob(%#x, ...) failed", addr);
200 fatal(
"memsetBlob(%#x, ...) failed", addr);
206 template <
typename T>
212 template <
typename T>
219 template <
typename T>
226 template <
typename T>
242 fatal(
"writeString(%#x, ...) failed", addr);
258 fatal(
"readString(%#x, ...) failed", addr);
275 fatal(
"readString(%#x, ...) failed", addr);
280 template <
typename T>
285 readBlob(address, &data,
sizeof(T));
289 template <
typename T>
296 template <
typename T>
301 readBlob(address, &data,
sizeof(T));
302 return gtoh(data, byte_order);
305 template <
typename T>
309 data =
htog(data, byte_order);
313 #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.