Forum Discussion
Altera_Forum
Honored Contributor
12 years agoYour 'init' variable isn't doing what you want it to - i.e. being set to a '1' from 'power up' or reprogramming the FPGA. Declaring 'reg init=1' as you have will not result in that register taking that value. So, your conditional statement where you are testing init is never returning true and your code never runs.
You need to encode a way of setting init, either by means of a more traditional reset signal that triggers your always statement, or by means of a reset counter that starts up when the device does. Assuming you have a button on your hardware I'd suggest the former might be easier. Extend your always statement to look for an edge generated by your new 'reset' button. If active, set 'init'. Once the button is released your conditional statement will return true, triggering the block to run. Regards, Alex