3.5.7 · D4HDL & Digital Design Flow

Exercises — Synthesis to gate-level netlist

4,444 words20 min readBack to topic

Before we start, one reminder of what each symbol means, so no notation is unearned:

Where the two formulas come from

Both slack rules are just "deadline minus arrival," read off one timeline. The figure below is that timeline: the launching flop ticks at time , the capturing flop ticks again one period later at time .

Figure — Synthesis to gate-level netlist

Level 1 — Recognition

Recall Solution L1.1
  1. Elaboration — read and parse the HDL, check syntax, build an internal model.
  2. Translation to generic logic (GTECH) — turn behavior into a technology-independent Boolean network. GTECH ("generic technology") is the tool's built-in placeholder gate library: abstract AND/OR/MUX/flop symbols with no delay or area yet, used only to reason about the logic before real cells are chosen.
  3. Technology mapping — cover that generic (GTECH) network with real cells from the .lib.
  4. Optimization — resize, buffer, restructure to meet the constraints.

Mnemonic from the parent: "Every Genius Team Optimizes."

Recall Solution L1.2
  • (a) Netlist — an instantiated standard cell.
  • (b) RTL — a behavioral always block (this is what synthesis replaces).
  • (c) RTL — an assign with Boolean operators, not a cell instance.
  • (d) Netlist — an instantiated flip-flop cell.

The precise rule (not the oversimplified one): a gate-level netlist's combinational and sequential logic is expressed only as cell instances CELLNAME uN (...) — never as +, ?:, if, or always @(posedge) behavior. It absolutely still contains the ordinary structural scaffolding of any Verilog module: a module/endmodule header, input/output/inout port declarations, wire declarations for the internal nets that connect cells, and sometimes assign statements only for trivial pass-throughs (a net tied straight to a port or to a constant) or benign parameters/attributes the vendor emits. So "no +, no ?:, no always" is a rule about where the logic lives (in cells), not a claim that the file is nothing but instance lines.

Recall Solution L1.3

Level 2 — Application

Recall Solution L2.1

Sum everything the data experiences, subtract from the budget : Positive slack → timing met, no fix needed. (This path sits in the green top-left quadrant of the figure.)

Recall Solution L2.2

Set slack to exactly zero and solve for : Any logic at or below 1.9 ns passes; above it, violation.

Recall Solution L2.3

Use the hold formula (no inside it, so the missing is fine): Positive → hold met. The new data (arriving at ns) comes after the hold window closes ( ns), so no race. The absence of is not a problem — hold never uses it.

Recall Solution L2.4

A conditional select of two inputs is a 2:1 multiplexer:

MUX2X1 u1 (.A(q), .B(p), .S(sel), .Y(y));

