50 #include "debug/Power.hh"
51 #include "debug/TLB.hh"
53 #include "params/PowerTLB.hh"
58 using namespace PowerISA;
65 #define MODE2MASK(X) (1 << (X))
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")
288 return std::make_shared<AlignmentFault>();
316 fatal(
"translate atomic not yet implemented in full system mode.\n");
335 panic(
"Not implemented\n");
357 PowerTLBParams::create()
Stats::Scalar read_misses
decltype(nullptr) constexpr NoFault
Fault translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode)
Stub function for CheckerCPU compilation support.
Fault translateInst(RequestPtr req, ThreadContext *tc)
void insertAt(PowerISA::PTE &pte, unsigned Index, int _smallPages)
void serialize(CheckpointOut &cp) const
Stats::Scalar write_accesses
PowerISA::PTE & index(bool advance=true)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
virtual Process * getProcessPtr()=0
Stats::Scalar read_accesses
void insert(Addr vaddr, PowerISA::PTE &pte)
virtual void regStats()
Register statistics for this object.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const
#define UNSERIALIZE_SCALAR(scalar)
std::string csprintf(const char *format, const Args &...args)
bool translate(Addr vaddr, Addr &paddr)
Translate function.
The request is to an uncacheable address.
void regStats() override
Register statistics for this object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of IniFile object.
Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode)
#define SERIALIZE_SCALAR(scalar)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
void translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode)
PowerISA::PTE * getEntry(unsigned) const
virtual const std::string name() const
Declarations of a non-full system Page Table.
static Fault checkCacheability(RequestPtr &req)
std::ostream CheckpointOut
Fault translateData(RequestPtr req, ThreadContext *tc, bool write)
PowerISA::PTE * lookup(Addr vpn, uint8_t asn) const
The request is required to be strictly ordered by CPU models and is non-speculative.
Stats::Scalar write_misses
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
int probeEntry(Addr vpn, uint8_t) const
Scoped checkpoint section helper class.
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 flushAll() override
Remove all entries from the TLB.