36 #ifndef __GPU_TLB_HH__
37 #define __GPU_TLB_HH__
56 #include "params/X86GPUTLB.hh"
69 :
TlbEntry(asn, _vaddr, _paddr, false, false),
valid(_valid) { }
195 bool timing,
int &latency);
264 Addr phys_page_addr);
371 bool _prefetch=
false,
465 #endif // __GPU_TLB_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
AccessPatternTable TLBFootprint
unsigned int accessesPerPage
Stats::Formula globalTLBMissRate
bool allocationPolicy
Allocation Policy: true if we always allocate on a hit, false otherwise.
Stats::Scalar localCycles
const char * description() const
Return a C string describing the event.
virtual void serialize(CheckpointOut &cp) const
Serialize an object.
const PortID InvalidPortID
TLB TranslationState: this currently is a somewhat bastardization of the usage of SenderState...
Stats::Scalar avgReuseDistance
void translationReturn(Addr virtPageAddr, tlbOutcome outcome, PacketPtr pkt)
A TLBEvent is scheduled after the TLB lookup and helps us take the appropriate actions: (e...
virtual void recvRespRetry()
Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to ...
CpuSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
void handleFuncTranslationReturn(PacketPtr pkt, tlbOutcome outcome)
handleFuncTranslationReturn is called on a TLB hit, when a TLB miss returns or when a page fault retu...
Stats::Scalar accessCycles
Stats::Formula localTLBMissRate
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
unsigned int meanDistance
Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode, int &latency)
EntryList::iterator lookupIt(Addr va, bool update_lru=true)
Tick tickToCycles(Tick val) const
MemSidePort is the TLB Port closer to the memory side If this is a last level TLB then this port will...
bool hasMemSidePort
if true, then this is not the last level TLB
unsigned int totalReuseDistance
Tick doMmuRegRead(ThreadContext *tc, Packet *pkt)
unsigned int lastTimeAccessed
A SlavePort is a specialisation of a port.
void translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode, int &latency)
Stats::Scalar localNumTLBMisses
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
std::vector< GpuTlbEntry > tlb
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
GpuTlbEntry * lookup(Addr va, bool update_lru=true)
TLBEvent(GpuTLB *_tlb, Addr _addr, tlbOutcome outcome, PacketPtr _pkt)
virtual void recvReqRetry()
Called by the slave port if sendTimingReq was called on this master port (causing recvTimingReq to be...
Stats::Scalar numUniquePages
Stats::Scalar globalNumTLBMisses
std::queue< Addr > cleanupQueue
std::vector< MemSidePort * > memSidePort
bool accessDistance
Print out accessDistance stats.
GpuTlbEntry(Addr asn, Addr _vaddr, Addr _paddr, bool _valid)
Tick curTick()
The current simulated tick.
virtual void markDelayed()=0
Signal that the translation has been delayed due to a hw page table walk.
Fault translateInt(RequestPtr req, ThreadContext *tc)
std::deque< PacketPtr > retries
void regStats()
Register statistics for this object.
Stats::Formula localLatency
void pagingProtectionChecks(ThreadContext *tc, PacketPtr pkt, GpuTlbEntry *tlb_entry, Mode mode)
Do Paging protection checks.
virtual Tick recvAtomic(PacketPtr pkt)
std::vector< EntryList > entryList
An entryList per set is the equivalent of an LRU stack; it's used to guide replacement decisions...
void invalidateNonGlobal()
uint64_t Tick
Tick count type.
Fault translate(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode, bool &delayedResponse, bool timing, int &latency)
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
void setConfigAddress(uint32_t addr)
virtual bool recvTimingResp(PacketPtr pkt)
MemSidePort receives the packet back.
MemSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
This hash map will use the virtual page address as a key and will keep track of total number of acces...
bool tlbLookup(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...
void demapPage(Addr va, uint64_t asn)
virtual void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the master port.
TlbEntry(Addr asn, Addr _vaddr, Addr _paddr, bool uncacheable, bool read_only)
virtual void recvRangeChange()
Called to receive an address range change from the peer slave port.
std::unordered_map< Addr, TLBEvent * > translationReturnEvent
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...
virtual void recvFunctional(PacketPtr pkt)
std::vector< CpuSidePort * > cpuSidePort
Stats::Scalar globalNumTLBAccesses
void updateOutcome(tlbOutcome _outcome)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Packet::SenderState * saved
std::vector< EntryList > freeList
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
virtual void finish(Fault fault, RequestPtr req, ThreadContext *tc, Mode mode)=0
The memory for this object may be dynamically allocated, and it may be responsible for cleaning itsle...
A virtual base opaque structure used to hold state associated with the packet (e.g., an MSHR), specific to a MemObject that sees the packet.
Tick ticks(int numCycles) const
std::unordered_map< Addr, AccessInfo > AccessPatternTable
virtual Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the master port.
EventWrapper< GpuTLB,&GpuTLB::cleanup > cleanupEvent
void updatePhysAddresses(Addr virt_page_addr, GpuTlbEntry *tlb_entry, Addr phys_page_addr)
std::list< GpuTlbEntry * > EntryList
virtual bool recvTimingReq(PacketPtr pkt)
Receive a timing request from the master port.
virtual void unserialize(CheckpointIn &cp)
Unserialize an object.
std::vector< unsigned int > localTLBAccesses
The field below will help us compute the access distance, that is the number of (coalesced) TLB acces...
std::ostream CheckpointOut
std::vector< SlavePort * > ports
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
GpuTlbEntry * insert(Addr vpn, GpuTlbEntry &entry)
Stats::Scalar pageTableCycles
Stats::Scalar localNumTLBHits
TranslationState(Mode tlb_mode, ThreadContext *_tc, bool _prefetch=false, Packet::SenderState *_saved=nullptr)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
EventWrapper< GpuTLB,&GpuTLB::exitCallback > exitEvent
Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt)
virtual void recvRangeChange()
bool FA
true if this is a fully-associative TLB
Stats::Scalar localNumTLBAccesses
virtual void recvReqRetry()
BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
Stats::Scalar globalNumTLBHits
std::shared_ptr< FaultBase > Fault
tlbOutcome outcome
outcome can be TLB_HIT, TLB_MISS, or PAGE_WALK
std::vector< int > reqCnt
void issueTLBLookup(PacketPtr pkt)
Do the TLB lookup for this coalesced request and schedule another event <TLB access="" latency>=""> c...
void updatePageFootprint(Addr virt_page_addr)
void printAccessPattern()