43 #ifndef __ARCH_GENERIC_MEMHELPERS_HH__
44 #define __ARCH_GENERIC_MEMHELPERS_HH__
46 #include "arch/isa_traits.hh"
56 template <
class XC,
class MemT>
61 return xc->initiateMemRead(addr,
sizeof(MemT), flags);
69 mem = pkt->
get<MemT>();
75 template <
class XC,
class MemT>
80 memset(&mem, 0,
sizeof(mem));
81 Fault fault = xc->readMem(addr, (uint8_t *)&mem,
sizeof(MemT), flags);
91 template <
class XC,
class MemT>
100 return xc->writeMem((uint8_t *)&mem,
sizeof(MemT), addr, flags, res);
104 template <
class XC,
class MemT>
114 xc->writeMem((uint8_t *)&host_mem,
sizeof(MemT), addr, flags, res);
115 if (fault ==
NoFault && res != NULL) {
void getMem(PacketPtr pkt, MemT &mem, Trace::InstRecord *traceData)
Extract the data returned from a timing mode read.
Fault writeMemTiming(XC *xc, Trace::InstRecord *traceData, MemT mem, Addr addr, Request::Flags flags, uint64_t *res)
Write to memory in timing mode.
decltype(nullptr) constexpr NoFault
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
This request is for a memory swap.
Fault initiateMemRead(XC *xc, Trace::InstRecord *traceData, Addr addr, MemT &mem, Request::Flags flags)
Initiate a read from memory in timing mode.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
Fault writeMemAtomic(XC *xc, Trace::InstRecord *traceData, const MemT &mem, Addr addr, Request::Flags flags, uint64_t *res)
Write to memory in atomic mode.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
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...
Declaration of the Packet class.
Fault readMemAtomic(XC *xc, Trace::InstRecord *traceData, Addr addr, MemT &mem, Request::Flags flags)
Read from memory in atomic mode.
std::shared_ptr< FaultBase > Fault