Wednesday, 7 October 2015

fpga - Usage of "initial" in Verilog module description


I'm writting a code and I have 2 dumb questions:


1- Is it a bad practice to use "initial" in the module description?



I'm asking this because I have a frequency divider with 2 signals (clk_in and clk_out). If I want to see the behaviour in simulation, I have to give an initial value to clk_out, otherwise clk_out will always keep as X. Then, I used "initial" instead of using a reset signal.


2- Why the code without initializing the output works fine in the FPGA but it doesn't in simulation?


My code basically do this: Clk_out <= ~Clk_out;


Thanks in advance.




No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...