20#ifndef ETISS_INCLUDE_MM_MMU_H_
21#define ETISS_INCLUDE_MM_MMU_H_
40#define DEFAULT_PAGE_TABLE_WALKER -15
49 explicit MMU(
bool hw_ptw, std::string name,
bool pid_enabled);
148 std::shared_ptr<etiss::mm::TLB<0>>
tlb_;
#define DEFAULT_PAGE_TABLE_WALKER
Internal fault inside MMU and.
plugins for extensions to code translation and instruction execution
Modeling Tranlation Look-up Table (TLB)
static __inline__ uint32_t
static __inline__ uint64_t
static __inline__ int32_t
uint64_t GetMMUControlReg()
int32_t AddTLBEntry(const uint64_t vfn, const PTE &pte)
virtual int32_t GetPid(uint64_t control_reg_val_)
virtual bool CheckPrivilegedMode()=0
MMU is enabled in certain mode.
std::string GetName() const
virtual int32_t WalkPageTable(uint64_t, MM_ACCESS)
Page table walking is required to translate virtual address to physical address if TLB miss occurs.
const bool hw_page_table_walker_
void SignalMMU(uint64_t control_reg_val_)
Whenever the MMU control register changes, the MMU has to be notified with the updated control regist...
void UpdatePid(uint32_t new_pid)
std::shared_ptr< etiss::mm::TLB< 0 > > tlb_
virtual int32_t CheckProtection(const PTE &, MM_ACCESS access)=0
Memory protection is architecture-dependent, which should be implemented with architecture model.
bool IsProcessIdEnabled()
virtual void UpdatePTEFlags(PTE &, MM_ACCESS)
Reserved for some MMU that might update PTE when translating.
void AddTLBEntryMap(uint64_t phy_addr_, PTE &pte)
Keep a record of mapping between cached PTE with its physical address.
uint64_t mmu_control_reg_val_
bool HasPageTableWalker()
virtual int32_t Translate(const uint64_t vma, uint64_t *const pma_buf, MM_ACCESS access, uint64_t data=0)
Conduct the actual translation according to the format set by PTEFormatBuilder.
void Init(ETISS_CPU *cpu, ETISS_System *system)
Initialize the MMU, when DMMUWrapper is wrapping the MMU.
void Dump()
Dump the details of the MMU, when page fault cannot be handled.
std::map< uint64_t, PTE * > tlb_entry_map_
PTE EvictTLBEntry(const uint64_t vfn)
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
int32_t tlb_miss_handler(int32_t fault, MMU *mmu, uint64_t vma, MM_ACCESS access)
basic cpu state structure needed for execution of any cpu architecture.
memory access and time synchronization functions.