49 #include "debug/MipsPRA.hh"
50 #include "debug/TLB.hh"
52 #include "params/MipsTLB.hh"
56 using namespace MipsISA;
85 while (i->first == vpn) {
86 int index = i->second;
93 if (((vpn & InvMask) == (VPN & InvMask)) &&
94 (pte->
G || (asn == pte->
asid))) {
103 DPRINTF(
TLB,
"lookup %#x, asn %#x -> %s ppn %#x\n", vpn, (
int)asn,
104 retval ?
"hit" :
"miss", retval ? retval->
PFN1 : 0);
113 return &
table[Index];
123 while (i->first == vpn) {
124 int index = i->second;
129 Addr InvMask = ~Mask;
131 if (((vpn & InvMask) == (VPN & InvMask)) &&
132 (pte->
G || (asn == pte->
asid))) {
140 DPRINTF(MipsPRA,
"VPN: %x, asid: %d, Result of TLBP: %d\n",vpn,asn,Ind);
147 Addr VAddrUncacheable = 0xA0000000;
150 if ((req->
getVaddr() & VAddrUncacheable) == VAddrUncacheable) {
162 warn(
"Attempted to write at index (%d) beyond TLB size (%d)",
167 Index, pte.
Mask << 11,
169 ((pte.
PFN0 << 6) | (pte.
C0 << 3) |
170 (pte.
D0 << 2) | (pte.
V0 <<1) | pte.
G),
171 ((pte.
PFN1 <<6) | (pte.
C1 << 3) |
172 (pte.
D1 << 2) | (pte.
V1 <<1) | pte.
G));
188 fatal(
"TLB Insert not yet implemented\n");
206 for (
int i = 0;
i <
size;
i++) {
218 for (
int i = 0;
i <
size;
i++) {
234 .
desc(
"DTB read hits")
239 .
desc(
"DTB read misses")
245 .
desc(
"DTB read accesses")
250 .
desc(
"DTB write hits")
255 .
desc(
"DTB write misses")
261 .
desc(
"DTB write accesses")
276 .
desc(
"DTB accesses")
288 panic(
"translateInst not implemented in MIPS.\n");
303 panic(
"translateData not implemented in MIPS.\n");
334 panic(
"Not implemented\n");
357 MipsTLBParams::create()
359 return new TLB(
this);
MipsISA::PTE & index(bool advance=true)
decltype(nullptr) constexpr NoFault
void serialize(CheckpointOut &cp) const override
Serialize an object.
MipsISA::PTE * lookup(Addr vpn, uint8_t asn) const
void flushAll() override
Remove all entries from the TLB.
MipsISA::PTE * getEntry(unsigned) const
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
virtual Process * getProcessPtr()=0
void regStats() override
Register statistics for this object.
virtual void regStats()
Register statistics for this object.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
#define UNSERIALIZE_SCALAR(scalar)
int probeEntry(Addr vpn, uint8_t) const
Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
std::string csprintf(const char *format, const Args &...args)
Stats::Scalar write_misses
bool translate(Addr vaddr, Addr &paddr)
Translate function.
The request is to an uncacheable address.
void serialize(CheckpointOut &cp) const
Fault translateData(RequestPtr req, ThreadContext *tc, bool write)
Fault translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode)
Function stub for CheckerCPU compilation issues.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of IniFile object.
void unserialize(CheckpointIn &cp)
Stats::Scalar read_misses
#define SERIALIZE_SCALAR(scalar)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
virtual const std::string name() const
Declarations of a non-full system Page Table.
std::ostream CheckpointOut
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Stats::Scalar read_accesses
static Fault checkCacheability(RequestPtr &req)
The request is required to be strictly ordered by CPU models and is non-speculative.
Fault translateInst(RequestPtr req, ThreadContext *tc)
void insertAt(MipsISA::PTE &pte, unsigned Index, int _smallPages)
Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
void translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode)
Scoped checkpoint section helper class.
Stats::Scalar write_accesses
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
void insert(Addr vaddr, MipsISA::PTE &pte)