What is the purpose of the “initial” block in Verilog?
What is the purpose of the “initial” block in Verilog?
- To define the primary clock
- To initialize variables at the beginning of the simulation
- To specify timing constraints
- To define a counter
Correct answer
B. To initialize variables at the beginning of the simulation
Explanation
An initial block runs once from simulation start and is common in testbenches. Whether its contents synthesize depends on the construct and flow.