ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
etiss::mm::PTE Class Reference

Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags. More...

#include <PTE.h>

Collaboration diagram for etiss::mm::PTE:
Collaboration graph
[legend]

Public Member Functions

 PTE ()
 
 PTE (uint64_t pte)
 
void Update (uint64_t new_pte)
 Update the PTE with a new value. More...
 
uint64_t GetByName (std::string const name) const
 Get the bit field value with its name. More...
 
void SetFlagByName (std::string name, uint64_t val)
 Set the bit field value with its name. More...
 
void ClearFlagByName (std::string name)
 Clear the bit field value with its name. More...
 
void Dump ()
 Dump the details of the PTE entry. More...
 
uint64_t Get () const
 
uint64_t GetPPN () const
 

Private Member Functions

uint64_t GenerateMask (uint64_t len) const
 
void SetBit (uint32_t pos)
 
void ClearBit (uint32_t pos)
 
bool CheckBit (uint32_t pos) const
 

Private Attributes

uint64_t ppn_val_
 
uint64_t pte_val_
 

Detailed Description

Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.

A PTE contains page frame number (pfn) and protection flags. PTEFormat is used to record bit field of PFR and flags in PTE raw value.PFN or flags could be read/write with help of PTEFormat, which could be built up by its builder utility.

Definition at line 68 of file PTE.h.

Constructor & Destructor Documentation

◆ PTE() [1/2]

etiss::mm::PTE::PTE ( )
inline

Definition at line 71 of file PTE.h.

◆ PTE() [2/2]

etiss::mm::PTE::PTE ( uint64_t  pte)
inline

Definition at line 73 of file PTE.h.

References Update().

Here is the call graph for this function:

Member Function Documentation

◆ CheckBit()

bool etiss::mm::PTE::CheckBit ( uint32_t  pos) const
inlineprivate

Definition at line 136 of file PTE.h.

References pte_val_, true, and uint64_t.

◆ ClearBit()

void etiss::mm::PTE::ClearBit ( uint32_t  pos)
inlineprivate

Definition at line 134 of file PTE.h.

References pte_val_, and uint64_t.

Referenced by ClearFlagByName().

Here is the caller graph for this function:

◆ ClearFlagByName()

void etiss::mm::PTE::ClearFlagByName ( std::string  name)

Clear the bit field value with its name.

Definition at line 124 of file PTE.cpp.

References ClearBit(), etiss::mm::PTEFormat::Dump(), etiss::FATALERROR, etiss::mm::PTEFormat::GetFormatMap(), etiss::mm::PTEFormat::Instance(), etiss::log(), and uint32_t.

Here is the call graph for this function:

◆ Dump()

void etiss::mm::PTE::Dump ( )

Dump the details of the PTE entry.

Definition at line 143 of file PTE.cpp.

References etiss::mm::PTEFormat::DumpBitFild(), GetByName(), etiss::mm::PTEFormat::GetFormatMap(), etiss::mm::PTEFormat::GetPTELength(), etiss::mm::PTEFormat::Instance(), and pte_val_.

Here is the call graph for this function:

◆ GenerateMask()

uint64_t etiss::mm::PTE::GenerateMask ( uint64_t  len) const
inlineprivate

Definition at line 122 of file PTE.h.

References uint64_t.

Referenced by GetByName(), and Update().

Here is the caller graph for this function:

◆ Get()

uint64_t etiss::mm::PTE::Get ( ) const
inline

Definition at line 117 of file PTE.h.

References pte_val_.

◆ GetByName()

uint64_t etiss::mm::PTE::GetByName ( std::string const  name) const

Get the bit field value with its name.

Definition at line 87 of file PTE.cpp.

References etiss::mm::PTEFormat::Dump(), etiss::FATALERROR, GenerateMask(), etiss::mm::PTEFormat::GetFormatMap(), etiss::mm::PTEFormat::Instance(), etiss::log(), pte_val_, and uint32_t.

Referenced by Dump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPPN()

uint64_t etiss::mm::PTE::GetPPN ( ) const
inline

Definition at line 119 of file PTE.h.

References ppn_val_.

Referenced by etiss::mm::MMU::Translate().

Here is the caller graph for this function:

◆ SetBit()

void etiss::mm::PTE::SetBit ( uint32_t  pos)
inlineprivate

Definition at line 132 of file PTE.h.

References pte_val_, and uint64_t.

Referenced by SetFlagByName().

Here is the caller graph for this function:

◆ SetFlagByName()

void etiss::mm::PTE::SetFlagByName ( std::string  name,
uint64_t  val 
)

Set the bit field value with its name.

Definition at line 104 of file PTE.cpp.

References etiss::mm::PTEFormat::Dump(), etiss::FATALERROR, etiss::mm::PTEFormat::GetFormatMap(), etiss::mm::PTEFormat::Instance(), etiss::log(), SetBit(), uint32_t, and uint64_t.

Here is the call graph for this function:

◆ Update()

void etiss::mm::PTE::Update ( uint64_t  new_pte)

Update the PTE with a new value.

Definition at line 62 of file PTE.cpp.

References etiss::mm::PTEFormat::Dump(), etiss::FATALERROR, GenerateMask(), etiss::mm::PTEFormat::GetFormatMap(), etiss::mm::PTEFormat::GetPTELength(), etiss::mm::PTEFormat::Instance(), etiss::log(), ppn_val_, and pte_val_.

Referenced by PTE().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ppn_val_

uint64_t etiss::mm::PTE::ppn_val_
private

Definition at line 138 of file PTE.h.

Referenced by GetPPN(), and Update().

◆ pte_val_

uint64_t etiss::mm::PTE::pte_val_
private

Definition at line 139 of file PTE.h.

Referenced by CheckBit(), ClearBit(), Dump(), Get(), GetByName(), SetBit(), and Update().


The documentation for this class was generated from the following files: