Forum Discussion
Altera_Forum
Honored Contributor
13 years agoIssue with polling in Nios
Hi, I've got a custom component that produces some results from time to time, I want Nios processor to monitor the process by polling and whenever a result is produced, it is written to a exter...
Altera_Forum
Honored Contributor
10 years agoIf the compiler was optimizing out 'data' then it most likely turned the while loop into a simple if statement. The justification for this is without volatile the compiler will assume that reading the location multiple times will result in the same data being read and the optimization is to turn it into a single read. Volatile lets the compiler know that something outside of the executable execution will modify that location, it's common to use volatile when accessing hardware or shared memory locations.