41#ifndef __ARCH_ARM_MMU_HH__
42#define __ARCH_ARM_MMU_HH__
49#include "enums/ArmLookupLevel.hh"
51#include "params/ArmMMU.hh"
62class TlbTestInterface;
210 MMU(
const ArmMMUParams &
p);
212 void init()
override;
267 Translation *translation,
bool &delay,
bool timing,
bool functional,
276 Translation *translation,
bool &delay,
bool timing,
351 Translation *translation,
bool timing,
bool functional,
357 Translation *translation,
bool timing,
bool functional,
364 Translation *translation,
bool timing,
380 TCR tcr,
bool is_inst, CachedState&
state);
451 auto mmu =
static_cast<MMU *
>(tc->getMMUPtr());
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Fault translateMmuOn(ThreadContext *tc, const RequestPtr &req, Mode mode, Translation *translation, bool &delay, bool timing, bool functional, Addr vaddr, TranMethod tran_method, CachedState &state)
ArmISA::TLB * getITBPtr() const
void setAttr(uint64_t attr)
Accessor functions for memory attributes for last accessed TLB entry.
bool checkPAN(ThreadContext *tc, uint8_t ap, const RequestPtr &req, Mode mode, const bool is_priv, CachedState &state)
void flushStage2(const TLBIOp &tlbi_op)
static bool hasUnprivRegime(TranslationRegime regime)
Fault translateSe(const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool &delay, bool timing, CachedState &state)
void drainResume() override
Resume execution after a successful drain.
Fault translateComplete(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tran_type, bool call_from_s2)
TLB * getTlb(BaseMMU::Mode mode, bool stage2) const
Fault translateMmuOff(ThreadContext *tc, const RequestPtr &req, Mode mode, ArmTranslationType tran_type, Addr vaddr, bool long_desc_format, CachedState &state)
Fault testTranslation(const RequestPtr &req, Mode mode, DomainType domain, CachedState &state) const
void init() override
Called at init time, this method is traversing the TLB hierarchy and pupulating the instruction/data/...
void translateTiming(const RequestPtr &req, ThreadContext *tc, BaseMMU::Translation *translation, BaseMMU::Mode mode, bool stage2)
CachedState & updateMiscReg(ThreadContext *tc, ArmTranslationType tran_type, bool stage2)
bool isCompleteTranslation(TlbEntry *te) const
Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const override
std::pair< bool, bool > s1PermBits64(TlbEntry *te, const RequestPtr &req, Mode mode, ThreadContext *tc, CachedState &state, bool r, bool w, bool x)
Fault getResultTe(TlbEntry **te, const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool timing, bool functional, TlbEntry *mergeTe, CachedState &state)
void flushStage1(const TLBIOp &tlbi_op)
static ExceptionLevel tranTypeEL(CPSR cpsr, SCR scr, ArmTranslationType type)
Determine the EL to use for the purpose of a translation given a specific translation type.
ArmISA::TLB * getDTBPtr() const
bool checkWalkCache() const
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode) override
enums::ArmLookupLevel LookupLevel
void setTestInterface(SimObject *ti)
TableWalker * itbStage2Walker
Addr getValidAddr(Addr vaddr, ThreadContext *tc, Mode mode) override
TableWalker * dtbStage2Walker
Fault getTE(TlbEntry **te, const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool timing, bool functional, SecurityState ss, PASpace ipaspace, ArmTranslationType tran_type, bool stage2)
void dflush(const TLBIOp &tlbi_op)
Fault checkPermissions64(TlbEntry *te, const RequestPtr &req, Mode mode, ThreadContext *tc, bool stage2)
Fault translateFs(const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool &delay, bool timing, ArmTranslationType tran_type, bool functional, CachedState &state)
TlbEntry * lookup(Addr vpn, uint16_t asn, vmid_t vmid, SecurityState ss, bool functional, bool ignore_asn, TranslationRegime target_regime, bool stage2, BaseMMU::Mode mode)
Lookup an entry in the TLB.
const ArmRelease * _release
gem5::ArmISA::MMU::Stats stats
std::pair< bool, bool > s2PermBits64(TlbEntry *te, const RequestPtr &req, Mode mode, ThreadContext *tc, CachedState &state, bool r, bool w, bool x)
void flush(const TLBIOp &tlbi_op)
Fault checkPermissions(TlbEntry *te, const RequestPtr &req, Mode mode, bool stage2)
bool faultPAN(ThreadContext *tc, uint8_t ap, const RequestPtr &req, Mode mode, const bool is_priv, CachedState &state)
TableWalker * getTableWalker(BaseMMU::Mode mode, bool stage2) const
void takeOverFrom(BaseMMU *old_mmu) override
Fault testAndFinalize(const RequestPtr &req, ThreadContext *tc, Mode mode, TlbEntry *te, CachedState &state) const
Addr purifyTaggedAddr(Addr vaddr_tainted, ThreadContext *tc, ExceptionLevel el, TCR tcr, bool is_inst, CachedState &state)
void iflush(const TLBIOp &tlbi_op)
bool hasWalkCache() const
Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode) override
TranslationGenPtr translateFunctional(Addr start, Addr size, ThreadContext *tc, Mode mode, Request::Flags flags) override
Returns a translation generator for a region of virtual addresses, instead of directly translating a ...
const ArmRelease * release() const
virtual Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode)
This class takes a function as a constructor argument and memoizes it: every time the function gets i...
Abstract superclass for simulation objects.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
This is a simple scalar statistic, like a counter.
SecurityState
Security State.
PASpace
Physical Address Space.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< FaultBase > Fault
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int ContextID
Globally unique thread context ID.
std::unique_ptr< TranslationGen > TranslationGenPtr
Declaration of Statistics objects.
ExceptionLevel exceptionLevel
SecurityState securityState
void updateMiscReg(ThreadContext *tc, ArmTranslationType tran_type)
vmid_t getVMID(ThreadContext *tc) const
Returns the current VMID (information stored in the VTTBR_EL2 register)
CachedState & operator=(const CachedState &rhs)
CachedState(MMU *_mmu, bool stage2)
Memoizer< int, ThreadContext *, bool, bool, TCR, ExceptionLevel > computeAddrTop
ArmTranslationType curTranType
TranslationRegime currRegime
statistics::Scalar permsFaults
statistics::Scalar alignFaults
statistics::Scalar prefetchFaults
statistics::Scalar domainFaults