Home / Learn Verilog / Common Errors List
Common Errors List
Twelve typical mistakes and fixes.
In shortTwelve typical mistakes and fixes.
What's actually going on
What it is
A table of common mistakes, the cause and the fix.
Why it matters
Most bugs repeat; recognising them saves hours.
Mechanically speaking
Keep this next to you while debugging.
Shows up in
- Practice
- Interviews
| Symptom | Cause | Fix |
|---|---|---|
| Latch inferred | Missing else/default in always @(*) | Assign defaults first |
| Output is x | Register never reset or initialised | Add reset |
| Output is z | Port not connected or undriven | Check instance connections |
| Race between blocks | Using = for flip-flops | Use <= in clocked blocks |
| Simulation never ends | No $finish and a free-running clock | Add $finish |
| Wrong width result | Operand widths differ | Declare widths explicitly |
| Multiple drivers | Two assigns on the same wire | Use one driver or tristate |
| Mismatch simulation vs hardware | Delays or initial values used | Remove # delays from RTL |
| Timing fails | Long combinational path | Pipeline it |
| Counter skips | Compare with wrong width | Check the constant width |
| Case does not match | x/z in the case | Use casez or fix inputs |
| Signed compare wrong | Mixed signed and unsigned | Declare both signed |