Go to the documentation of this file.
66 DPRINTF(GPUPTWalker,
"Vega walker walker: %p funcState: %p "
67 "funcState->walker %p\n",
78 DPRINTF(GPUPTWalker,
"Vega walker starting with addr: %#lx "
85 DPRINTF(GPUPTWalker,
"Sending functional read to %#lx\n",
98 logBytes =
entry.logBytes;
111 DPRINTF(GPUPTWalker,
"Vega walker starting with addr: %#lx "
127 DPRINTF(GPUPTWalker,
"Walker::WalkerState::initState\n");
128 DPRINTF(GPUPTWalker,
"Walker::WalkerState::initState %p\n",
this);
129 DPRINTF(GPUPTWalker,
"Walker::WalkerState::initState %d\n",
state);
130 assert(
state == Ready);
134 timing = !is_functional;
145 Addr pde2Addr = (((
baseAddr >> 6) << 3) + (logical_addr >> 3*9)) << 3;
146 DPRINTF(GPUPTWalker,
"Walk PDE2 address is %#lx\n", pde2Addr);
149 entry.vaddr = logical_addr;
154 RequestPtr request = std::make_shared<Request>(
155 pde2Addr, dataSize,
flags, walker->deviceRequestorId);
166 DPRINTF(GPUPTWalker,
"Sending timing read to %#lx\n",
174 timingFault = stepWalk();
175 assert(timingFault ==
NoFault || read == NULL);
180 DPRINTF(GPUPTWalker,
"Sending timing read to %#lx\n",
185 entry.paddr =
bits(entry.pte, 47, entry.logBytes);
186 entry.paddr <<= entry.logBytes;
191 walker->tlb->insert(entry.vaddr, entry);
194 walker->walkerResponse(
this, entry, tlbPkt);
202 assert(
state != Ready &&
state != Waiting && read);
206 bool uncacheable = !pte.c;
208 bool doEndWalk =
false;
210 walkStateMachine(pte, nextRead, doEndWalk, fault);
213 DPRINTF(GPUPTWalker,
"ending walk\n");
221 RequestPtr request = std::make_shared<Request>(
222 nextRead, oldRead->
getSize(),
flags, walker->deviceRequestorId);
235 bool &doEndWalk,
Fault &fault)
241 PageDirectoryEntry pde =
static_cast<PageDirectoryEntry
>(pte);
245 panic_if(pde.blockFragmentSize,
"PDE blockFragmentSize must be 0");
249 fatal_if(pde.p,
"Fragment in PDE2 not implemented");
252 part1 = ((((uint64_t)pte) >> 6) << 3);
253 part2 = offsetFunc(
vaddr, 3*9, 2*9);
254 nextRead = ((part1 + part2) << 3) &
mask(48);
256 "Got PDE2 entry %#016x. write:%s->%#016x va:%#016x\n",
257 (uint64_t)pte, pte.w == 0 ?
"yes" :
"no", nextRead,
vaddr);
261 fatal_if(pde.p,
"Fragment in PDE1 not implemented");
264 part1 = ((((uint64_t)pte) >> 6) << 3);
265 part2 = offsetFunc(
vaddr, 2*9, 9);
266 nextRead = ((part1 + part2) << 3) &
mask(48);
268 "Got PDE1 entry %#016x. write:%s->%#016x va: %#016x\n",
269 (uint64_t)pte, pte.w == 0 ?
"yes" :
"no", nextRead,
vaddr);
274 DPRINTF(GPUPTWalker,
"Treating PDE0 as PTE: %#016x frag: %d\n",
275 (uint64_t)pte, pte.fragment);
280 entry.vaddr = entry.vaddr & ~((1 << entry.logBytes) - 1);
281 entry.vaddr = entry.vaddr & ~
mask(entry.logBytes);
285 part1 = ((((uint64_t)pte) >> 6) << 3);
286 part2 = offsetFunc(
vaddr, 9, 0);
287 nextRead = ((part1 + part2) << 3) &
mask(48);
289 "Got PDE0 entry %#016x. write:%s->%#016x va:%#016x\n",
290 (uint64_t)pte, pte.w == 0 ?
"yes" :
"no", nextRead,
vaddr);
295 " PTE entry %#016x. write: %s va: %#016x\n",
296 (uint64_t)pte, pte.w == 0 ?
"yes" :
"no",
vaddr);
300 entry.vaddr = entry.vaddr & ~
mask(entry.logBytes);
304 panic(
"Unknown page table walker state %d!\n");
307 if (badNX || !pte.v) {
309 fault = pageFault(pte.v);
320 walker->currStates.remove(
this);
333 if (!walker->sendTiming(
this, read)) {
334 DPRINTF(GPUPTWalker,
"Timing request for %#lx failed\n",
339 DPRINTF(GPUPTWalker,
"Timing request for %#lx successful\n",
350 DPRINTF(GPUPTWalker,
"Sending timing read to %#lx from walker %p\n",
351 pkt->
getAddr(), sending_walker);
364 walker->recvTimingResp(pkt);
375 DPRINTF(GPUPTWalker,
"Got response for %#lx from walker %p -- %#lx\n",
385 walker->recvReqRetry();
395 walkerState->
retry();
428 DPRINTF(GPUPTWalker,
"Raising page fault.\n");
438 return std::make_shared<PageFault>(entry.vaddr, code,
present,
mode,
true);
446 return ((logicalAddr & ((1 <<
top) - 1)) >> lsb);
456 if (if_name ==
"port")
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
constexpr decltype(nullptr) NoFault
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Walker * getWalker() const
Fault pageFault(bool present)
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
RequestPtr req
A pointer to the original request.
void recvTimingResp(PacketPtr pkt)
@ PHYSICAL
The virtual address is also the physical address.
Fault startFunctional(Addr base, Addr vaddr, PageTableEntry &pte, unsigned &logBytes)
void startTiming(PacketPtr pkt, Addr base, Addr vaddr, BaseMMU::Mode mode)
void walkerResponse(VegaTlbEntry &entry, PacketPtr pkt)
memory::AbstractMemory * getDeviceMemory(const PacketPtr &pkt) const
Return a pointer to the device memory.
bool sendTiming(WalkerState *sendingState, PacketPtr pkt)
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
Bitfield< 11, 7 > fragment
Fault startFunctional(Addr base, Addr vaddr, PageTableEntry &pte, unsigned &logBytes, BaseMMU::Mode mode)
void walkerResponse(WalkerState *state, VegaTlbEntry &entry, PacketPtr pkt)
@ UNCACHEABLE
The request is to an uncacheable address.
std::shared_ptr< FaultBase > Fault
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
ProbePointArg< PacketInfo > Packet
Packet probe point.
uint64_t offsetFunc(Addr logicalAddr, int top, int lsb)
std::shared_ptr< Request > RequestPtr
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
std::list< WalkerState * > currStates
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
gem5 methods
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Ports are used to interface objects to each other.
void initState(BaseMMU::Mode _mode, Addr baseAddr, Addr vaddr, bool is_functional=false)
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void sendPackets()
Port related methods.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void walkStateMachine(PageTableEntry &pte, Addr &nextRead, bool &doEndWalk, Fault &fault)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Thu Jul 28 2022 13:32:22 for gem5 by doxygen 1.8.17