gem5 v24.0.0.0
|
This object is a proxy for a port or other object which implements the functional response protocol, to be used for debug accesses. More...
#include <port_proxy.hh>
Public Types | |
typedef std::function< void(PacketPtr pkt)> | SendFunctionalFunc |
Public Member Functions | |
PortProxy (SendFunctionalFunc func, Addr cache_line_size) | |
PortProxy (ThreadContext *tc, Addr cache_line_size) | |
PortProxy (const RequestPort &port, Addr cache_line_size) | |
virtual | ~PortProxy () |
void | readBlobPhys (Addr addr, Request::Flags flags, void *p, uint64_t size) const |
Fixed functionality for use in base classes. | |
void | writeBlobPhys (Addr addr, Request::Flags flags, const void *p, uint64_t size) const |
Write size bytes from p to physical address. | |
void | memsetBlobPhys (Addr addr, Request::Flags flags, uint8_t v, uint64_t size) const |
Fill size bytes starting at physical addr with byte value val. | |
virtual bool | tryReadBlob (Addr addr, void *p, uint64_t size) const |
Methods to override in base classes. | |
virtual bool | tryWriteBlob (Addr addr, const void *p, uint64_t size) const |
Write size bytes from p to address. | |
virtual bool | tryMemsetBlob (Addr addr, uint8_t val, uint64_t size) const |
Fill size bytes starting at addr with byte value val. | |
void | readBlob (Addr addr, void *p, uint64_t size) const |
Higher level interfaces based on the above. | |
void | writeBlob (Addr addr, const void *p, uint64_t size) const |
Same as tryWriteBlob, but insists on success. | |
void | memsetBlob (Addr addr, uint8_t v, uint64_t size) const |
Same as tryMemsetBlob, but insists on success. | |
template<typename T > | |
T | read (Addr address) const |
Read sizeof(T) bytes from address and return as object T. | |
template<typename T > | |
void | write (Addr address, const T &data) const |
Write object T to address. | |
template<typename T > | |
T | read (Addr address, ByteOrder guest_byte_order) const |
Read sizeof(T) bytes from address and return as object T. | |
template<typename T > | |
void | write (Addr address, T data, ByteOrder guest_byte_order) const |
Write object T to address. | |
bool | tryWriteString (Addr addr, const char *str) const |
Write the string str into guest memory at address addr. | |
void | writeString (Addr addr, const char *str) const |
Same as tryWriteString, but insists on success. | |
bool | tryReadString (std::string &str, Addr addr) const |
Reads the string at guest address addr into the std::string str. | |
void | readString (std::string &str, Addr addr) const |
Same as tryReadString, but insists on success. | |
bool | tryReadString (char *str, Addr addr, size_t maxlen) const |
Reads the string at guest address addr into the char * str, reading up to maxlen characters. | |
void | readString (char *str, Addr addr, size_t maxlen) const |
Same as tryReadString, but insists on success. | |
Private Member Functions | |
void | recvFunctionalSnoop (PacketPtr pkt) override |
Receive a functional snoop request packet from the peer. | |
Private Member Functions inherited from gem5::FunctionalRequestProtocol | |
void | send (FunctionalResponseProtocol *peer, PacketPtr pkt) const |
Send a functional request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block. | |
void | sendMemBackdoorReq (FunctionalResponseProtocol *peer, const MemBackdoorReq &req, MemBackdoorPtr &backdoor) |
Send a request for a back door to a range of memory. | |
Private Attributes | |
SendFunctionalFunc | sendFunctional |
const Addr | _cacheLineSize |
Granularity of any transactions issued through this proxy. | |
This object is a proxy for a port or other object which implements the functional response protocol, to be used for debug accesses.
This proxy object is used when non structural entities (e.g. thread contexts, object file loaders) need access to the memory system. It calls the corresponding functions on the underlying protocol, and provides templatized convenience access functions.
The addresses are interpreted as physical addresses.
Definition at line 86 of file port_proxy.hh.
typedef std::function<void(PacketPtr pkt)> gem5::PortProxy::SendFunctionalFunc |
Definition at line 89 of file port_proxy.hh.
|
inline |
Definition at line 106 of file port_proxy.hh.
gem5::PortProxy::PortProxy | ( | ThreadContext * | tc, |
Addr | cache_line_size ) |
Definition at line 47 of file port_proxy.cc.
gem5::PortProxy::PortProxy | ( | const RequestPort & | port, |
Addr | cache_line_size ) |
Definition at line 52 of file port_proxy.cc.
|
inlinevirtual |
Definition at line 114 of file port_proxy.hh.
|
inline |
Same as tryMemsetBlob, but insists on success.
Definition at line 202 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, tryMemsetBlob(), and gem5::ArmISA::v.
Referenced by gem5::Gicv3Its::moveAllPendingState(), and gem5::loader::MemoryImage::writeSegment().
void gem5::PortProxy::memsetBlobPhys | ( | Addr | addr, |
Request::Flags | flags, | ||
uint8_t | v, | ||
uint64_t | size ) const |
Fill size bytes starting at physical addr with byte value val.
Definition at line 92 of file port_proxy.cc.
References gem5::X86ISA::addr, and flags.
Referenced by tryMemsetBlob().
T gem5::PortProxy::read | ( | Addr | address | ) | const |
Read sizeof(T) bytes from address and return as object T.
Definition at line 287 of file port_proxy.hh.
References data, and readBlob().
Referenced by gem5::BaseSemihosting::callWriteC(), gem5::linux::ThreadInfo::curTaskInfo(), gem5::linux::ThreadInfo::curTaskMmFromTaskStruct(), gem5::linux::ThreadInfo::curTaskPIDFromTaskStruct(), gem5::linux::ThreadInfo::curTaskStartFromTaskStruct(), gem5::linux::ThreadInfo::curTaskTGIDFromTaskStruct(), gem5::linux::ThreadInfo::get_data(), and gem5::BaseSemihosting::InPlaceArg::read().
T gem5::PortProxy::read | ( | Addr | address, |
ByteOrder | guest_byte_order ) const |
Read sizeof(T) bytes from address and return as object T.
Performs endianness conversion from the selected guest to host order.
Definition at line 303 of file port_proxy.hh.
References data, gem5::gtoh(), and readBlob().
|
inline |
Higher level interfaces based on the above.
Same as tryReadBlob, but insists on success.
Definition at line 182 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, gem5::MipsISA::p, and tryReadBlob().
Referenced by gem5::BaseSemihosting::callWrite(), gem5::BaseBufferArg::copyIn(), gem5::guest_abi::Argument< Aapcs32, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > > >::get(), gem5::Gicv3Its::moveAllPendingState(), gem5::X86ISA::EmuLinux::pageFault(), read(), read(), gem5::VirtDescriptor::read(), gem5::VirtQueue::VirtRing< T >::read(), gem5::BaseRemoteGDB::readBlob(), gem5::Gicv3Redistributor::readEntryLPI(), gem5::VirtQueue::VirtRing< T >::readHeader(), gem5::trace::TarmacParserRecord::readMemNoEffect(), gem5::BaseSemihosting::readString(), gem5::readvFunc(), gem5::Process::replicatePage(), gem5::GPUCommandProcessor::submitDispatchPkt(), gem5::Gicv3Redistributor::update(), gem5::VirtDescriptor::update(), gem5::pseudo_inst::writefile(), and gem5::writevFunc().
void gem5::PortProxy::readBlobPhys | ( | Addr | addr, |
Request::Flags | flags, | ||
void * | p, | ||
uint64_t | size ) const |
Fixed functionality for use in base classes.
Read size bytes memory at physical address and store in p.
Definition at line 58 of file port_proxy.cc.
References gem5::X86ISA::addr, gem5::Packet::dataStatic(), gem5::ChunkGenerator::done(), and flags.
Referenced by tryReadBlob().
|
inline |
Same as tryReadString, but insists on success.
Definition at line 277 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, and tryReadString().
|
inline |
Same as tryReadString, but insists on success.
Definition at line 260 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, and tryReadString().
Referenced by gem5::pseudo_inst::addsymbol(), gem5::BaseSemihosting::callWrite0(), gem5::linux::ThreadInfo::curTaskNameFromTaskStruct(), gem5::linux::printk(), and gem5::pseudo_inst::writefile().
|
inlineoverrideprivatevirtual |
Receive a functional snoop request packet from the peer.
Implements gem5::FunctionalRequestProtocol.
Definition at line 98 of file port_proxy.hh.
References panic.
|
inlinevirtual |
Fill size bytes starting at addr with byte value val.
Returns true on success and false on failure.
Reimplemented in gem5::TranslatingPortProxy.
Definition at line 168 of file port_proxy.hh.
References gem5::X86ISA::addr, memsetBlobPhys(), and gem5::X86ISA::val.
Referenced by memsetBlob().
|
inlinevirtual |
Methods to override in base classes.
Read size bytes memory at address and store in p. Returns true on success and false on failure.
Reimplemented in gem5::TranslatingPortProxy.
Definition at line 146 of file port_proxy.hh.
References gem5::X86ISA::addr, gem5::MipsISA::p, and readBlobPhys().
Referenced by gem5::RiscvSemihosting::isSemihostingEBreak(), and readBlob().
bool gem5::PortProxy::tryReadString | ( | char * | str, |
Addr | addr, | ||
size_t | maxlen ) const |
Reads the string at guest address addr into the char * str, reading up to maxlen characters.
The last character read is always a nul terminator. Returns true on success and false on failure.
Definition at line 128 of file port_proxy.cc.
References gem5::X86ISA::addr.
bool gem5::PortProxy::tryReadString | ( | std::string & | str, |
Addr | addr ) const |
Reads the string at guest address addr into the std::string str.
Returns true on success and false on failure.
Definition at line 115 of file port_proxy.cc.
References gem5::X86ISA::addr, and c.
Referenced by gem5::execveFunc(), gem5::linkFunc(), readString(), readString(), gem5::renameatFunc(), gem5::renameFunc(), and gem5::symlinkFunc().
|
inlinevirtual |
Write size bytes from p to address.
Returns true on success and false on failure.
Reimplemented in gem5::TranslatingPortProxy.
Definition at line 157 of file port_proxy.hh.
References gem5::X86ISA::addr, gem5::MipsISA::p, and writeBlobPhys().
Referenced by writeBlob().
bool gem5::PortProxy::tryWriteString | ( | Addr | addr, |
const char * | str ) const |
Write the string str into guest memory at address addr.
Returns true on success and false on failure.
Definition at line 105 of file port_proxy.cc.
References gem5::X86ISA::addr.
Referenced by writeString().
void gem5::PortProxy::write | ( | Addr | address, |
const T & | data ) const |
Write object T to address.
Writes sizeof(T) bytes.
Definition at line 296 of file port_proxy.hh.
References data, and writeBlob().
Referenced by gem5::BaseSemihosting::callHeapInfo32(), gem5::BaseSemihosting::callHeapInfo64(), and gem5::BaseSemihosting::InPlaceArg::write().
void gem5::PortProxy::write | ( | Addr | address, |
T | data, | ||
ByteOrder | guest_byte_order ) const |
Write object T to address.
Writes sizeof(T) bytes. Performs endianness conversion from host to the selected guest order.
Definition at line 312 of file port_proxy.hh.
References data, gem5::htog(), and writeBlob().
|
inline |
Same as tryWriteBlob, but insists on success.
Definition at line 192 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, gem5::MipsISA::p, and tryWriteBlob().
Referenced by gem5::BaseSemihosting::callGetCmdLine(), gem5::BaseSemihosting::callRead(), gem5::BaseSemihosting::callTmpNam(), gem5::BaseBufferArg::copyOut(), gem5::copyStringArray(), gem5::VMA::fillMemPages(), gem5::ArmISA::FsLinux::initState(), gem5::ArmLinuxProcess32::initState(), gem5::X86ISA::X86_64Process::initState(), gem5::Gicv3Its::moveAllPendingState(), gem5::SimpleDisk::read(), gem5::pseudo_inst::readfile(), gem5::readvFunc(), gem5::Process::replicatePage(), gem5::ArmISA::setTLSFunc32(), write(), write(), gem5::VirtDescriptor::write(), gem5::VirtQueue::VirtRing< T >::write(), gem5::X86ISA::ACPI::RSDP::write(), gem5::BaseRemoteGDB::writeBlob(), gem5::X86ISA::ACPI::SysDescTable::writeBuf(), gem5::Gicv3Redistributor::writeEntryLPI(), gem5::VirtQueue::VirtRing< T >::writeHeader(), gem5::X86ISA::intelmp::BaseConfigEntry::writeOut(), gem5::X86ISA::intelmp::BusHierarchy::writeOut(), gem5::X86ISA::intelmp::ConfigTable::writeOut(), gem5::X86ISA::intelmp::ExtConfigEntry::writeOut(), gem5::X86ISA::intelmp::FloatingPointer::writeOut(), gem5::X86ISA::intelmp::Processor::writeOut(), gem5::X86ISA::smbios::BiosInformation::writeOut(), gem5::X86ISA::smbios::SMBiosStructure::writeOut(), gem5::X86ISA::smbios::SMBiosTable::writeOut(), gem5::writeOutField(), gem5::writeOutString(), gem5::X86ISA::smbios::SMBiosStructure::writeOutStrings(), gem5::loader::MemoryImage::writeSegment(), gem5::X86ISA::E820Table::writeTo(), and gem5::writeVal().
void gem5::PortProxy::writeBlobPhys | ( | Addr | addr, |
Request::Flags | flags, | ||
const void * | p, | ||
uint64_t | size ) const |
Write size bytes from p to physical address.
Definition at line 75 of file port_proxy.cc.
References gem5::X86ISA::addr, gem5::Packet::dataStaticConst(), gem5::ChunkGenerator::done(), and flags.
Referenced by tryWriteBlob().
|
inline |
Same as tryWriteString, but insists on success.
Definition at line 244 of file port_proxy.hh.
References gem5::X86ISA::addr, fatal, and tryWriteString().
Referenced by gem5::copyStringArray().
|
private |
Granularity of any transactions issued through this proxy.
Definition at line 95 of file port_proxy.hh.
|
private |
Definition at line 92 of file port_proxy.hh.