ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Types | Private Attributes | List of all members
etiss::mm::TLB< EntryNum > Class Template Reference

#include <TLB.h>

Collaboration diagram for etiss::mm::TLB< EntryNum >:
Collaboration graph
[legend]

Public Member Functions

 TLB ()
 
uint32_t AddPTE (uint64_t vfn, uint64_t pte_val)
 Add an PTE entry in TLB with a pte value. More...
 
uint32_t AddPTE (uint64_t vfn, const PTE &pte_entry)
 Add an PTE entry in TLB from the given PTE. More...
 
uint32_t Lookup (uint64_t vfn, PTE *pte_buf)
 Look up the TLB for the given given virtual page number. More...
 
void Flush ()
 Flush the TLB. More...
 
uint32_t UpdatePTE (uint64_t vfn, uint64_t pte_val)
 Update the PTE entry. More...
 
uint32_t EvictPTE (uint64_t vfn)
 Evict the PTE entry. More...
 
bool IsFull () const
 
void DumpEntry (uint64_t vfn)
 Dump the PTE details according to the given VPN. More...
 
void Dump ()
 Dump all PTEs in TLB and TLB details. More...
 

Private Types

typedef std::map< uint64_t, PTETLBMap
 

Private Attributes

TLBMap tlb_map_
 
uint32_t max_entry_
 
uint32_t current_entry_num_
 
bool is_full_
 
bool infinite_tlb_entries_
 

Detailed Description

template<uint32_t EntryNum>
class etiss::mm::TLB< EntryNum >

Definition at line 69 of file TLB.h.

Member Typedef Documentation

◆ TLBMap

template<uint32_t EntryNum>
typedef std::map<uint64_t, PTE> etiss::mm::TLB< EntryNum >::TLBMap
private

Definition at line 72 of file TLB.h.

Constructor & Destructor Documentation

◆ TLB()

template<uint32_t EntryNum>
etiss::mm::TLB< EntryNum >::TLB ( )
inlineexplicit

Member Function Documentation

◆ AddPTE() [1/2]

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::AddPTE ( uint64_t  vfn,
const PTE pte_entry 
)
inline

◆ AddPTE() [2/2]

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::AddPTE ( uint64_t  vfn,
uint64_t  pte_val 
)
inline

◆ Dump()

template<uint32_t EntryNum>
void etiss::mm::TLB< EntryNum >::Dump ( )
inline

◆ DumpEntry()

template<uint32_t EntryNum>
void etiss::mm::TLB< EntryNum >::DumpEntry ( uint64_t  vfn)
inline

Dump the PTE details according to the given VPN.

Definition at line 180 of file TLB.h.

References etiss::ERROR, etiss::log(), etiss::mm::TLB< EntryNum >::tlb_map_, and unlikely.

Referenced by etiss::mm::TLB< EntryNum >::Dump().

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

◆ EvictPTE()

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::EvictPTE ( uint64_t  vfn)
inline

◆ Flush()

template<uint32_t EntryNum>
void etiss::mm::TLB< EntryNum >::Flush ( )
inline

◆ IsFull()

template<uint32_t EntryNum>
bool etiss::mm::TLB< EntryNum >::IsFull ( ) const
inline

Definition at line 174 of file TLB.h.

References etiss::mm::TLB< EntryNum >::is_full_.

◆ Lookup()

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::Lookup ( uint64_t  vfn,
PTE pte_buf 
)
inline

Look up the TLB for the given given virtual page number.

Definition at line 124 of file TLB.h.

References etiss::mm::NOERROR, etiss::mm::TLB< EntryNum >::tlb_map_, and etiss::mm::TLBMISS.

◆ UpdatePTE()

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::UpdatePTE ( uint64_t  vfn,
uint64_t  pte_val 
)
inline

Update the PTE entry.

Definition at line 150 of file TLB.h.

References etiss::mm::NOERROR, etiss::mm::PTENOTEXISTED, etiss::mm::TLB< EntryNum >::tlb_map_, and unlikely.

Member Data Documentation

◆ current_entry_num_

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::current_entry_num_
private

◆ infinite_tlb_entries_

template<uint32_t EntryNum>
bool etiss::mm::TLB< EntryNum >::infinite_tlb_entries_
private

Definition at line 219 of file TLB.h.

Referenced by etiss::mm::TLB< EntryNum >::Dump(), and etiss::mm::TLB< EntryNum >::TLB().

◆ is_full_

template<uint32_t EntryNum>
bool etiss::mm::TLB< EntryNum >::is_full_
private

◆ max_entry_

template<uint32_t EntryNum>
uint32_t etiss::mm::TLB< EntryNum >::max_entry_
private

Definition at line 216 of file TLB.h.

Referenced by etiss::mm::TLB< EntryNum >::Dump(), and etiss::mm::TLB< EntryNum >::TLB().

◆ tlb_map_

template<uint32_t EntryNum>
TLBMap etiss::mm::TLB< EntryNum >::tlb_map_
private

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