Forum Discussion
Altera_Forum
Honored Contributor
12 years agoYou're right. You're not getting a reset when you power the board up and the logic is clearly not doing all you want it to as a result.
As the board powers up you are probably getting a rising edge on 'rst' which may trigger your always blocks. However, since you only ever get a rising edge 'rst' is never sampled low. So, no reset is generated. It may not trigger the blocks in which case the first rising 'clk' edge will, by which time 'rst' is already high. I assume you need this to automatically reset when you power the board up. Can you get your hardware to reliably do that? Assuming that's not possible you will need to generate an internal, synchronous reset. The way I do this is to generate a small counter (2 or 3-bit should be enough given the resources available in MAXII devices.) This counter counts up to max-1 and stops. This counter is decoded to generate a synchronous reset at counter = max-2 and is then released. This caters for all registers in the device being reset to either 0 or 1 on power up. The counter immediately wraps to zero if registers are set following power up. Regards, Alex