The idea: a circuit becomes a stack of masks

A schematic says which transistors there are and how they connect. A chip factory needs something else: for every layer (well, active, poly, metal …) the exact shapes to print. That set of shapes is the layout. Each layer becomes one mask, a glass plate with a dark pattern, and each mask is used in one step of the process. This page builds one CMOS inverter, the circuit from The Transistor as a Switch, all the way from masks to a checked layout.

Left: the inverter schematic with a pMOS from VDD to Y and an nMOS from Y to GND, both gates on A. Right: seven mask layers drawn as stacked sheets, n-well, active, poly, n+ select, p+ select, contact and metal1, each with its shapes, and an arrow to the finished layout.
One inverter, seven masks: the layout is all of them seen from above at once.

The canvas has three parts. The cross-section (top right) is a side view of the wafer. The layout (left) is the top view on a λ grid. The DRC and LVS panels (bottom right) are the two checks every layout must pass. The layout menu swaps in a layout with a planted mistake.

Building it: one mask per step

Each step coats the wafer with a light-sensitive resist, shines light through the mask, washes away the exposed (or the hidden) resist, and then works only where the wafer is open: implant, grow, deposit or etch. The inverter needs seven masks (Demo: fabrication, one mask per step):

MaskWhat the step makes
1 n-wellan n-type region in the p substrate where the pMOS will sit
2 activewhere transistors may be; thick field oxide grows everywhere else and isolates them
3 polythin gate oxide, then the polysilicon gates
4 n+ selectn+ source and drain of the nMOS, implanted next to the gate
5 p+ selectp+ source and drain of the pMOS, inside the n-well
6 contactholes through the oxide down to diffusion or poly, filled with metal
7 metal1the wires: GND, VDD, and Y joining both drains

The poly gate comes before the implants on purpose. The gate blocks the implant, so the source and drain end exactly at the gate edges. This is called a self-aligned gate, and it is why the channel length is simply the poly width.

Stick diagram, then layout

A stick diagram fixes the topology before any size: VDD rail on top, GND at the bottom, a p diffusion and an n diffusion as horizontal lines, one vertical poly line crossing both (that crossing is the transistor), contacts as dots, and metal straps from the sources to the rails and between the drains. The layout then gives every line a width and every gap a size on the grid (Demo: stick diagram to layout).

A transistor appears wherever poly crosses active. Its W is the width of the active under the gate and its L is the width of the poly. Here the nMOS is W = 6λ, L = 2λ and the pMOS W = 12λ, L = 2λ: twice as wide, because holes move about half as fast as electrons. How wide to make them for speed is the subject of Gate Delay and Logical Effort. The whole cell is 22λ wide and 48λ tall.

λ-based design rules

A foundry cannot print any shape. Lines that are too thin break, gaps that are too small close up, a contact that slips off its metal connects nothing. Design rules state the limits as minimum widths, spacings and overlaps. λ rules write all of them as multiples of one length λ, about half the smallest gate length. Then the same layout fits any process that uses the rule set: only λ changes. With λ = 0.6 µm, for example, this cell would be 13.2 µm × 28.8 µm.

The page uses ten rules of the MOSIS SCMOS set (revision 7.2, SCMOS column):

RuleWhat it limitsMinimum
2.1active width3λ
2.3source/drain active to the n-well edge5λ
3.1poly width2λ
3.2poly to poly spacing2λ
3.3gate extension past the active2λ
6.1contact sizeexactly 2λ × 2λ
6.4active contact to the gate2λ
7.1metal1 width3λ
7.2metal1 spacing3λ
7.3metal1 overlap of a contact1λ

DRC: design rule check

DRC measures every shape against every rule and marks each place that breaks one. Three kinds of measurement cover almost all rules: the width of one shape, the spacing between two shapes that are not connected, and the enclosure of one shape by another (metal around a contact, well around active).

Three small drawings. Width: a metal1 wire 2λ wide where 3λ is needed, marked with a cross. Spacing: a poly wire 1λ from the gate where 2λ is needed, marked with a cross. Enclosure: a contact with metal1 around it by 1λ on each side, marked with a tick, next to one with 0λ, marked with a cross.
Width, spacing and enclosure: the three measurements behind most design rules.
  • The correct inverter passes all ten rules: the tightest values are 6λ of active, 5λ of well around the pMOS, 2λ of poly, 4λ of metal1 width and spacing, 1λ of metal around each contact (Demo: DRC on the correct inverter, 0 errors).
  • A poly wire of another net placed 1λ from the gate breaks rule 3.2 (1λ < 2λ): 1 error (Demo: DRC catches poly 1λ apart). When etched, the two lines could merge into one.
  • An output wire only 2λ wide breaks rule 7.1 once (2λ < 3λ) and rule 7.3 at both drain contacts (0λ < 1λ): 3 errors from one edit (Demo: DRC, a thin output wire, 3 errors).

In each of these the circuit is still an inverter. DRC asks "can this be built?", never "is this the right circuit?".

Extraction and LVS

Extraction reads the circuit back out of the shapes. A device is every place where poly crosses active: an nMOS outside the n-well, a pMOS inside it. A net is a set of shapes that touch on the same layer, or meet through a contact; text labels on metal1 (VDD, GND, A, Y) give the nets their names. For the inverter this gives M1 nmos W = 6λ L = 2λ, M2 pmos W = 12λ L = 2λ and four nets: A on both gates, Y on both drains, GND and VDD on the sources.

