32#ifndef __ARCH_AMDGPU_VEGA_TLB_HH__
33#define __ARCH_AMDGPU_VEGA_TLB_HH__
46#include "params/VegaGPUTLB.hh"
65 GpuTLB(
const VegaGPUTLBParams &
p);
95 virtual bool squashed()
const {
return false; }
189 VegaTlbEntry *
insert(
Addr vpn, VegaTlbEntry &entry);
205 VegaTlbEntry *tlb_entry,
Mode mode);
208 Addr phys_page_addr);
Device model for an AMD GPU.
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.
virtual void recvRangeChange()
virtual void recvReqRetry()
virtual bool recvTimingReq(PacketPtr pkt)
recvTiming receives a coalesced timing request from a TLBCoalescer and it calls issueTLBLookup() It o...
virtual void recvRespRetry()
Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called...
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
CpuSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
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.
MemSidePort is the TLB Port closer to the memory side If this is a last level TLB then this port will...
virtual void recvFunctional(PacketPtr pkt)
std::deque< PacketPtr > retries
virtual Tick recvAtomic(PacketPtr pkt)
MemSidePort(const std::string &_name, GpuTLB *gpu_TLB, PortID _index)
virtual bool recvTimingResp(PacketPtr pkt)
MemSidePort receives the packet back.
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
virtual void recvRangeChange()
Called to receive an address range change from the peer response port.
const char * description() const
Return a C string describing the event.
void updateOutcome(tlbOutcome _outcome)
tlbOutcome outcome
outcome can be TLB_HIT, TLB_MISS, or PAGE_WALK
TLBEvent(GpuTLB *_tlb, Addr _addr, tlbOutcome outcome, PacketPtr _pkt)
virtual bool squashed() const
This function is used by the page table walker to determine if it should translate the a pending requ...
virtual void markDelayed()=0
Signal that the translation has been delayed due to a hw page table walk.
virtual void finish(Fault fault, const RequestPtr &req, Mode mode)=0
The memory for this object may be dynamically allocated, and it may be responsible for cleaning itsle...
VegaTlbEntry * lookup(Addr va, bool update_lru=true)
EntryList::iterator lookupIt(Addr va, bool update_lru=true)
void walkerResponse(VegaTlbEntry &entry, PacketPtr pkt)
std::vector< CpuSidePort * > cpuSidePort
virtual void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void unserialize(CheckpointIn &cp) override
Unserialize an object.
void issueTLBLookup(PacketPtr pkt)
Do the TLB lookup for this coalesced request and schedule another event <TLB access latency> cycles l...
VegaTlbEntry * insert(Addr vpn, VegaTlbEntry &entry)
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 pagingProtectionChecks(PacketPtr pkt, VegaTlbEntry *tlb_entry, Mode mode)
Do Paging protection checks.
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::unordered_map< Addr, TLBEvent * > translationReturnEvent
std::list< VegaTlbEntry * > EntryList
std::vector< MemSidePort * > memSidePort
std::vector< EntryList > freeList
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Addr pageAlign(Addr vaddr)
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.
std::queue< Addr > cleanupQueue
bool FA
true if this is a fully-associative TLB
bool allocationPolicy
Allocation Policy: true if we always allocate on a hit, false otherwise.
EventFunctionWrapper cleanupEvent
gem5::VegaISA::GpuTLB::VegaTLBStats stats
VegaTlbEntry * tlbLookup(const RequestPtr &req, bool update_stats)
TLB_lookup will only perform a TLB lookup returning the TLB entry on a TLB hit and nullptr on a TLB m...
std::vector< EntryList > entryList
An entryList per set is the equivalent of an LRU stack; it's used to guide replacement decisions.
void demapPage(Addr va, uint64_t asn)
GpuTLB(const VegaGPUTLBParams &p)
std::vector< VegaTlbEntry > tlb
Fault createPagefault(Addr vaddr, Mode mode)
void updatePhysAddresses(Addr virt_page_addr, VegaTlbEntry *tlb_entry, Addr phys_page_addr)
bool hasMemSidePort
if true, then this is not the last level TLB
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 the Packet class.
Declaration of Statistics objects.
statistics::Scalar outstandingReqsMax
statistics::Scalar localNumTLBMisses
statistics::Formula localLatency
statistics::Formula localTLBMissRate
statistics::Scalar localCycles
statistics::Scalar globalNumTLBAccesses
statistics::Scalar accessCycles
statistics::Scalar localNumTLBAccesses
VegaTLBStats(statistics::Group *parent)
statistics::Formula globalTLBMissRate
statistics::Scalar globalNumTLBMisses
statistics::Scalar localNumTLBHits
statistics::Scalar pageTableCycles
statistics::Scalar globalNumTLBHits
statistics::Scalar maxDownstreamReached