05-16-2015 01:36 PM
I have built my own Microblaze configuration using EDK 14.7. The Mircoblaze runs on a Spartan 3 model xc3s1000 on a Digilent starter board rev E. The Microblaze I setup to use the onboard SRAM as extra data memory. After the Microblaze configuration I have exported the hardware to SDK. In SDK I have started a C project. In my C project my program did not behave like intended. The program is:
int i = 0, j = 0;
for(i=0; i <100; i++)
Here the “for loop” does not count right, as you can see on the picture below from the debugger where the variable j count faster than i. So far I am aware i and j should follow in count. Does anyone have a clue about what is happing here?
Here is a link to the hardware design rapport: https://www.dropbox.com/sh/469my3l253mjrcv/AACk8c5
05-17-2015 11:04 AM
The loop does something? It counts a variable?
I have also seen that when it checks the statement of a while-loop, it counts the variable up in the statement.
We have tried to use volatile, it worked for some time, but them stopped again, when the code got longer and more complicated.