47 #include "debug/TLB.hh"
60 bool uncacheBit39 =
false;
61 bool uncacheBit40 =
false;
64 #define MODE2MASK(X) (1 << (X))
92 .
desc(
"ITB accesses");
98 .
desc(
"DTB read hits")
103 .
desc(
"DTB read misses")
108 .
desc(
"DTB read access violations")
113 .
desc(
"DTB read accesses")
118 .
desc(
"DTB write hits")
123 .
desc(
"DTB write misses")
128 .
desc(
"DTB write access violations")
133 .
desc(
"DTB write accesses")
148 .
desc(
"DTB access violations")
153 .
desc(
"DTB accesses")
183 if (retval == NULL) {
186 while (i->first == vpn) {
187 int index = i->second;
189 assert(entry->
valid);
190 if (vpn == entry->
tag && (entry->
asma || entry->
asn == asn)) {
200 DPRINTF(
TLB,
"lookup %#x, asn %#x -> %s ppn %#x\n", vpn, (
int)asn,
201 retval ?
"hit" :
"miss", retval ? retval->
ppn : 0);
224 return std::make_shared<UnimpFault>(
225 "IPR memory space not implemented!");
238 return std::make_shared<UnimpFault>(
239 "CPU trying to fetch from uncached I/O");
257 panic(
"TLB entry not found in lookupTable");
260 while ((index = i->second) !=
nlu) {
261 if (
table[index].tag != oldvpn)
262 panic(
"TLB entry not found in lookupTable");
276 table[
nlu].valid =
true;
299 int index = i->second;
301 assert(entry->
valid);
305 PageTable::iterator cur =
i;
309 DPRINTF(
TLB,
"flush @%d: %#x -> %#x\n", index,
311 entry->
valid =
false;
328 int index = i->second;
330 assert(entry->
valid);
332 if (vaddr.
vpn() == entry->
tag && (entry->
asma || entry->
asn == asn)) {
333 DPRINTF(
TLB,
"flushaddr @%d: %#x -> %#x\n", index, vaddr.
vpn(),
337 entry->
valid =
false;
366 for (
int i = 0;
i <
size;
i++) {
394 return std::make_shared<ItbAcvFault>(req->
getVaddr());
405 return std::make_shared<ItbAcvFault>(req->
getVaddr());
423 return std::make_shared<ItbPageFault>(req->
getVaddr());
435 return std::make_shared<ItbAcvFault>(req->
getVaddr());
444 return std::make_shared<MachineCheckFault>();
464 return std::make_shared<DtbAlignmentFault>(req->
getVaddr(),
485 return std::make_shared<DtbPageFault>(req->
getVaddr(),
499 return std::make_shared<DtbAcvFault>(req->
getVaddr(),
546 return std::make_shared<DtbPageFault>(req->
getVaddr(),
553 return std::make_shared<DtbPageFault>(req->
getVaddr(),
562 return std::make_shared<DtbAcvFault>(req->
getVaddr(),
569 return std::make_shared<DtbPageFault>(req->
getVaddr(),
584 return std::make_shared<MachineCheckFault>();
621 panic(
"Not implemented\n");
634 AlphaTLBParams::create()
const uint64_t MM_STAT_WR_MASK
bool isUncacheable() const
Accessor functions for flags.
int DTB_ASN_ASN(uint64_t reg)
decltype(nullptr) constexpr NoFault
Stats::Formula fetch_accesses
static const ArchFlagsType ALTMODE
Use the alternate mode bits in ALPHA.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const Addr PAddrUncachedBit40
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
Stats::Formula data_misses
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
const uint64_t MM_STAT_BAD_VA_MASK
Addr getPC() const
Accessor function for pc.
uint64_t ALT_MODE_AM(uint64_t reg)
const uint64_t MM_STAT_DTB_MISS_MASK
bool PAddrIprSpace(Addr a)
std::vector< TlbEntry > table
virtual void regStats()
Register statistics for this object.
TlbEntry & index(bool advance=true)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Addr VAddrSpaceEV6(Addr a)
Stats::Scalar write_misses
The virtual address is also the physical address.
Fault translateData(RequestPtr req, ThreadContext *tc, bool write)
Stats::Scalar fetch_misses
#define UNSERIALIZE_SCALAR(scalar)
uint64_t DTB_CM_CM(uint64_t reg)
std::string csprintf(const char *format, const Args &...args)
static Fault checkCacheability(RequestPtr &req, bool itb=false)
The request is to an uncacheable address.
void flushAll() override
Remove all entries from the TLB.
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
void serialize(CheckpointOut &cp) const override
Serialize an object.
TlbEntry(Addr asn, Addr _vaddr, Addr _paddr, bool uncacheable, bool read_only)
Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const
static const ArchFlagsType VPTE
The request is an ALPHA VPTE pal access (hw_ld).
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of IniFile object.
#define ULL(N)
uint64_t constant
void translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode)
TlbEntry * updateCache(TlbEntry *entry)
Stats::Scalar read_accesses
void flushAddr(Addr addr, uint8_t asn)
#define SERIALIZE_SCALAR(scalar)
Stats::Scalar write_accesses
Flags getFlags()
Accessor for flags.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
const uint64_t MM_STAT_FONW_MASK
const Addr PAddrUncachedBit43
virtual const std::string name() const
static bool validVirtualAddress(Addr vaddr)
std::ostream CheckpointOut
TlbEntry * lookup(Addr vpn, uint8_t asn)
Fault translateInst(RequestPtr req, ThreadContext *tc)
Stats::Scalar read_misses
void insert(Addr vaddr, TlbEntry &entry)
The request is required to be strictly ordered by CPU models and is non-speculative.
const uint64_t MM_STAT_ACV_MASK
const Addr PAddrUncachedMask
Stats::Formula data_accesses
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Fault translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode)
translateFunctional stub function for future CheckerCPU support
uint64_t ICM_CM(uint64_t reg)
void setPaddr(Addr paddr)
Set just the physical address.
virtual void finish(const Fault &fault, RequestPtr req, ThreadContext *tc, Mode mode)=0
void setFlags(Flags flags)
Note that unlike other accessors, this function sets specific flags (ORs them in); it does not assign...
std::shared_ptr< FaultBase > Fault
const uint64_t MM_STAT_FONR_MASK
Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
void regStats() override
Register statistics for this object.