LVS (layout versus schematic) compares that netlist with the schematic: the same devices with the same sizes, and the same pins on every net. Here it reports 2 devices and 4 nets on both sides, the circuits match (Demo: extract and LVS, circuits match).

Left: the pMOS drain with its contact, so metal1 Y connects the pMOS drain and the nMOS drain; DRC 0 errors, LVS match. Right: the same layout without that contact; DRC still 0 errors, but extraction finds the pMOS drain on a separate net n1, so Y has one pin instead of two and LVS reports an open.
A missing contact breaks no design rule, but LVS finds the open.

Now leave out the contact on the pMOS drain. Every shape is still legal, so DRC finds 0 errors. But the metal over the drain only lies on oxide; it is not connected. Extraction finds a fifth net n1 holding only the pMOS drain, and Y holds only the nMOS drain: 1 pin where the schematic has 2. LVS reports an open on Y (Demo: missing contact, DRC clean but LVS open). On silicon, Y could be pulled down but never up. The reverse mistake, two nets touching, is a short, and LVS finds that too.

In a real flow

Real tools do the same three jobs on millions of shapes. Magic and KLayout draw layout and run DRC with the foundry's rule deck, Magic extracts a netlist, and Netgen compares it with the schematic and prints Circuits match uniquely. The ASIC Design Flow runs them on a whole SKY130 design at signoff. Modern rule decks are written in nanometres, not λ, and hold hundreds of rules, but width, spacing and enclosure are still most of them. Cells like this inverter are placed in rows and wired together by Standard-Cell Place and Route. The circuit view of the same gates is in The Transistor as a Switch, and a latch built from such transistors is in A Latch and a Flip-Flop Built from Transistors.

See also Standard-Cell Place and Route, which places whole cells in rows that share power rails and routes metal1 and metal2 wires between them.

What the page leaves out

  • Well and substrate taps. A real cell ties the n-well to VDD and the substrate to GND with contacts (rule 2.4); the page leaves them out and LVS compares only gate, source and drain.
  • Most of the rule deck. Only ten SCMOS rules are checked; select, poly-contact, via and upper-metal rules, and the SUBM and DEEP columns, are not.
  • Process detail. Resist, etching, LDD spacers, silicide and planarization are not drawn; the cross-section shows the inverter side by side, not a cut through the top view.
  • Polygons and Manhattan geometry. Shapes are rectangles on a whole-λ grid; real DRC works on polygons with corner and density rules.
  • Parasitics. Real extraction also gives the resistance and capacitance of every wire, used for timing.

On the mind map

Open the Computer Architecture mind mapComputerArchitectureAbstraction and numbers: layers and bit patternsAbstraction and numbersCombinational logic: output depends only on inputsCombinational logicSequential logic: state held by a clockSequential logicMIPS software: how C becomes machine wordsMIPS softwareThe processor: datapath plus controlThe processorPipelines and parallelism: more instructions at oncePipelines and parallelismMemory and I/O: small fast near, big slow farMemory and I/OLatches and flip-flopsLatches and flip-flopslatch is level, flip-flop is edgeFlip-flops and counter designFlip-flops and counter designexcitation = characteristic backwardsLatch from transistorsLatch from transistorstransmission gates plus inverter loopCMOS layout, DRC, LVSDRC: can it be built? LVS: right circuit?Timing analysisTiming analysissetup limits clock, hold limits short pathsAsync FIFO (CDC)Async FIFO (CDC)Gray pointers cross; flags clear lateStuck-at fault testingStuck-at fault testingActivate, propagate, justify: D-algorithmStatic Timing AnalysisStatic Timing AnalysisSlack = required − arrival, every nodeLogical effort sizingLogical effort sizingd = gh + p; equal effort F^(1/N)Scan chainsScan chainsShift in, capture once, shift outFinite state machinesFinite state machinesMoore: output from state; Mealy: +inputsASMD chart and datapathASMD chart and datapathTransfers land at the edge leaving the state1011 Sequence Detector1011 Sequence DetectorA wrong bit keeps the longest prefixFSM in SystemVerilogFSM in SystemVerilogenum, always_ff, always_comb; default!Shift registers and countersShift registers and countersChained flip-flops shift or count each clockOpen the Computer Architecture mind mapComputer Architecturestate held by a clockSequential logicLatches and flip-flopsLatches and flip-flopslatch is level, flip-flop is edgeFlip-flops and counter designFlip-flops and counter designexcitation = characteristic backwardsLatch from transistorsLatch from transistorstransmission gates plus inverter loopCMOS layout, DRC, LVSDRC: can it be built? LVS: right circuit?Timing analysisTiming analysissetup limits clock, hold limits short pathsAsync FIFO (CDC)Async FIFO (CDC)Gray pointers cross; flags clear lateStuck-at fault testingStuck-at fault testingActivate, propagate, justify: D-algorithmStatic Timing AnalysisStatic Timing AnalysisSlack = required − arrival, every nodeLogical effort sizingLogical effort sizingd = gh + p; equal effort F^(1/N)Scan chainsScan chainsShift in, capture once, shift outFinite state machinesFinite state machinesMoore: output from state; Mealy: +inputsASMD chart and datapathASMD chart and datapathTransfers land at the edge leaving the state1011 Sequence Detector1011 Sequence DetectorA wrong bit keeps the longest prefixFSM in SystemVerilogFSM in SystemVerilogenum, always_ff, always_comb; default!Shift registers and countersShift registers and countersChained flip-flops shift or count each clock
This page on the Computer Architecture mind map · 76 pages in 7 branches · open it to see the whole map and test yourself in recall mode.