17.2 PTE Representation

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 17 – Address Translation, TLB, and PTE >

17.2 PTE Representation

17.2.1 AlphaPTE – Canonical Structure

 

The AlphaPTE struct (pteLib/alpha_pte_core.h) represents the canonical Page Table Entry format. It provides bit-level accessors for the architectural PTE fields:

 

Field

Meaning

V

Valid — entry is active

FOE

Fault on Execute

FOW

Fault on Write

FOR

Fault on Read

ASM

Address Space Match (global — matches all ASNs)

GH

Granularity Hint (superpage support)

KRE / KWE

Kernel Read Enable / Kernel Write Enable

URE / UWE

User Read Enable / User Write Enable

PFN

Page Frame Number (physical address >> pageShift)





 

The permission model compresses Executive (E) and Supervisor (S) modes into Kernel (K) mode for implementation simplicity. AlphaPTE provides higher-level accessors and mutators for permissions and PFN.

 


 

17.2.2 PTETraits – Generation-Specific Adaptation

 

The PTETraits template (pteLib/alpha_pte_traits.h) adapts the canonical AlphaPTE to the specific PTE layouts used by each Alpha generation (EV4, EV5, EV6). It provides static methods for decoding and encoding between the canonical form and the generation-specific IPR (Internal Processor Register) formats.

 

Key responsibilities: extract the virtual address from IPR tag registers (ITB_TAG, DTB_TAG), decode IPR write-format PTE images into AlphaPTE, and encode AlphaPTE into IPR read-format PTE images.

 

Specializations for EV6: alpha_pte_traits_ev6_itb.h handles ITB PTE encoding/decoding, and alpha_pte_traits_ev6_dtb.h handles DTB PTE encoding/decoding. The ITB and DTB have different PTE layouts on EV6, requiring separate trait specializations.

 


 

17.2.3 PTEView – Trait-Based Accessor Wrapper

 

PTEView (pteLib/alpha_pte_view.h) provides a convenient interface for working with PTEs using trait-based accessors. It wraps an AlphaPTE and forwards queries to the appropriate PTETraits methods based on the Alpha generation. Accessors include validity, global flag, PFN, page shift, and protection flags. Mutators include set validity, global flag, PFN, and protection. PTEView allows higher layers (MBox, PAL) to work with PTEs without knowing which generation-specific encoding is in use.

 

See Also: pteLib/alpha_pte_core.h – AlphaPTE struct; pteLib/alpha_pte_traits.h – PTETraits template; pteLib/alpha_pte_traits_ev6_itb.h – EV6 ITB traits; pteLib/alpha_pte_traits_ev6_dtb.h – EV6 DTB traits; pteLib/alpha_pte_view.h – PTEView wrapper.