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 284 to Rev 285
- ↔ Reverse comparison
Rev 284 → Rev 285
/sim/mmu.c
189,7 → 189,7
|
|
void mmuSetEntryLo(Word value) { |
tlbEntryLo = value & (PAGE_MASK | TLB_WRITE | TLB_VALID); |
tlbEntryLo = value & (FRAME_MASK | TLB_WRITE | TLB_VALID); |
} |
|
|
231,7 → 231,7
/* choose a random index, but don't touch fixed entries */ |
index = randomIndex; |
tlb[index].page = tlbEntryHi & PAGE_MASK; |
tlb[index].frame = tlbEntryLo & PAGE_MASK; |
tlb[index].frame = tlbEntryLo & FRAME_MASK; |
tlb[index].write = tlbEntryLo & TLB_WRITE ? true : false; |
tlb[index].valid = tlbEntryLo & TLB_VALID ? true : false; |
if (debugWrite) { |
263,7 → 263,7
|
index = tlbIndex & TLB_MASK; |
tlb[index].page = tlbEntryHi & PAGE_MASK; |
tlb[index].frame = tlbEntryLo & PAGE_MASK; |
tlb[index].frame = tlbEntryLo & FRAME_MASK; |
tlb[index].write = tlbEntryLo & TLB_WRITE ? true : false; |
tlb[index].valid = tlbEntryLo & TLB_VALID ? true : false; |
if (debugWrite) { |
298,7 → 298,7
cPrintf("Resetting MMU...\n"); |
for (i = 0; i < TLB_SIZE; i++) { |
tlb[i].page = rand() & PAGE_MASK; |
tlb[i].frame = rand() & PAGE_MASK; |
tlb[i].frame = rand() & FRAME_MASK; |
tlb[i].write = rand() & 0x1000 ? true : false; |
tlb[i].valid = rand() & 0x1000 ? true : false; |
if (debugWrite) { |
310,7 → 310,7
} |
tlbIndex = rand() & TLB_MASK; |
tlbEntryHi = rand() & PAGE_MASK; |
tlbEntryLo = rand() & (PAGE_MASK | TLB_WRITE | TLB_VALID); |
tlbEntryLo = rand() & (FRAME_MASK | TLB_WRITE | TLB_VALID); |
mmuBadAddr = rand(); |
mmuBadAccs = rand() & MMU_ACCS_MASK; |
randomIndex = TLB_MASK; |
/sim/mmu.h
25,7 → 25,7
|
typedef struct { |
Word page; /* 20 high-order bits of virtual address */ |
Word frame; /* 20 high-order bits of physical address */ |
Word frame; /* 18 high-order bits of physical address */ |
Bool write; /* must be true to allow writing to the page */ |
Bool valid; /* must be true for the entry to be valid */ |
} TLB_Entry; |
/sim/command.c
796,7 → 796,7
tlbEntry.page = data & PAGE_MASK; |
} else |
if (strcmp(tokens[2], "f") == 0) { |
tlbEntry.frame = data & PAGE_MASK; |
tlbEntry.frame = data & FRAME_MASK; |
tlbEntry.write = data & TLB_WRITE ? true : false; |
tlbEntry.valid = data & TLB_VALID ? true : false; |
} else { |
/sim/common.h
36,7 → 36,8
|
#define PAGE_SIZE (4 * K) /* size of a page and a page frame */ |
#define OFFSET_MASK (PAGE_SIZE - 1) /* mask for offset within a page */ |
#define PAGE_MASK (~OFFSET_MASK) /* mask for page number */ |
#define PAGE_MASK (~OFFSET_MASK) /* mask for page number */ |
#define FRAME_MASK (PAGE_MASK & ~0xC0000000) /* mask for frame number */ |
|
#define CC_PER_USEC 50 /* clock cycles per microsecond */ |
#define CC_PER_INSTR 18 /* clock cycles per instruction */ |