Logic Synthesis in VLSI: Flow, Constraints, QoR and Debug

Logic Synthesis in VLSI: Flow, Constraints, QoR and Debug

Logic synthesis in VLSI explained with real Yosys, OpenSTA and OpenROAD runs on ASAP7: elaboration, generic optimisation and technology mapping, how constraints and load models drive QoR, RTL style and resource sharing, latch inference, synthesis-to-placement correlation, a debug flowchart and interview Q&As.

Logic synthesis is the step that turns RTL into a gate-level netlist built from real library cells. Everything physical design does later (floorplan, placement, CTS, routing, sign-off) starts from that netlist, so a poor synthesis result shows up later as congestion, DRVs and timing that never closes. This post walks through the synthesis flow and the constraints that drive it, then shows what to check in the results. The worked examples use real runs: Yosys 0.71 for synthesis, OpenSTA for timing and OpenROAD for a quick placement, all on the open ASAP7 7 nm predictive library and on the gcd and aes designs from OpenROAD-flow-scripts (ORFS).

All numbers below come from those runs unless a line is marked illustrative. ASAP7 is a predictive academic PDK, so treat the absolute values as teaching data, not as figures for any foundry process.

What logic synthesis does

A synthesis tool takes three things: a design written at register-transfer level (Verilog, SystemVerilog or VHDL), a target cell library and a set of constraints. It produces a netlist that is functionally equivalent to the RTL and that meets the constraints at the lowest cost in area and power. It has three jobs:

  1. Translation: understand the RTL, resolve the hierarchy and parameters, and infer registers, latches, multiplexers, arithmetic and state machines.
  2. Optimisation: simplify the logic (constant propagation, redundancy removal, resource sharing, restructuring) on a technology-independent representation.
  3. Mapping: implement that logic with the cells the library offers, sizing and buffering them so that the timing, transition, capacitance and fanout limits are met.

What synthesis does not know well is the wiring. Before placement there are no real wire lengths, so the tool ignores wires, uses a wire-load model (a statistical estimate of net capacitance from fanout) or, in physical-aware flows, does a quick placement on a floorplan. That gap is why a design that “meets timing in synthesis” can fail after placement.

Inputs and outputs

