Hi all,
I am looking at how the TLB is implemented (riscv ISA). In particular, I
am interested in TLB statistics.
I noticed that, in the TLB::lokup method
(https://github.com/gem5/gem5/blob/stable/src/arch/riscv/tlb.cc#L109),
there is an input argument (i.e., hidden) which determines whether the
TLB lookup should or should not update TLB statistics.
In the TLB::doTranslate
(https://github.com/gem5/gem5/blob/stable/src/arch/riscv/tlb.cc#L278)
method, the first lookup updates TLB statistics (i.e., hidden=false).
After a TLB miss, the page walker is invoked and the TLB is looked up
again in the same way.
The source code is the following:
TlbEntry *e = lookup(vaddr, satp.asid, mode, *false*);
if (!e) {
Fault fault = walker->start(tc, translation, req, mode);
if (translation != nullptr || fault != NoFault) {
// This gets ignored in atomic mode.
delayed = true;
return fault;
}
e = lookup(vaddr, satp.asid, mode, *false*);
assert(e != nullptr);
}
I was wondering if this behavior is correct.
Shouldn't we just count the first TLB miss and use the second TLB access
only to check the correctness of the page walker? Also because surely
the second TLB lookup will definitely result in a TLB hit, otherwise the
simulation is interrupted by an assert.
Thanks in advance,
Mirco
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org