cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bigfrog
Contributor
Contributor
8,876 Views
Registered: ‎06-12-2015

microblaze debug, go randomly

Jump to solution

During debuging microblaze, the program goes randomly to any code line when I run single step. I check the disassembly code, found that the address does not increase by 4, for example:

 

[disassembly window]

.......

0x00007920    code1

0x00007924    code2

0x00007928    code3

0x0000792c    code4

0x00007930    code5

0x00007934    code6

0x00007938    code7

0x00007940    code8

0x00007950    code9

0x00007948    code10

0x0000795c    code11

0x00007964    code12

0x0000794c    code13

.......

 

The red part address does not always increase by 4. I checked the stack size(0x800) and heap size(0x400). The memory size is 128K(0x20000), and program size is less than 0x15000. It's enough. So I can not figure out why.

This situation happends in a function which is in BSP. Other functions are OK. This function is at the end of the disassembly code.

Who can help me?

 

0 Kudos
1 Solution

Accepted Solutions
bigfrog
Contributor
Contributor
15,552 Views
Registered: ‎06-12-2015

I konw the reason. The BSP code is optimized using -o2, but this can not be changed.

View solution in original post

0 Kudos
5 Replies
ddemmin
Participant
Participant
8,866 Views
Registered: ‎02-10-2009

Is this only during debugging or is normal operation acting similarly indeterminate?

 

If you place and route the design does the performance change?

 

Double check your timing constraints and timing report to make sure the microblaze is being constrained correctly.

 

Is your clock clean and stable?

0 Kudos
bwiec
Xilinx Employee
Xilinx Employee
8,862 Views
Registered: ‎08-02-2011
Have you enabled any compiler optimization?
www.xilinx.com
0 Kudos
bigfrog
Contributor
Contributor
8,857 Views
Registered: ‎06-12-2015

I find this problem only when debugging while I can not know the actual status if let the program free running. I place and route the design some times, and the results are same.

This problem only occurs when I use a function (XFlash initialization function). This function is in BSP generated with xilflash library selected. And only this function goes crazy. Other functions are always OK. When I comment out the function, the program run well.  So I do not think the timing constraints or clock has problems. I find that the ELF file size increases  significantly when using the function, but the memory size is enough.

0 Kudos
bigfrog
Contributor
Contributor
8,855 Views
Registered: ‎06-12-2015

I have not enabled any compiler optimization. (-00(none))

0 Kudos
bigfrog
Contributor
Contributor
15,553 Views
Registered: ‎06-12-2015

I konw the reason. The BSP code is optimized using -o2, but this can not be changed.

View solution in original post

0 Kudos