The ?: disappears; the structural instance is the netlist form. (Which input is A vs B depends on the cell's polarity, but the cell is a MUX2X1.)


Level 3 — Analysis

Recall Solution L3.1

(a) (b) To reach zero slack we must recover the whole ns from the logic. The new logic delay must be: So the tool needs a logic structure at 1.55 ns or faster (e.g. carry-lookahead instead of ripple). This path was in the orange (setup-fail) quadrant; the fix moves it back to green.

Recall Solution L3.2
  • (a) Helps — bigger gates switch faster (); cost: more area, more power, and larger load on the previous stage.
  • (b) Helps — carry-lookahead shortens the critical path; cost: more area/power (more gates).
  • (c) Helps — lowering frequency raises , so the budget grows; cost: the chip runs slower overall (may violate the spec).
  • (d) Hurts — more logic levels increase ; this makes the violation worse.
Recall Solution L3.3

(a) (b) No. does not appear in the hold formula, so doubling it changes hold slack by exactly zero. This is the bottom-left (blue) quadrant trap. (c) The real fix is to slow the shortest path: insert delay buffers so rises. We need hold slack , i.e. raise by at least ns (from to ns). Then ns, just met.

Recall Solution L3.4

The capturing flop needs the data steady before its tick at , and we reserve a further for clock jitter/skew, so the effective deadline is pulled earlier to ; the leftover gap between the end of the orange segment and that deadline is the green slack segment. See Static Timing Analysis (STA) for how tools report exactly this gap.


Level 4 — Synthesis (build a fix)

Recall Solution L4.1

(a) (b) Ripple still fails (it's the current value). Choose carry-lookahead (): (c) Slack is ns — timing met. Cost: adder area (the timing↔area trade-off).

Recall Solution L4.2

The launching flip-flop drives net a from its Q; the AND cell produces net w; the capturing flip-flop stores w. A real netlist also declares those internal nets as wires:

wire a, b, w;                            // internal nets are declared
DFFX1  u0 (.D(a_in), .CK(clk), .Q(a));   // launching FF: source of net a
AND2X1 u1 (.A(a),    .B(b),    .Y(w));   // combinational logic
DFFX1  u2 (.D(w),    .CK(clk), .Q(q));   // capturing FF: stores the result

The timing path runs, all inside one : u0.CK tick → u0.Q=a () → AND2X1 u1 () → u2.D=w must be steady before u2's next tick. Naming the nets (a, w) makes the launch point (u0.Q) and capture point (u2.D) explicit — that is exactly the span the setup and hold constraints measure. See RTL Design and the Synthesizable Subset.

Recall Solution L4.3

(a) Setup: Hold: Only hold fails — this is the bottom-left (blue) quadrant. (b) After the buffer, : hold Setup is unchanged ( ns) because we only touched the short path, not the critical long path. (c) Setup is limited by the longest path; adding delay there would eat setup slack and could cause a new setup violation. The shortest path is what hold cares about, and it has plenty of setup room to spare — so buffering it fixes hold "for free" on setup.

Recall Solution L4.4

At , the sum of the four terms is ns. The minimum period is when slack , i.e. equals that sum: So you can push the clock up until ns before the setup path breaks. (Hold is unaffected — it does not depend on .)


Level 5 — Mastery

Recall Solution L5.1

(a) (b) With CLA logic : (c) Now : Still positive — the design meets timing, but the margin shrank from ns to ns because the CLA's larger input capacitance loaded the driving flop and stretched its from to ns. That ns of extra clock-to-Q delay ate more than half the freshly-won slack — a concrete instance of the L3 lesson that a local speed-up can charge you back elsewhere on the path. The path still closes, but the shrunken margin warns the optimizer it may need to also upsize the driving flop or split the load if any further change nibbles at that ns. (d) The logic swap happens in Stage 4 — Optimization (after tech mapping). Deciding where the cells physically sit is Place and Route, a separate physical-design step — see Place and Route (Physical Design).

Recall Solution L5.2

Require slack : The SDC must set (so MHz). Choosing exactly ns gives slack ns.

Recall Solution L5.3

(a) (b) Negative → hold violation. The new data reaches u2.D too soon, corrupting the value u2 was still holding from the previous edge. (Bottom-left blue quadrant.) (c) No. Hold slack has no in it — a slower clock does not help; a hold violation is stubborn. (d) The tool slows the shortest path by inserting delay buffers (or larger-delay cells) to raise . It must add at least ns (bringing from to ns), after which hold slack ns, just met. See Setup and Hold Time in Flip-Flops.

Recall Solution L5.4

(a) Setup: Hold: (b) Both fail → the bottom-right (red) quadrant. (c) Two independent fixes: (setup) speed up the long path (faster logic / bigger ) to recover ns; (hold) slow the short path with ns of buffer delay. Neither fix helps the other — they touch different paths and different formulas.

Recall Solution L5.5
  • initial y = 0; — an initial block used to set logic has no hardware meaning (there is no "time zero" for a gate); synthesis ignores or rejects it.
  • #5 — a delay describes simulation timing, not a physical gate; it is non-synthesizable.

Both simulate fine but are outside the synthesizable subset. Fix: drop #delays and use registers/reset for initialization. This is the parent's mistake "if it simulates, it synthesizes" — it does not. See RTL Design and the Synthesizable Subset.


Recall One-line self-test

Setup constraint ::: , equivalently setup slack . Where does the setup deadline come from ::: the data must be steady before the next tick at , minus a further for jitter/skew. Hold constraint ::: , equivalently hold slack . Why is there no in the hold formula ::: hold compares two events relative to the same clock edge, so the next period never enters. Which term does synthesis control for setup ::: — by choosing/sizing/restructuring the gates to make it smaller. How does the tool fix a hold violation ::: It adds delay (buffers) on the shortest path to raise ; a slower clock does not help hold. Which step places cells physically ::: Place and Route, not synthesis.