Forum Discussion
Altera_Forum
Honored Contributor
20 years agowell, I also have this kind of problem. If you have a look at the assembly code, you will find the variable is assigned later (but before it is first used). If you watch its value before the actual instructions for the assignment are executed, the debug client will give you whatever in the memory location allocated to this variable, which is invalid at that point.
I thought turning off optimization can get rid of some of this kind problems, but have never bothered to try it.