DPRINTF(TLB, "Paging enabled.\n");
// The vaddr already has the segment base applied.
TlbEntry *entry = lookup(vaddr);
+ if (mode == Read) {
+ rdAccesses++;
+ } else {
+ wrAccesses++;
+ }
if (!entry) {
+ DPRINTF(TLB, "Handling a TLB miss for "
+ "address %#x at pc %#x.\n",
+ vaddr, tc->instAddr());
+ if (mode == Read) {
+ rdMisses++;
+ } else {
+ wrMisses++;
+ }
if (FullSystem) {
Fault fault = walker->start(tc, translation, req, mode);
if (timing || fault != NoFault) {
entry = lookup(vaddr);
assert(entry);
} else {
- DPRINTF(TLB, "Handling a TLB miss for "
- "address %#x at pc %#x.\n",
- vaddr, tc->instAddr());
-
Process *p = tc->getProcessPtr();
TlbEntry newEntry;
bool success = p->pTable->lookup(vaddr, newEntry);
return walker;
}
+void
+TLB::regStats()
+{
+ using namespace Stats;
+
+ rdAccesses
+ .name(name() + ".rdAccesses")
+ .desc("TLB accesses on read requests");
+
+ wrAccesses
+ .name(name() + ".wrAccesses")
+ .desc("TLB accesses on write requests");
+
+ rdMisses
+ .name(name() + ".rdMisses")
+ .desc("TLB misses on read requests");
+
+ wrMisses
+ .name(name() + ".wrMisses")
+ .desc("TLB misses on write requests");
+
+}
+
void
TLB::serialize(CheckpointOut &cp) const
{
TlbEntryTrie trie;
uint64_t lruSeq;
+ // Statistics
+ Stats::Scalar rdAccesses;
+ Stats::Scalar wrAccesses;
+ Stats::Scalar rdMisses;
+ Stats::Scalar wrMisses;
+
Fault translateInt(RequestPtr req, ThreadContext *tc);
Fault translate(RequestPtr req, ThreadContext *tc,
TlbEntry * insert(Addr vpn, TlbEntry &entry);
+ /*
+ * Function to register Stats
+ */
+ void regStats();
+
// Checkpointing
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;