Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
    • Synthesis Flow Overview
      • What Synthesis Does
      • The Five Flow Stages
      • Why Constraints Change the Netlist
      • A Small Design Through Yosys
      • Concepts, Not Commands
    • Synthesizable RTL and Inference
    • Reading Netlists and Reports
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

←Synthesis Flow Overview
  1. Topics
  2. Logic Synthesis
  3. Synthesis Foundations
  4. Synthesis Flow Overview
  5. What Synthesis Does
On this page

    Part 1 of 9, lesson 1 of 14Part 1 of 9/Synthesis Foundations/Lesson 1 of 14Intermediate

    What Synthesis Does

    Inputs and outputs of synthesis, where it sits in the flow, and area in library units.

    Two netlists from one RTL look like a contradiction until you see that they answer different questions: structure versus cost. Teams that cannot read both misprice every handoff.

    After this lesson you can: run one design to generic gates and to library cells, read the two recordings side by side, and explain why the count barely moves while the family changes.

    The question

    You hand a tool three things: RTL that says what the design does, constraints that say how fast and under what electrical conditions it must do it, and a cell library that says what it may build with. The tool hands back two things: a gate-level netlist built only from that library, and reports counting and pricing what it chose. Every surprise in synthesis is a surprise about how the three inputs steer the two outputs.

    The design below is a 4-bit saturating adder: it adds two 4-bit numbers, raises a saturation flag on overflow, and clamps the sum at the maximum instead of wrapping. The script synthesises it once to generic gates, records that netlist, then maps it against the teaching library course.lib with a loose 1000 ps delay target and records the result. The assertions are the contract: no word-level arithmetic survives, generic gates are present before mapping, and none remains after while at least one library cell does.

    One design, two netlists

    yosys
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    read_verilog <<EOV
    module satadd(input [3:0] a, b, output [3:0] y, output sat);
    wire [4:0] s = a + b;
    assign sat = s[4];
    assign y = s[4] ? 4'hF : s[3:0];
    endmodule
    EOV
    hierarchy -check -top satadd
    synth -top satadd -flatten
    tee -o stat_generic.txt stat
    write_json net_generic.json
    design -save generic
    tee -o abc_mapped.txt abc -liberty course.lib -constr typical.constr -D 1000
    tee -o stat_mapped.txt stat -liberty course.lib
    write_json net_mapped.json
    design -save mapped
    design -load generic
    select -assert-none t:$add t:$sub t:$mul %u
    select -assert-min 1 t:$_AND_ t:$_OR_ t:$_XOR_ t:$_NOT_ t:$_MUX_ t:$fa %u
    design -load mapped
    select -assert-none t:$and t:$or t:$xor t:$mux t:$not t:$add t:$sub %u
    select -assert-none t:$_AND_ t:$_OR_ t:$_NOT_ t:$_MUX_ t:$_XOR_ t:$_NAND_ t:$_NOR_ %u
    select -assert-min 1 t:INV t:BUF t:NAND2 t:NOR2 t:AND2 t:OR2 t:NAND3 t:NOR3 t:XOR2 t:XNOR2 t:AOI21 t:OAI21 t:MUX2 %u
    check
    log PASS: saturating adder synthesises to generic gates then maps to course.lib cells

    The delay target deserves one sentence. ABC takes -D 1000, a deliberately slack request for 1000 ps: this lesson is about what synthesis does, not about meeting a hard clock. In this ABC script the library offers one size per cell, so the recorded run has no upsizing to do; the target only decides whether this one covering meets the request, and the area line prices the covering this library allows. The constraints lesson's closing run shows it: against the same kind of single-size library, a tight target lands back on the loose covering.

    Predict first The generic netlist holds fine-grained gates, and the mapper must cover every one of them with library cells. Will the mapped netlist hold more cells, fewer cells, or about the same number as the generic one?

    About the same order here, one cell fewer. ABC re-strashes the generic netlist into an AIG and re-covers it, so mapping is never one generic gate to one library cell: some gates merge into wider cells such as AOI21 and OAI21, which is why the count falls from 21 generic gates to 20 library cells. The family changes completely, from unpriced generic gates to priced library cells.

    What the two runs printed

    Read the generic census first. Every entry is a bit-level gate: the adder and the saturation mux are gone as word-level cells, lowered before any library is involved. The next lesson watches that lowering stage by stage.

    Generic cell type

    Cells

    $_NAND_

    11

    $_OR_

    1

    $_AND_

    2

    $_NOT_

    1

    $_ORNOT_

    1

    $_XNOR_

    3

    $_XOR_

    2

    The generic census above is the gate total, and it knows nothing of area: without a library there is nothing to price with. Mapping changes that. ABC covers the same logic with cells from course.lib, and the stat report prices each family in library units of that library, a fictional teaching measure comparable only within this course.

    Library cell

    Cells

    AND2

    3

    AOI21

    2

    INV

    2

    NAND2

    3

    NOR2

    3

    OAI21

    2

    OR2

    1

    XNOR2

    3

    XOR2

    1

    The stat report splits the mapped cells across 9 cell types. ABC reports the gate total at the area the comparison table below records, reaching 635 ps against the 1000 ps target. Area exists only here, on the mapped side: no generic count can price them, because price lives in the library.

    Generic netlist after synthesis: 21 bit-level gates from the eight input bits to the sum and saturation outputs.
    The same adder mapped to course.lib: 20 library cells, priced in library units (the recorded area sits in the comparison table below).

    Same function, same ports, different population: generic gates above, priced library cells below. That replacement, plus the reports that price it, is the whole job of synthesis.

    The contract

    Synthesis promises to preserve function while choosing cost. The netlist must still add, saturate, and clamp exactly as the RTL says; equivalence checking later proves that promise mechanically. Change any of the three inputs and the tool is entitled to a different answer.

    RTL and constraints enter from above; the netlist and its reports leave toward placement. Placement cannot fix a missed target or supply a missing cell, so read the mapped report before handing off.

    Break it: swap the operator

    Change one operator and watch the cell mix change. The second script is identical except that the addition is now a bitwise exclusive-or, so the sum bits are parity instead of a sum. The assertions keep the same shape; only the recordings move.

    yosys
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    read_verilog <<EOV
    module satxor(input [3:0] a, b, output [3:0] y, output sat);
    wire [4:0] s = a ^ b;
    assign sat = s[4];
    assign y = s[4] ? 4'hF : s[3:0];
    endmodule
    EOV
    hierarchy -check -top satxor
    synth -top satxor -flatten
    tee -o stat_generic_xor.txt stat
    write_json net_generic_xor.json
    design -save generic_xor
    tee -o abc_xor.txt abc -liberty course.lib -constr typical.constr -D 1000
    tee -o stat_xor.txt stat -liberty course.lib
    write_json net_xor.json
    design -save mapped_xor
    design -load generic_xor
    select -assert-none t:$add t:$sub t:$mul %u
    select -assert-min 1 t:$_AND_ t:$_OR_ t:$_XOR_ t:$_NOT_ t:$_MUX_ t:$fa %u
    design -load mapped_xor
    select -assert-none t:$and t:$or t:$xor t:$mux t:$not t:$add t:$sub %u
    select -assert-none t:$_AND_ t:$_OR_ t:$_NOT_ t:$_MUX_ t:$_XOR_ t:$_NAND_ t:$_NOR_ %u
    select -assert-min 1 t:INV t:BUF t:NAND2 t:NOR2 t:AND2 t:OR2 t:NAND3 t:NOR3 t:XOR2 t:XNOR2 t:AOI21 t:OAI21 t:MUX2 %u
    check
    log PASS: xor variant of the saturating adder maps to course.lib cells with a new mix

    The parity variant synthesises to 4 generic gates and maps to 4 library cells at the area the table records. That sensitivity is the point: the mapper has no loyalty to yesterday's netlist, only to today's RTL.

    Build

    Generic gates

    Mapped cells

    Area (library units)

    Adder (`+`)

    21

    20

    58

    Parity (`^`)

    4

    4

    20

    Compare with the adder row in the table: one operator changed, the function changed. Why so few gates here? Here the sum is only four bits wide, so s[4] is always 0: the saturation flag is constant and the clamp mux has a constant select, and synthesis drops both before mapping. What remains is one XOR gate per sum bit, and the mapper covers each with one XOR2 library cell.

    Common mistakes

    Quote area with its library. Every area on this page is in library units of course.lib, a fictional teaching library: a bare number like 20 means nothing until the library is attached.

    Why does one RTL give two netlists here, and what would you quote about each?

    Weak answer: synthesis optimises the design, so the netlist gets smaller and better. I would quote the total cell count going down.

    Strong answer: the two netlists answer different questions. The generic netlist shows structure with the census gate total and no area; the mapped netlist shows cost with the mapped cells at the area the comparison table records for course.lib, reaching 635 ps. The count moved only by one because ABC re-covers the logic instead of copying gates singly, merging a few into wider cells; only the library has prices.

    Follow-up: the target tightens to half the reached delay. What do you predict, and which report settles it? In this ABC script the library offers one size per cell, so expect the same covering in this recorded run; a differently shaped RTL could still restructure. The ABC delay and area lines settle what this run did.

    Check yourself The generic netlist and the mapped netlist implement the same adder. Name one thing that changed between them and one thing that did not.

    The cell family changed: the generic gates of the census became library cells in the comparison table. The function did not: same ports, same saturate-and-clamp behaviour, which is why the assertions pin absence of generics rather than exact cells.

    Check yourself The mapped report quotes an area for the mapped netlist. In what units, and why can the generic netlist not quote an area?

    In library units of course.lib. The generic netlist has no library attached, so its cells have no prices; only the mapped report can total an area.

    • One RTL gives a generic netlist (structure) and a mapped netlist (cost).

    • Mapping re-covers gates into library cells; the family changes more than the count.

    • Area lives in the library: no library, no area, only counts.

    Rule of thumb: quote generic gates for structure and mapped cells with their library for cost.

    How this was checked

    Every number and picture on this page comes from two Yosys 0.69 runs of the shown scripts, recorded by the course checker (scripts/tools/run-rtl-testbenches.mjs with COURSE=synth): a 4-bit saturating adder synthesised to generic gates, then mapped against the teaching library course.lib with a loose 1000 ps target, plus a parity-operator variant. The libraries are fictional, so absolute areas are teaching units.

    • Interview: run a mock interview on this topic

    Related topics

    • The five flow stages

    • Synthesizable RTL and Inference

    • Reading Netlists and Reports

    Previous

    3 / 139

    Next: The Five Flow Stages

    Up next

    Up nextThe Five Flow Stages

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Why Constraints Change the Netlist
    • A Small Design Through Yosys
    • Concepts, Not Commands