Forum Discussion
Altera_Forum
Honored Contributor
16 years agoModelsim: Unknown State
In the modelsim simulation, there is a signal, delay1, shows its value and undefined state(red colour) periodically. It shouldn't show unknown state based on my code. I wonder why. Pls have a look...
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- I'm not a verilog expert, but it seems that you define q1 and q2 as tables with indexes between 1 and num_shiftreg, and set delay1 with q1[no_shiftreg] or q2[no_shiftreg]. But you also initialize no_shiftreg with the value 0. So in those cases delay1 will take an uninitialized value. You should either initialize no_shiftreg with 1 or use q1[no_shiftreg+1] / q2[no_shiftreg+1] --- Quote End --- Hi Daixiwen, you are right. q1[0] and q2[0] are never intialized, but used as input for Delay1. Kind regards GPK