Forum Discussion
Altera_Forum
Honored Contributor
16 years agonoping
Hi, if I want the NIOS to do nothing or nop for 100 cycles so does this code below work it well, for (i=0; i< 99; i++) { asm ("nop"); } In other words, does every "nop" pause th...
Altera_Forum
Honored Contributor
16 years agoYou might want to write the whole thing in assembly if you want exactly 100 cycles.
Or better yet if you don't want the CPU doing anything during these delay times just create a custom instruction that takes 99 cycles to complete. This should be a simple as loading a down counter with 100 when the 'start' bit is asserted and when the counter reaches '1' assert the 'done' bit. Then when the counter hits 0 hold it until the next time the custom instruction is run. By the way what are you trying to do by stalling the CPU for 100 cycles?