41#ifndef __ARCH_ARM_PAGETABLE_H__
42#define __ARCH_ARM_PAGETABLE_H__
50#include "enums/TypeTLB.hh"
51#include "enums/ArmLookupLevel.hh"
54#include "params/TLBIndexingPolicy.hh"
55#include "params/TLBSetAssociative.hh"
84 panic(
"Need to implement PTE serialization\n");
89 panic(
"Need to implement PTE serialization\n");
219 Addr set_number = (key.va >> key.pageSize) &
setMask;
220 return sets[set_number];
227 panic(
"Unimplemented\n");
304 bool uncacheable,
bool read_only) :
323 warn(
"ARM TlbEntry does not support read-only mappings\n");
360 std::swap(
tg, rhs.
tg);
364 std::swap(
ap, rhs.
ap);
371 std::swap(
ns, rhs.
ns);
372 std::swap(
ss, rhs.
ss);
379 std::swap(
xn, rhs.
xn);
381 std::swap(
xs, rhs.
xs);
415 return key.
va <= page_addr +
size &&
416 key.
va + key.
size > page_addr;
419 return key.
va >= page_addr && key.
va <= page_addr +
size;
444 return regime == target_regime;
505 return csprintf(
"%#x, asn %d vmn %d ppn %#x size: %#x ap:%d "
506 "ns:%d ss:%s g:%d xs: %d regime:%s",
vpn <<
N,
asid,
vmid,
538 uint8_t domain_ =
static_cast<uint8_t
>(
domain);
569 paramIn(cp,
"domain", domain_);
579template class IndexingPolicyTemplate<ArmISA::TLBTypes>;
std::vector< ReplaceableEntry * > getPossibleEntries(const KeyType &key) const override
Find all possible entries for insertion and replacement of an address.
Addr regenerateAddr(const KeyType &key, const ReplaceableEntry *entry) const override
Regenerate an entry's address from its tag and assigned indexing bits.
TLBSetAssociative(const Params &p)
PARAMS(TLBSetAssociative)
TLBIndexingPolicyParams Params
A common base class for indexing table locations.
typename Types::KeyType KeyType
typename Types::Params Params
std::vector< std::vector< ReplaceableEntry * > > sets
The cache sets.
const unsigned setMask
Mask out all bits that aren't part of the set index.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Basic support for object serialization.
#define panic(...)
This implements a cprintf based panic() function.
#define SERIALIZE_ENUM(scalar)
#define UNSERIALIZE_ENUM(scalar)
static bool useVMID(TranslationRegime regime)
const PageTableOps * getPageTableOps(GrainSize trans_granule)
IndexingPolicyTemplate< TLBTypes > TLBIndexingPolicy
static const char * regimeToStr(TranslationRegime regime)
const GrainSize GrainMap_tg1[]
const unsigned MaxPhysAddrRange
SecurityState
Security State.
const GrainSize GrainMap_tg0[]
PASpace
Physical Address Space.
Copyright (c) 2024 Arm Limited All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
std::string csprintf(const char *format, const Args &...args)
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
void serialize(CheckpointOut &cp) const
void unserialize(CheckpointIn &cp)
virtual bool isWritable(pte_t pte, unsigned level, bool stage2) const =0
enums::ArmLookupLevel LookupLevel
Addr walkMask(unsigned level) const
virtual LookupLevel firstS2Level(uint8_t sl0) const =0
virtual LookupLevel lastLevel() const =0
virtual Addr nextLevelPointer(pte_t pte, unsigned level) const =0
virtual unsigned walkBits(unsigned level) const =0
virtual bool isValid(pte_t pte, unsigned level) const =0
virtual LookupLevel firstLevel(uint8_t tsz) const =0
virtual Addr pageMask(pte_t pte, unsigned level) const =0
virtual Addr index(Addr va, unsigned level, int tsz) const =0
virtual bool isLeaf(pte_t pte, unsigned level) const =0
TranslationRegime targetRegime
TlbEntry(Addr _asn, Addr _vaddr, Addr _paddr, bool uncacheable, bool read_only)
enums::ArmLookupLevel LookupLevel
void updateVaddr(Addr new_vaddr)
std::string print() const override
Prints relevant information about this entry.
bool match(const KeyType &key) const
void insert(const KeyType &key)
Need for compliance with the AssociativeCache interface.
void invalidate()
Need for compliance with the AssociativeCache interface.
TlbEntry & operator=(TlbEntry rhs)
bool checkRegime(TranslationRegime target_regime) const
TlbEntry(const TlbEntry &rhs)=default
void setAttributes(bool lpae)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Addr pAddr(Addr va) const
bool isValid() const
Need for compliance with the AssociativeCache interface.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool matchAddress(const KeyType &key) const
Addr pageMask(pte_t pte, unsigned level) const override
bool isValid(pte_t pte, unsigned level) const override
bool isLeaf(pte_t pte, unsigned level) const override
bool isWritable(pte_t pte, unsigned level, bool stage2) const override
Addr nextLevelPointer(pte_t pte, unsigned level) const override
unsigned walkBits(unsigned level) const override
LookupLevel firstLevel(uint8_t tsz) const override
LookupLevel lastLevel() const override
LookupLevel firstS2Level(uint8_t sl0) const override
unsigned walkBits(unsigned level) const override
Addr pageMask(pte_t pte, unsigned level) const override
bool isLeaf(pte_t pte, unsigned level) const override
LookupLevel firstLevel(uint8_t tsz) const override
bool isValid(pte_t pte, unsigned level) const override
LookupLevel lastLevel() const override
Addr nextLevelPointer(pte_t pte, unsigned level) const override
bool isWritable(pte_t pte, unsigned level, bool stage2) const override
unsigned walkBits(unsigned level) const override
Addr pageMask(pte_t pte, unsigned level) const override
LookupLevel firstS2Level(uint8_t sl0) const override
bool isWritable(pte_t pte, unsigned level, bool stage2) const override
Addr nextLevelPointer(pte_t pte, unsigned level) const override
LookupLevel lastLevel() const override
bool isValid(pte_t pte, unsigned level) const override
bool isLeaf(pte_t pte, unsigned level) const override
LookupLevel firstLevel(uint8_t tsz) const override
Addr nextLevelPointer(pte_t pte, unsigned level) const override
LookupLevel lastLevel() const override
bool isValid(pte_t pte, unsigned level) const override
unsigned walkBits(unsigned level) const override
LookupLevel firstLevel(uint8_t tsz) const override
Addr pageMask(pte_t pte, unsigned level) const override
bool isWritable(pte_t pte, unsigned level, bool stage2) const override
LookupLevel firstS2Level(uint8_t sl0) const override
bool isLeaf(pte_t pte, unsigned level) const override