URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 524 to Rev 525
- ↔ Reverse comparison
Rev 524 → Rev 525
/trunk/or1ksim/cpu/common/abstract.c
54,6 → 54,9
/* Temporary variable to increase speed. */ |
struct dev_memarea *cur_area; |
|
/* Virtual address of current access. */ |
unsigned long cur_vadd; |
|
/* It returns physical address. */ |
inline unsigned long translate_vrt_to_phy_add(unsigned long virtaddr, int write_access) |
{ |
234,6 → 237,7
struct dev_memarea *dev; |
|
slp_checkaccess(memaddr, SLP_MEMREAD); |
cur_vadd = memaddr; |
if (DEBUG_ENABLED) |
*breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */ |
temp = evalsim_mem32(memaddr); |
250,6 → 254,7
struct dev_memarea *dev; |
|
slp_checkaccess(memaddr, SLP_MEMREAD); |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_load(memaddr); |
if (pending.valid) |
return 0; |
269,7 → 274,7
struct dev_memarea *dev; |
|
slp_checkaccess(memaddr, SLP_MEMREAD); |
// memaddr = simulate_ic_mmu_fetch(memaddr); |
cur_vadd = pc; |
ic_simulate_fetch(memaddr); |
if (DEBUG_ENABLED) |
*breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */ |
303,7 → 308,7
fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp); |
} else { |
printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
temp = 0; |
} |
return temp; |
314,6 → 319,7
unsigned short eval_mem16(unsigned long memaddr,int* breakpoint) |
{ |
unsigned short temp; |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_load(memaddr); |
if (pending.valid) |
return 0; |
348,7 → 354,7
fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp); |
} else { |
printf("EXCEPTION: read out of memory (16-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
temp = 0; |
} |
return temp; |
360,6 → 366,7
unsigned char eval_mem8(unsigned long memaddr,int* breakpoint) |
{ |
unsigned char temp; |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_load(memaddr); |
if (pending.valid) |
return 0; |
391,7 → 398,7
fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp); |
} else { |
printf("EXCEPTION: read out of memory (8-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
temp = 0; |
} |
return temp; |
402,6 → 409,7
void set_mem32(unsigned long memaddr, unsigned long value,int* breakpoint) |
{ |
slp_checkaccess(memaddr, SLP_MEMWRITE); |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_store(memaddr); |
|
/* If we produced exception don't set anything */ |
440,7 → 448,7
} |
} else { |
printf("EXCEPTION: write out of memory (32-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
} |
} |
|
448,6 → 456,7
|
void set_mem16(unsigned long memaddr, unsigned short value,int* breakpoint) |
{ |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_store(memaddr); |
|
/* If we produced exception don't set anything */ |
482,7 → 491,7
} |
} else { |
printf("EXCEPTION: write out of memory (16-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
} |
} |
|
490,6 → 499,7
|
void set_mem8(unsigned long memaddr, unsigned char value,int* breakpoint) |
{ |
cur_vadd = memaddr; |
memaddr = simulate_dc_mmu_store(memaddr); |
|
/* If we produced exception don't set anything */ |
517,7 → 527,7
} |
} else { |
printf("EXCEPTION: write out of memory (8-bit access to %.8lx)\n", memaddr); |
except_handle(EXCEPT_BUSERR, memaddr); |
except_handle(EXCEPT_BUSERR, cur_vadd); |
} |
} |
|
/trunk/or1ksim/testbench/except_test.c
659,9 → 659,8
ret = call (ea, 0); |
ASSERT(except_count == 1); |
ASSERT(except_mask == (1 << V_BERR)); |
printf("except_pc = %.8lx except_ea = %.8lx\n", except_pc, except_ea); |
ASSERT(except_pc == ea); |
ASSERT(except_ea == ea + PAGE_SIZE); |
ASSERT(except_ea == ea); |
|
/* Disable IMMU */ |
immu_disable (); |
703,7 → 702,7
ASSERT(except_count == 1); |
ASSERT(except_mask == (1 << V_BERR)); |
ASSERT(except_pc == (unsigned long)load_acc_32 + 8); |
ASSERT(except_ea == ea + PAGE_SIZE); |
ASSERT(except_ea == ea); |
ASSERT(ret == 0x12345678); |
|
/* Disable DMMU */ |