52#include "params/X86GPUTLB.hh"
166 bool timing,
int &latency);
207 Addr phys_page_addr);
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
A ResponsePort is a specialization of a port.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void recvRangeChange()
virtual void recvReqRetry()
virtual void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
virtual void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
virtual Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
virtual bool recvTimingReq(PacketPtr pkt)
recvTiming receives a coalesced timing request from a TLBCoalescer and it calls issueTLBLookup() It o...
CpuSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
MemSidePort is the TLB Port closer to the memory side If this is a last level TLB then this port will...
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
virtual bool recvTimingResp(PacketPtr pkt)
MemSidePort receives the packet back.
virtual Tick recvAtomic(PacketPtr pkt)
virtual void recvRangeChange()
Called to receive an address range change from the peer response port.
std::deque< PacketPtr > retries
virtual void recvFunctional(PacketPtr pkt)
MemSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
tlbOutcome outcome
outcome can be TLB_HIT, TLB_MISS, or PAGE_WALK
void updateOutcome(tlbOutcome _outcome)
TLBEvent(GpuTLB *_tlb, Addr _addr, tlbOutcome outcome, PacketPtr _pkt)
const char * description() const
Return a C string describing the event.
virtual void finish(Fault fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
The memory for this object may be dynamically allocated, and it may be responsible for cleaning itsle...
virtual void markDelayed()=0
Signal that the translation has been delayed due to a hw page table walk.
std::unordered_map< Addr, AccessInfo > AccessPatternTable
void issueTLBLookup(PacketPtr pkt)
Do the TLB lookup for this coalesced request and schedule another event <TLB access latency> cycles l...
std::unordered_map< Addr, TLBEvent * > translationReturnEvent
void translationReturn(Addr virtPageAddr, tlbOutcome outcome, PacketPtr pkt)
A TLBEvent is scheduled after the TLB lookup and helps us take the appropriate actions: (e....
void invalidateNonGlobal()
EventFunctionWrapper cleanupEvent
Tick doMmuRegRead(ThreadContext *tc, Packet *pkt)
EntryList::iterator lookupIt(Addr va, bool update_lru=true)
void printAccessPattern()
Fault translateInt(bool read, const RequestPtr &req, ThreadContext *tc)
std::list< TlbEntry * > EntryList
Fault translate(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, bool &delayedResponse, bool timing, int &latency)
AccessPatternTable TLBFootprint
void demapPage(Addr va, uint64_t asn)
virtual void unserialize(CheckpointIn &cp) override
Unserialize an object.
TlbEntry * lookup(Addr va, bool update_lru=true)
std::vector< TlbEntry > tlb
std::vector< MemSidePort * > memSidePort
bool accessDistance
Print out accessDistance stats.
EventFunctionWrapper exitEvent
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
std::queue< Addr > cleanupQueue
Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt)
bool FA
true if this is a fully-associative TLB
TlbEntry * insert(Addr vpn, TlbEntry &entry)
void updatePhysAddresses(Addr virt_page_addr, TlbEntry *tlb_entry, Addr phys_page_addr)
gem5::X86ISA::GpuTLB::GpuTLBStats stats
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, int &latency)
void handleFuncTranslationReturn(PacketPtr pkt, tlbOutcome outcome)
handleFuncTranslationReturn is called on a TLB hit, when a TLB miss returns or when a page fault retu...
std::vector< EntryList > freeList
std::vector< EntryList > entryList
An entryList per set is the equivalent of an LRU stack; it's used to guide replacement decisions.
virtual void serialize(CheckpointOut &cp) const override
Serialize an object.
void setConfigAddress(uint32_t addr)
bool hasMemSidePort
if true, then this is not the last level TLB
bool allocationPolicy
Allocation Policy: true if we always allocate on a hit, false otherwise.
void handleTranslationReturn(Addr addr, tlbOutcome outcome, PacketPtr pkt)
handleTranslationReturn is called on a TLB hit, when a TLB miss returns or when a page fault returns.
void updatePageFootprint(Addr virt_page_addr)
bool tlbLookup(const RequestPtr &req, ThreadContext *tc, bool update_stats)
TLB_lookup will only perform a TLB lookup returning true on a TLB hit and false on a TLB miss.
std::vector< CpuSidePort * > cpuSidePort
Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode, int &latency)
void pagingProtectionChecks(ThreadContext *tc, PacketPtr pkt, TlbEntry *tlb_entry, Mode mode)
Do Paging protection checks.
This is a simple scalar statistic, like a counter.
ClockedObject declaration and implementation.
#define panic(...)
This implements a cprintf based panic() function.
ProbePointArg< PacketInfo > Packet
Packet probe point.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
std::shared_ptr< Request > RequestPtr
const PortID InvalidPortID
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
Declaration of Statistics objects.
This hash map will use the virtual page address as a key and will keep track of total number of acces...
unsigned int accessesPerPage
std::vector< unsigned int > localTLBAccesses
The field below will help us compute the access distance, that is the number of (coalesced) TLB acces...
unsigned int totalReuseDistance
unsigned int lastTimeAccessed
unsigned int meanDistance
GpuTLBStats(statistics::Group *parent)
statistics::Formula localTLBMissRate
statistics::Scalar globalNumTLBMisses
statistics::Scalar localCycles
statistics::Formula globalTLBMissRate
statistics::Scalar localNumTLBHits
statistics::Scalar numUniquePages
statistics::Scalar avgReuseDistance
statistics::Scalar globalNumTLBHits
statistics::Formula localLatency
statistics::Scalar localNumTLBMisses
statistics::Scalar globalNumTLBAccesses
statistics::Scalar accessCycles
statistics::Scalar localNumTLBAccesses
statistics::Scalar pageTableCycles