Can anybody tell me why the code below will work when I'm in simulation mode, but not when I try to run it on my ADSP-BF533 EZ-KIT Lite?
cc = a0 < a1;
Can you provide more details? Does it not provide the correct result or an error resulted when trying to execute the instruction? Using VDSP while connected to an ADSP-BF533 EZ-KIT Lite, I was able to pre-load A0 and A1 in the Accumulators window and edit some opcodes in the disassembly window to a few nops and "cc=a0<a1;". I was able to step through and verify that the results were correct.
I don't get the correct results. I'm expecting cc = 1 when a0 < a1, but cc is always 0 and I don't conditional branch like I should. However, I get the correct results when running in simulation mode.
What are the values of A0 and A1? Do you run through and halt at a breakpoint on the ezkit or step through?
Okay to start, my values for r0 and r1 are 32-bit values which are really one 16-bit value in the upper half and one 16-bit value in the lower half. When I load the a0 and a1 registers I use the following code.
a0.w = r0;
a1.w = r1;
And when I do the comparison I use this code.
Now I'm comparing two 40-bit registers. I did it this way so that the 8 upper bits in a0 and a1 would be zeros and I wouldn't have to worry about negative values during the comparison.
I run to a halt just before this section of code and then I step through the code.
When doing a0.w = r0, you really populate only the lower 32 bits of a0. Same for a1. Now, if you do it this way, you need to make sure that the higher 8 bits of the accumulators are 0. So, if you want to make sure only positive numbers are being compared, precede your assignments with a1=a0=0;
Can you post the contents of your accumulators prior to the comparison?
I thought about that too, but as I'm stepping through the progam I'm watching the a0 and a1 values and the first 8-bits are always zeros. I guess what still bugs me is that the code behaves correctly in the VisualDSP++ sumulation mode, but not on the EZKIT board. Is there some kind of timing delay? I guess I'll go back the good old Monte Carlo method.
When stopping the run just before the comparison, do the accumulators have identical values both in simulation and in emulation modes?
Again, can you please post the two 40-bit values in the accumulators at that stage, from both runs?
At this time I don't have the EZKIT hardware or VisualDSP++ software in front of me (at work), so I can't answer your questions right now.
Yup... that was my next question as well. What are the values in A0 and A1?
Okay, so I set both a0 and a1 to zero before I load them with the values for comparison and my program seems to be working correctly now. Thanks for the help.
Retrieving data ...