Line 23... |
Line 23... |
#include "abstract.h"
|
#include "abstract.h"
|
#include "stats.h"
|
#include "stats.h"
|
#include "sprs.h"
|
#include "sprs.h"
|
#include "except.h"
|
#include "except.h"
|
#include "sim-config.h"
|
#include "sim-config.h"
|
|
#include "debug.h"
|
|
|
extern int cont_run;
|
extern int cont_run;
|
|
|
/* Data MMU */
|
/* Data MMU */
|
|
|
Line 81... |
Line 82... |
runtime.sim.mem_cycles += config.dmmu.hitdelay;
|
runtime.sim.mem_cycles += config.dmmu.hitdelay;
|
ppn = mfspr(SPR_DTLBTR_BASE(way) + set) / config.dmmu.pagesize;
|
ppn = mfspr(SPR_DTLBTR_BASE(way) + set) / config.dmmu.pagesize;
|
return (ppn * config.dmmu.pagesize) + (virtaddr % config.dmmu.pagesize);
|
return (ppn * config.dmmu.pagesize) + (virtaddr % config.dmmu.pagesize);
|
}
|
}
|
else { /* No, we didn't. */
|
else { /* No, we didn't. */
|
int minlru = config.dmmu.nsets - 1;
|
|
int minway = 0;
|
|
|
|
dmmu_stats.loads_tlbmiss++;
|
dmmu_stats.loads_tlbmiss++;
|
#if 0
|
#if 0
|
for (i = 0; i < config.dmmu.nways; i++)
|
for (i = 0; i < config.dmmu.nways; i++)
|
if (getsprbits(SPR_DTLBMR_BASE(i) + set, SPR_DTLBMR_LRU) < minlru)
|
if (getsprbits(SPR_DTLBMR_BASE(i) + set, SPR_DTLBMR_LRU) < minlru)
|
minway = i;
|
minway = i;
|
Line 240... |
Line 238... |
/* Scan set(s) and way(s). */
|
/* Scan set(s) and way(s). */
|
for (set = start_set; set < end_set; set++) {
|
for (set = start_set; set < end_set; set++) {
|
PRINTF("\nSet %x: ", set);
|
PRINTF("\nSet %x: ", set);
|
for (way = 0; way < config.dmmu.nways; way++) {
|
for (way = 0; way < config.dmmu.nways; way++) {
|
PRINTF(" way %d: ", way);
|
PRINTF(" way %d: ", way);
|
PRINTF("vpn=%x ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_VPN));
|
PRINTF("vpn=%lx ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_VPN));
|
PRINTF("lru=%x ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_LRU));
|
PRINTF("lru=%lx ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_LRU));
|
PRINTF("pl1=%x ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_PL1));
|
PRINTF("pl1=%lx ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_PL1));
|
PRINTF("v=%x ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_V));
|
PRINTF("v=%lx ", getsprbits(SPR_DTLBMR_BASE(way) + set, SPR_DTLBMR_V));
|
|
|
PRINTF("a=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_A));
|
PRINTF("a=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_A));
|
PRINTF("d=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_D));
|
PRINTF("d=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_D));
|
PRINTF("ure=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_URE));
|
PRINTF("ure=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_URE));
|
PRINTF("uwe=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_UWE));
|
PRINTF("uwe=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_UWE));
|
PRINTF("sre=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_SRE));
|
PRINTF("sre=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_SRE));
|
PRINTF("swe=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_SWE));
|
PRINTF("swe=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_SWE));
|
PRINTF("ppn=%x ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_PPN));
|
PRINTF("ppn=%lx ", getsprbits(SPR_DTLBTR_BASE(way) + set, SPR_DTLBTR_PPN));
|
}
|
}
|
}
|
}
|
if (start_set < end_set) PRINTF("\n");
|
if (start_set < end_set) PRINTF("\n");
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|