OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /eco32/trunk
    from Rev 201 to Rev 202
    Reverse comparison

Rev 201 → Rev 202

/sim/mmu.c
28,7 → 28,18
static Word mmuBadAddr;
static Word mmuBadAccs;
 
static int randomIndex;
 
 
static void updateRandomIndex(void) {
if (randomIndex == TLB_FIXED) {
randomIndex = TLB_MASK;
} else {
randomIndex--;
}
}
 
 
static int assoc(Word page) {
int n, i;
 
64,6 → 75,7
pAddr = vAddr & ~0xC0000000;
} else {
/* mapped address space */
updateRandomIndex();
page = vAddr & PAGE_MASK;
offset = vAddr & OFFSET_MASK;
index = assoc(page);
217,9 → 229,7
int index;
 
/* choose a random index, but don't touch fixed entries */
do {
index = rand() & TLB_MASK;
} while (index < TLB_FIXED);
index = randomIndex;
tlb[index].page = tlbEntryHi & PAGE_MASK;
tlb[index].frame = tlbEntryLo & PAGE_MASK;
tlb[index].write = tlbEntryLo & TLB_WRITE ? true : false;
303,6 → 313,7
tlbEntryLo = rand() & (PAGE_MASK | TLB_WRITE | TLB_VALID);
mmuBadAddr = rand();
mmuBadAccs = rand() & MMU_ACCS_MASK;
randomIndex = TLB_MASK;
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.