Verilog HDL
From Simulation Success to Interview Errors: A Student’s Journey into RTL-Correct Verilog Coding
Introduction
Most students feel confident when their Verilog code runs perfectly in simulation. Waveforms look correct, outputs match expectations, and the testbench prints green tick marks. But this confidence collapses during RTL interviews or real hardware design tasks.
Why?
Because writing Verilog that behaves correctly in simulation is not the same as writing synthesizable, hardware-accurate RTL.
This article explains the journey from simulation comfort to real RTL understanding, and highlights the common interview errors students face—and how to avoid them.
STAGE 1: The Simulation Comfort Zone
In academic labs, Verilog is tested only for functional correctness. Students rely heavily on:
– initial blocks
– delays (#5)
– print statements ($monitor, $display)
– forced stimulus
– procedural clocks
This builds the misconception:
“If my simulation works, my design is correct.”
STAGE 2: The Interview Reality Check
Interviewers ask for synthesizable RTL, not simulation tricks.
Interview question:
“Write synthesizable Verilog for a mod‑10 counter.”
Example student response:
![]()
These constructs are simulation-only and have no meaning to synthesis tools. This is where students realize simulation success is not equal to hardware correctness.
STAGE 3: Understanding RTL Thinking
Simulation Thinking:
– Executes sequentially like software
– Uses delays for timing
– Registers start initialized
RTL Thinking:
– Hardware runs in parallel
– Timing controlled only by clock edges
– Registers power up unknown
– Must avoid latches
– Must use proper reset logic
Real RTL requires:
– always @(posedge clk) for sequential logic
– always @(*) for combinational logic
STAGE 4: Rising to RTL Excellence
Once students adopt proper RTL discipline, they:
Write correct sequential logic
Avoid unintended latches
Use clean reset structures
Understand synthesis warnings
Think in terms of hardware timing
Simulation proves functionality.
RTL correctness proves hardware feasibility.
EXAMPLE 1 — Blocking vs Non-Blocking Assignments
Blocking ‘=’ is WRONG inside sequential logic but correct inside combinational logic. Below is the wrong sequential example:
Wrong Sequential Block
![]()
Explanation (Why Wrong?)
Blocking ‘=’ updates immediately in simulation, causing r to receive the new q instead of the old one. Hardware flip-flops update simultaneously, so simulation and hardware behavior diverge.
Correct Sequential Block
![]()
Explanation (Why Correct?)
Non-blocking ‘<=’ schedules updates for the next clock edge, matching real flip-flop behavior. ‘r’ receives the old value of ‘q’, exactly like hardware should behave.
Correct Combinational Block (Blocking OK)
![]()
Explanation
Blocking ‘=’ is correct in combinational logic because it models gate-level immediate propagation, which reflects real combinational hardware behavior.
EXAMPLE 2 — Missing Else Causes Latch
Wrong vs correct coding for latch avoidance.
Wrong: Missing Else
![]()
Explanation (Why Wrong?)
Without an ELSE, the output ‘y’ holds its previous value when enable=0, causing synthesis to infer a latch. Latches introduce unintended memory and timing problems.
Correct: Full Assignment
![]()
Explanation (Why Correct?)
All conditions assign ‘y’, so no latch is inferred and the logic remains purely combinational.
EXAMPLE 3 — Delays in RTL (Not Synthesizable)
Delays (#5) are simulation-only and ignored by synthesis.
Wrong Delay Example
![]()
Explanation (Why Wrong?)
The ‘#5’ delay works only in simulation. Synthesis tools ignore delays completely, causing mismatch and unintended behavior in hardware.
Correct RTL Example
![]()
Explanation (Why Correct?)
Pure combinational logic without delays synthesizes correctly, and real hardware timing depends on actual gate propagation delay—not ‘#5’ constructs.
EXAMPLE 4 — initial Register Initialization
Registers must be initialized through resets in synthesizable RTL.
Wrong Initialization
![]()
Explanation (Why Wrong?)
Most FPGA/ASIC registers power up in unknown (X) states. Simulation initialization does not translate to hardware, leading to unpredictable startup behaviour.
Correct Reset Logic
![]()
Explanation (Why Correct?)
Reset logic ensures deterministic initialization of registers in hardware, making the design reliable on every power-up.
Final Message
Simulation is practice. RTL is the real match.
Write Verilog the way hardware behaves — not the way software executes.
75,221
SUBSCRIBERS
Subscribe to our Blog
Get the latest VLSI news, updates, technical and interview resources



