Download Xilinx XAPP1117 Software Debugging Techniques for Xilinx

Transcript
R
Debugging TLB Errors
* Unmap a page of memory, and then access that virtual address.
*/
void gen_data_tlb_miss (void) {
volatile unsigned *ptr;
unsigned val, page;
xil_printf("Entering gen_data_tlb_miss\n\r");
/* The virtual address to access */
ptr = (unsigned*) UNMAPPED_DATA_ADDRESS;
/*
* Unmap this page
*/
page = XTlb_FindPage(UNMAPPED_DATA_ADDRESS, 0, TS_DATA);
xil_printf("Erasing TLB entry #%d\n\r", page);
XTlb_ErasePage(page);
/* Without a context synchronization here, the following will not
* cause the desired TLB miss.
*/
XTlb_Commit();
xil_printf("Reading from 0x%x\n\r", (unsigned)ptr);
/*
* An exception will occur here.
*/
val = *ptr;
xil_printf("0x%x read from 0x%x\n\r", val, (unsigned)ptr);
xil_printf("Exiting gen_data_tlb_miss\n\r");
}
Download and run the TestApp_Crash.elf file:
XMD% dow TestApp_Crash.elf
XMD% run
From the application menu, choose
9) Setup software exception handler
and then choose
7) TLB Miss (data)
The application will crash with a TLB Miss exception:
Entering gen_data_tlb_miss
Erasing TLB entry #23
Reading from 0xB000000C
STACK MAXIMUM DEPTH: 0x1D8 bytes out of 0x4004 total.
=========================================================
Data Exception Address: 0xB000000C
TLB miss (data) - load Exception at: 0x00001164
FRAME: 0x0000A390 RETURN 0x00001160
FRAME: 0x0000A430 RETURN 0x00001160
FRAME: 0x0000A450 RETURN 0x00001550
FRAME: 0x0000A478 RETURN 0x000015C0
FRAME: 0x0000A488 RETURN 0x00000444
=========================================================
XAPP1117 (v1.0) August 21, 2008
www.xilinx.com
21