50 #include "debug/Power.hh" 51 #include "debug/TLB.hh" 53 #include "params/PowerTLB.hh" 65 #define MODE2MASK(X) (1 << (X)) 68 :
BaseTLB(p), size(p->size), nlu(0)
89 while (i->first == vpn) {
90 int index = i->second;
95 if (((vpn & InvMask) == (VPN & InvMask))
96 && (pte->
G || (asn == pte->
asid))) {
106 DPRINTF(
TLB,
"lookup %#x, asn %#x -> %s ppn %#x\n", vpn, (
int)asn,
107 retval ?
"hit" :
"miss", retval ? retval->
PFN1 : 0);
116 return &
table[Index];
126 while (i->first == vpn) {
127 int index = i->second;
130 Addr InvMask = ~Mask;
132 if (((vpn & InvMask) == (VPN & InvMask))
133 && (pte->
G || (asn == pte->
asid))) {
143 DPRINTF(Power,
"VPN: %x, asid: %d, Result of TLBP: %d\n", vpn, asn, Ind);
150 Addr VAddrUncacheable = 0xA0000000;
151 if ((req->getVaddr() & VAddrUncacheable) == VAddrUncacheable) {
164 warn(
"Attempted to write at index (%d) beyond TLB size (%d)",
186 fatal(
"TLB Insert not yet implemented\n");
204 for (
int i = 0;
i <
size;
i++) {
216 for (
int i = 0;
i <
size;
i++) {
231 .
desc(
"DTB read hits")
236 .
desc(
"DTB read misses")
242 .
desc(
"DTB read accesses")
247 .
desc(
"DTB write hits")
252 .
desc(
"DTB write misses")
258 .
desc(
"DTB write accesses")
273 .
desc(
"DTB accesses")
285 if (req->getVaddr() & 0x3) {
286 DPRINTF(
TLB,
"Alignment Fault on %#x, size = %d\n", req->getVaddr(),
288 return std::make_shared<AlignmentFault>();
316 fatal(
"translate atomic not yet implemented in full system mode.\n");
351 PowerTLBParams::create()
void serialize(CheckpointOut &cp) const
Stats::Scalar read_misses
The request is to an uncacheable address.
decltype(nullptr) constexpr NoFault
static Fault checkCacheability(const RequestPtr &req)
#define fatal(...)
This implements a cprintf based fatal() function.
PowerISA::PTE * lookup(Addr vpn, uint8_t asn) const
void insertAt(PowerISA::PTE &pte, unsigned Index, int _smallPages)
std::shared_ptr< Request > RequestPtr
Stats::Scalar write_accesses
PowerISA::PTE & index(bool advance=true)
The request is required to be strictly ordered by CPU models and is non-speculative.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
virtual Process * getProcessPtr()=0
virtual void regStats()
Callback to set stat parameters.
Overload hash function for BasicBlockRange type.
Stats::Scalar read_accesses
void insert(Addr vaddr, PowerISA::PTE &pte)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
#define UNSERIALIZE_SCALAR(scalar)
std::string csprintf(const char *format, const Args &...args)
bool translate(Addr vaddr, Addr &paddr)
Translate function.
Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode) override
void regStats() override
Callback to set stat parameters.
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const override
Do post-translation physical address finalization.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of IniFile object.
Fault translateInst(const RequestPtr &req, ThreadContext *tc)
virtual const std::string name() const
#define SERIALIZE_SCALAR(scalar)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
EmulationPageTable * pTable
Declarations of a non-full system Page Table.
std::ostream CheckpointOut
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode) override
Stats::Scalar write_misses
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
int probeEntry(Addr vpn, uint8_t) const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Scoped checkpoint section helper class.
Fault translateData(const RequestPtr &req, ThreadContext *tc, bool write)
PowerISA::PTE * getEntry(unsigned) const
std::shared_ptr< FaultBase > Fault
void flushAll() override
Remove all entries from the TLB.