Skip to main content

Synthesis

· loading · loading · · ·
HDL Verilog HDL
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
Verilog HDL Series - This article is part of a series.
Part 18: This Article

πŸ—οΈ What is Synthesis?
#

Synthesis is the process of transforming RTL Verilog code into a gate-level netlist that can be mapped onto physical hardware (FPGA or ASIC).

πŸ”§ What happens during synthesis:
#

  • Converts always/assign logic into gates and flip-flops.
  • Resolves parameters and logic expressions.
  • Applies optimization for area, speed, and power.

⚠️ Constructs to Avoid in Synthesizable Code
#

Construct Why It’s Problematic Use Instead
initial block Not supported in synthesis Use reset logic
#delay Simulation-only delay Use clocked always
$display, $monitor Not synthesizable Use in testbenches only
for, while (variable bound) May not converge Use generate with fixed range
Dynamic memory Unsupported in hardware Use fixed-size arrays

🎨 How RTL Coding Style Affects Synthesis
#

βœ… Good Practices:
#

  • Use always @(posedge clk) + <= (non-blocking) for sequential logic.
  • Use always @(*) + = (blocking) for combinational logic.
  • Fully assign outputs to avoid unintended latches.
  • Keep sensitivity lists complete or use (*).

❌ Bad Practices:
#

  • Mixing = and <= in the same block.
  • Partial assignments β†’ inferred latches.
  • Using simulation-only constructs in synthesizable code.

❗ Example: Unintended Latch Inference
#

always @(*) begin
  if (en)
    y = a;  // Latch inferred if en is false
end

βœ… Corrected version:

always @(*) begin
  if (en)
    y = a;
  else
    y = 0;
end

πŸ” Summary Table
#

Topic Behavioral Sim Gate-Level Sim Synthesis
Simulation speed Fast Slow N/A
RTL constructs Allowed Flattened Synthesizable
Timing modeling Approximate Accurate Deterministic
Usage Functional test Final verification Netlist generation
Delay support Yes (#) Yes (SDF) No

Verilog HDL Series - This article is part of a series.
Part 18: This Article

Related

Command-Line Input
· loading · loading
HDL Verilog HDL
Module Definition, Usage, and Constructs
· loading · loading
HDL Verilog HDL
Verilog RTL Design – Best Practices
· loading · loading
HDL Verilog HDL
Blocking vs Non-Blocking Assignments
· loading · loading
HDL Verilog HDL
Compiler Directives & Macros
· loading · loading
HDL Verilog HDL
Control Flow
· loading · loading
HDL Verilog HDL