Module 2: Logic Synthesis · 2.1 From RTL to Gates

Generic Cells Versus Standard Cells

The initial article stated that synthesis optimizes circuit topology before selecting library gates. This article examines the intermediate cell representations used inside Yosys.

Inspecting a raw netlist immediately after running synth reveals gates such as $_AND_, $_MUX_, and $_DFF_P_. Semiconductor foundries cannot manufacture these cells. They represent internal generic primitives used during logic synthesis.

Technology-Independent Primitives Versus Physical Standard Cells

Yosys evaluates two distinct categories of cells:

  • Generic Primitives: Technology-independent internal representations, such as $_AND_, $_OR_, $_NOT_, $_MUX_, and $_DFF_P_. These models possess no physical area, propagation delay, or pin capacitance. They define Boolean and sequential register behavior.
  • Physical Standard Cells: Concrete silicon components defined in a target Process Design Kit (PDK). Each cell has physical boundaries in a LEF file and electrical timing models in a Liberty (.lib) file. For example, sky130_fd_sc_hd__nand2_1 is a physical standard cell.

Yosys optimization passes (opt, techmap, flatten) operate on generic primitives. The downstream abc tool then maps these generic gates to target standard cells defined in the Liberty file.

Reasons for Two-Stage Synthesis

Separating technology-independent optimization from technology mapping provides two main engineering advantages:

  1. Portability Across Target Technologies: Generic optimization algorithms apply equally to ASICs and FPGAs. Constant folding, logic reduction, and state machine extraction operate without knowledge of the target semiconductor process.
  2. Simplified Graph Optimization: Evaluating logic transformations on generic primitives requires minimal computation. Factoring and restructuring Boolean trees is fast when gates have uniform weights. ABC performs complex cost optimization once during technology mapping.

Comparing Generic and Mapped Netlists

Consider an AND-OR-INVERT function: y = NOT((a AND b) OR c).

Before technology mapping, Yosys produces an unmapped netlist using generic primitives:

module \aoi_example(a, b, c, y);
  wire _00_;
  wire _01_;
  $_AND_ _g1_ (
    .A(a), .B(b), .Y(_00_)
  );
  $_OR_ _g2_ (
    .A(_00_), .B(c), .Y(_01_)
  );
  $_NOT_ _g3_ (
    .A(_01_), .Y(y)
  );
endmodule

The cell names $_AND_, $_OR_, and $_NOT_ carry no layout or timing information.

Next, ABC processes this network using sky130_fd_sc_hd.lib. ABC can map the logic to discrete gates:

module \aoi_example(a, b, c, y);
  sky130_fd_sc_hd__and2_1 _g1_ (
    .A(a), .B(b), .X(_00_)
  );
  sky130_fd_sc_hd__or2_1 _g2_ (
    .A(_00_), .B(c), .X(_01_)
  );
  sky130_fd_sc_hd__inv_1 _g3_ (
    .A(_01_), .Y(y)
  );
endmodule

Alternatively, ABC can map all three gates into a single compound standard cell:

module \aoi_example(a, b, c, y);
  sky130_fd_sc_hd__a21oi_1 _g1_ (
    .A1(a), .A2(b), .B1(c), .Y(y)
  );
endmodule

The cell sky130_fd_sc_hd__a21oi_1 implements the two-input AND-OR-INVERT function in a single compact layout. This compound cell reduces area and reduces interconnect delay.

A final netlist must contain zero $-prefixed cell names. If generic primitives remain after ABC execution, technology mapping failed to map those instances.

Practice Exercise

An engineer inspects a post-synthesis netlist. The file contains sky130_fd_sc_hd__nand2_1, sky130_fd_sc_hd__inv_1, and a single unmapped $_DFF_P_ instance. What does this indicate?

Solution

The presence of $_DFF_P_ indicates that sequential technology mapping failed for that flip-flop.

Downstream floorplanning and placement tools cannot process generic primitives. Inspect the synthesis log to verify that the dfflibmap pass executed successfully without syntax or constraint errors.

Section 2.2 examines Yosys execution scripts and configuration options inside OpenLane.

← RTL Style and Its Physical Consequences The Synthesis Script OpenLane Runs →