Input What it gives synthesis Typical problem if wrong
RTL + file list, defines, top name The function to build Missing module becomes a blackbox; wrong `define changes the logic
Liberty (.lib) for each corner Cell functions, area, timing, power, max transition/capacitance Wrong corner gives optimistic or pessimistic mapping
SDC Clocks, I/O delays, loads, exceptions Unconstrained paths are not optimised at all
dont_use / dont_touch lists Cells to avoid or keep Weak or special cells end up in the netlist
Physical data (physical-aware flows) Floorplan DEF, LEF, RC tech data Poor correlation with placement
UPF (low-power designs) Power domains, isolation, level shifters, retention Missing or wrong low-power cells

The outputs are the gate-level netlist, the SDC that goes with it and the reports (area, timing, power, check/lint and constraint coverage). For a deeper look at these files, see Physical Design Inputs in VLSI, the timing library (.lib) and SDC constraints.

The synthesis flow, step by step

Logic synthesis flow in five steps: read and elaborate, coarse word-level optimisation, generic gates, technology mapping and post-map optimisation, with the real gcd counts after each step: 15 process blocks, 41 word-level cells, 278 generic gates and 237 ASAP7 cells of 35.41 square microns
The logic synthesis flow, with the real gcd counts after each step (Yosys 0.71, ASAP7).

The figure follows the real gcd run through the stages that Yosys’s synth script runs. Commercial tools use different command names but follow the same order. In Design Compiler the design is read with analyze/elaborate and then compiled (for example compile_ultra). In Genus it is read_hdl/elaborate followed by syn_generic, syn_map and syn_opt.

1. Read and elaborate

The tool parses the source, picks the top module, resolves parameters and builds the hierarchy. always and assign blocks become process blocks and word-level operators. In gcd, elaboration gave 10 modules with 15 process blocks and word-level cells such as one $sub, one $lt, seven $eq and a $mux.

Read the log carefully here: unresolved references, implicit wires, width mismatches and inferred latches are all reported at this stage, when they are cheapest to fix.

2. Coarse (word-level) optimisation

At word level the tool still sees “a 16-bit subtractor” rather than gates, so it can make big decisions cheaply. These include constant propagation, removal of logic that drives nothing, FSM extraction and re-encoding, bit-width reduction and resource sharing. In the real gcd run, the subtractor and the less-than comparator work on the same two operands. Yosys’s alumacc pass turned them into a single $alu cell, which left 41 word-level cells.

3. Generic gates

Next the word-level cells are broken into technology-independent single-bit gates (Synopsys calls this generic library GTECH). Yosys uses cells like $_AND_, $_XOR_, $_MUX_ and $_DFFE_PP_. Boolean optimisation runs here. gcd became 278 generic gates, including 32 enable flops and 3 plain flops.

4. Technology mapping

Flip-flops are mapped to library flops and combinational logic is mapped to library cells. The ASAP7 libraries used here have no enable flop, so the 32 enable flops were legalised into a plain D flop with a feedback multiplexer (dfflegalize) and mapped to DFFHQx4. Yosys hands the combinational logic to ABC, the logic synthesis and mapping system from UC Berkeley, which maps it against the Liberty cells. With the default recipe the result was 237 ASAP7 cells and 35.41 um^2, of which the 35 flops are 36.0%.

5. Post-map optimisation and checks

Finally the tool sizes cells, inserts buffers on high-fanout or long nets, adds tie cells for constants (tie cells), cleans up the netlist and reports. Commercial flows often run more steps here, depending on the scripts: clock-gating insertion (clock gating and ICG), multi-Vt swapping, scan insertion and multi-bit flop banking (MBFF).

Here is the Yosys script used for every mapped run in this post. The abc line is the only one that changes between recipes:

read_verilog <rtl files>
synth -top <top> -flatten
dfflegalize -cell $_DFF_P_ 01
dfflibmap -liberty asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib
opt
abc -liberty <SIMPLE, INVBUF, AO, OA RVT FF libs> -dont_use *xp*_ASAP7* -dont_use *x1p*_ASAP7* <recipe>
hilomap -hicell TIEHIx1_ASAP7_75t_R H -locell TIELOx1_ASAP7_75t_R L
setundef -zero
splitnets
opt_clean -purge
stat -liberty <all libs>
write_verilog -noattr -noexpr netlist.v

Constraints drive synthesis

Synthesis is constraint-driven. The tool only works hard on what it is told matters:

  • Clocks and I/O delays set the timing goal for every register-to-register, input-to-register and register-to-output path. A path with no clock or no I/O delay is unconstrained, and the tool may build it from the smallest, slowest cells. Always run a constraint check (check_setup in OpenSTA, check_timing in commercial tools) before trusting a synthesis timing report.
  • Design rule constraints (max transition, max capacitance, max fanout) come from the library and the SDC and normally take priority over timing. See DRVs in VLSI.
  • Driving cell and output load tell the tool how strong the inputs are and how much load the outputs see. Without them the ports are ideal, which hides real delay.
  • Exceptions (false and multicycle paths) stop the tool from wasting area on paths that do not need it. They must be correct, because a wrong false path hides a real bug.
  • Corners: synthesis usually runs at one or two slow corners; later stages close the rest (MMMC).

The next example shows how much one missing piece, a load model, can matter.

Worked example 1 (real): three mapping recipes on aes

The aes_cipher_top design (562 flops) was synthesised three times from the same RTL with the same libraries and dont_use list. Only the ABC step changed:

  • default: Yosys’s built-in ABC script with no -constr file, so no driver or load model.
  • area: the ORFS abc_area.script with a constraint file setting the driving cell to BUFx2_ASAP7_75t_R and the load to 3.898 fF (the ORFS ASAP7 defaults ABC_DRIVER_CELL and ABC_LOAD_IN_FF).
  • speed: the ORFS abc_speed.script (the ORFS default, since ABC_AREA defaults to 0) with the same constraint file.

Each netlist was then timed in OpenSTA with the ORFS aes SDC (380 ps clock, ideal clock latency 77.93 ps, 20% I/O delays). This is a pre-layout analysis, so there is no wire RC, only pin capacitances.

Recipe Cells Area (um^2) BUF / INV cells Worst setup slack TNS Max-slew / max-cap violations
default, no load model 9,943 1,202.63 0 / 201 -568.05 ps -106,430.10 ps 398 pins / 3 nets
ORFS area script + driver/load 14,019 1,558.43 810 / 750 +32.64 ps 0 0 / 0
ORFS speed script + driver/load 14,083 1,584.98 1,718 / 223 +25.34 ps 0 0 / 0
Bar charts for the aes design on ASAP7: cell area of 1,203, 1,558 and 1,585 square microns and worst setup slack of -568.05, +32.64 and +25.34 ps for the default, area and speed recipes, and a line showing the area-recipe slack falling from +32.64 ps at synthesis to -53.32 ps after placement and -40.09 ps after repair_design
Three mapping recipes on aes (area and pre-layout slack), and what placement RC did to the synthesis slack.

The smallest netlist was by far the worst. The cause is in the worst path:

 Cap     Slew    Delay   Time    Description
 230.22    0.00    0.00  153.93 v ld (in)
 160.31  948.20  420.66  574.59 ^ _09382_/Y (INVx1_ASAP7_75t_R)
 ...
                        1023.83   data arrival time
                         -568.05  slack (VIOLATED)
Schematic comparing one INVx1 driving 235 loads with 160.31 fF, 948.20 ps slew and -568.05 ps slack in the default netlist, against a buffered tree in the load-aware netlist with no slew or capacitance violations and +32.64 ps slack
Why the smallest netlist failed: one INVx1 driving 235 loads without a load model.

Without a load model, ABC let a single INVx1 drive the ld control signal to 235 loads: 160.31 fF against a library limit of 46.08 fF. The slew was 948.20 ps against a 320 ps limit, and that one cell took 420.66 ps, more than the whole clock period. With the driver/load file, ABC’s buffer, upsize and dnsize steps built buffer trees and sized cells. That cost about 30% more area and removed every violation.

In this run the speed script came out slightly worse than the area script (+25.34 vs +32.64 ps), with twice as many buffers. Neither script sees the clock period (the current ORFS flow passes no delay target to ABC), and at tighter periods the two stayed within a few ps of each other (at 300 ps: -35.09 vs -38.66 ps). The lesson is not “area beats speed”. Measure each recipe on your design with real STA instead of trusting its name.

Worked example 2 (real): RTL style and resource sharing

The same function can be written in ways that synthesise very differently. Two 16-bit versions were synthesised in isolation with the default ABC recipe:

Two RTL styles for a selected sum: style A adds a+b and c+d and then selects, giving 2 alu and 1 mux cells and 143 cells of 17.73 square microns; style B selects operands first and uses one adder, giving 1 alu and 2 mux cells and 116 cells of 13.09 square microns
Same function, two RTL styles: selecting operands before one adder was 26% smaller in a real Yosys run.

Style A (sel ? a+b : c+d) kept two adders after coarse optimisation: 143 cells and 17.73 um^2. Style B ((sel?a:c) + (sel?b:d)) has one adder behind two multiplexers: 116 cells and 13.09 um^2, about 26% smaller. Commercial tools often find this sharing on their own, but not always, and sharing can lengthen the path because the mux now sits in front of the adder. Arithmetic, wide comparators and multipliers are where RTL structure matters most, so look at them first when the area is high.

Worked example 3 (real): an accidental latch

A combinational always @(*) block that does not assign its output on every branch makes the tool keep the old value, and that means a latch:

always @(*) begin
  if (en) q = d;      // no else: q must hold its value
end

Yosys reported Warning: Latch inferred for signal \latch_bug.\q and the netlist got four $_DLATCH_P_ cells, one per bit. With a default assignment (q = q_old; before the if), the same block became 9 gates (0.74 um^2) and no latch. Unintended latches create time-borrowing paths that STA treats differently from flops (time borrowing, latch vs flip-flop), and they are a DFT problem too. Make “zero unintended latches” a sign-off check for every synthesis run.

Synthesis-to-placement correlation (real)

To see how much synthesis slack is worth, the area-recipe aes netlist (+32.64 ps) was placed in OpenROAD at 55% utilisation. The parasitics were estimated from placement with the ORFS ASAP7 RC settings:

Stage Worst setup slack TNS
Synthesis netlist (pin caps only) +32.64 ps 0
After global placement, placement RC -53.32 ps -3,293.53 ps
After repair_design (9,280 instances resized) -40.09 ps -2,532.61 ps

The wires cost about 86 ps on a 380 ps clock. This is why teams synthesise with margin (a tighter clock or extra uncertainty), use wire-load models or, better, physical-aware synthesis. In physical-aware synthesis, the floorplan (DEF), LEF and RC data are read in and the tool places the cells coarsely while it optimises, so its timing correlates much better with the placement tool. Placement-stage optimisation then closes what is left (physical design flow).

What to check in synthesis results (QoR)

Check What good looks like Why
Log errors and warnings No unresolved modules, no unexpected latches, no multi-driven nets Functional problems hide here
Constraint coverage No unconstrained endpoints, all clocks defined Unconstrained logic is not optimised
WNS / TNS per path group Met with margin, or understood Wire RC will take some of it away
DRVs No max transition/cap/fanout violations They become timing and SI problems later
Area and cell count by type In line with previous runs A sudden jump points to an RTL or constraint change
Flop count Matches the expected register count Missing flops usually mean removed logic
Cell usage No dont_use cells, sensible drive strengths and Vt mix Weak or leaky cells hurt timing and power
Power estimate Within budget with realistic activity (power analysis) Synthesis is where clock gating and Vt mix are set
Equivalence (LEC) RTL vs netlist passes Proves synthesis did not change the function

For reading the timing part of these reports line by line, see timing report in STA and static timing analysis.

Debugging a bad synthesis result

Flowchart for debugging a bad synthesis result: check for unresolved modules and removed logic, then latches, loops and multi-driven nets, then unconstrained paths, then high slew, capacitance or fanout nets, then deep logic on the worst paths, then excess area, and finish with equivalence and STA before handing off to floorplan
Debug flowchart for a bad synthesis result.

Common problems and fixes:

Symptom Likely cause Fix
Huge negative slack on a few paths with huge slew High-fanout nets with no load model or max_fanout Set driver, load and DRV limits; duplicate or register the signal
Many failing paths with 30+ stages Deep combinational logic Restructure or pipeline the RTL, retime, or use faster cells
Timing met in synthesis, fails after placement No wire estimate, congestion-driven detours Add margin, use physical-aware synthesis, check the floorplan
LEC fails Unsupported constructs, X handling, retiming without setup Fix the RTL or set up the equivalence tool for the transforms used

Interview questions and answers

1. What are the main steps of logic synthesis?
Elaboration (parse and build hierarchy), generic optimisation on a technology-independent netlist, technology mapping to library cells, and incremental optimisation (sizing, buffering, DRV fixing). Then reports and equivalence checking.

2. What is GTECH?
Synopsys’s technology-independent generic cell library. Design Compiler represents the elaborated design in GTECH before mapping. Yosys uses its own internal gate cells ($_AND_, $_MUX_ and so on) for the same purpose.

3. Why can timing that is met in synthesis fail after placement?
Pre-layout timing has no real wires. In the aes run above, +32.64 ps at synthesis became -53.32 ps once placement RC was added. Wire-load models (statistical net capacitance from fanout) and physical-aware synthesis reduce the gap. Margin covers the rest.

4. How does a latch get inferred and why is it bad?
When a combinational block does not assign an output on every path, the tool must hold the old value. Unintended latches create time-borrowing paths and testability problems and usually point to an RTL bug.

5. What are design rule constraints, and why do they win over timing?
Max transition, max capacitance and max fanout. They protect the library’s characterised range and the electrical health of the design. Delay tables are not valid outside that range, so tools fix DRVs first.

6. What does synthesis hand to physical design?
The gate-level netlist, the SDC that goes with it (sometimes updated, for example with generated clocks for clock gating), the UPF for low-power designs, the scan definition if scan was inserted, and the QoR reports.

7. Why check equivalence after synthesis?
Optimisations like constant propagation, retiming and sharing change the structure. Formal equivalence checking proves the netlist still implements the RTL without relying on simulation coverage.

FAQ

Is logic synthesis part of physical design?
It is usually owned by the front-end or a synthesis team, but PD engineers often run physical-aware synthesis themselves, and netlist quality decides how hard timing closure will be.

What is the difference between logic synthesis and physical synthesis?
Logic synthesis optimises without real placement data. Physical (physical-aware) synthesis also reads the floorplan, LEF and RC data and does coarse placement while optimising, so its timing and congestion estimates match the PD tools better.

Which open-source tools can I practise with?
Yosys (with ABC), OpenSTA and OpenROAD, all wrapped by OpenROAD-flow-scripts with example designs for open PDKs such as ASAP7, Nangate45 and SKY130.

How much slack margin should synthesis have?
It depends on the design, technology and flow, so there is no universal number. Measure your own synthesis-to-placement drop on a few blocks (it was about 86 ps on a 380 ps clock for the aes run here) and set the margin from that.

Summary

  • Logic synthesis turns RTL into a gate-level netlist in four broad steps: elaborate, optimise generically, map to cells, then size and buffer.
  • It is constraint-driven. Clocks, I/O delays, DRV limits and driver/load models decide what the tool optimises. Unconstrained logic gets no attention.
  • In real runs on ASAP7, leaving out the load model gave the smallest aes netlist (1,202.63 um^2) but a -568.05 ps slack, caused by one INVx1 driving 235 loads. A driver/load model fixed it for about 30% more area.
  • RTL structure matters: selecting operands before one adder was 26% smaller than two adders and a mux in the same tool.
  • Synthesis slack does not survive placement unchanged (+32.64 ps became -53.32 ps here). Use margin or physical-aware synthesis.
  • Check every run for latches, unconstrained paths, DRVs, flop count and equivalence before handing off to floorplanning.

How these numbers were produced

Yosys 0.71 (YoWASP build) with ABC; ASAP7 RVT FF NLDM libraries and the abc_area/abc_speed scripts from OpenROAD-flow-scripts; OpenSTA 2.3.1 with the ORFS SDCs (ideal clocks, no wire parasitics); OpenROAD 2022 build for placement (global_placement -density 0.65, estimate_parasitics -placement, repair_design). On gcd (310 ps) the same three recipes gave -96.70, +28.13 and +22.72 ps.

References

  • YosysHQ, Yosys documentation: Synthesis in detail (synth, proc, techmap and ABC chapters). https://yosyshq.readthedocs.io/projects/yosys/en/latest/using_yosys/synthesis/synth.html
  • YosysHQ, The ABC toolbox (Yosys documentation). https://yosyshq.readthedocs.io/projects/yosys/en/latest/using_yosys/synthesis/abc.html
  • Berkeley Logic Synthesis and Verification Group, ABC: A System for Sequential Synthesis and Verification. https://people.eecs.berkeley.edu/~alanmi/abc/
  • The OpenROAD Project, OpenROAD-flow-scripts: synthesis scripts (synth.tcl, abc_area.script, abc_speed.script). https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/scripts
  • The OpenROAD Project, OpenSTA. https://github.com/The-OpenROAD-Project/OpenSTA
  • L. T. Clark et al., “ASAP7: A 7-nm finFET predictive process design kit,” Microelectronics Journal, vol. 53, pp. 105-115, 2016. https://doi.org/10.1016/j.mejo.2016.04.006
Admin
Admin

Leave a Reply