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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
    • Flops, Resets and Enables
    • FSM Synthesis
    • Memory and Macro Inference
    • Retiming and Pipelining
      • What Retiming Moves
      • Latency, Throughput and Register Count
      • Reset, Initial State and Equivalence
      • Pipelining a Long Path by Hand
      • A Retiming Model and the Tool Flow
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

‹Retiming and Pipelining
  1. Topics
  2. Logic Synthesis
  3. Sequential, FSM and Memory
  4. Retiming and Pipelining
  5. Pipelining a Long Path by Hand

Part 4 · Sequential, FSM and Memory · Intermediate

Pipelining a Long Path by Hand

Splitting a long combinational path into balanced stages with valid bits.

On this page

    Cutting the long path

    Pipelining inserts registers into combinational logic. Unlike retiming, it adds latency: each new register stage adds one cycle.

    The cut points should balance the stages. The slowest stage sets the period, so an uneven split wastes the faster stages.

    Valid bits and flush

    Every data register needs a matching valid bit. The valid bit shifts alongside the data and says which stages hold real results.

    After reset all valid bits are clear. The first real result exits after as many cycles as there are new stages.

    A worked split

    Take a 12 ns EXAMPLE path of blocks 5, 4 and 3 ns. Insert two registers to make three stages.

    Diagram
    EXAMPLE delays with register overhead t_cq = 0.3 ns and t_su = 0.2 ns
    before: T = 12 + 0.3 + 0.2 = 12.5 ns, EXAMPLE frequency = 1 / 12.5 ns = 80 MHz
    after: stages 5, 4, 3 ns, T = max(5, 4, 3) + 0.3 + 0.2 = 5.5 ns
    EXAMPLE frequency = 1 / 5.5 ns = 181.82 MHz
    speedup = 12.5 / 5.5 = 2.27x, added latency = 2 cycles

    Stage

    Logic (ns)

    Stage with overhead (ns)

    1

    5

    5.5

    2

    4

    4.5

    3

    3

    3.5

    The slowest logic stage is 5 ns, so the period is 5.5 ns. The split adds two cycles of latency for a 2.27x faster clock.

    Testbench

    The two-stage pipeline below computes (a + b) x (c + d) with a two-cycle valid delay. The testbench drives 64 patterns plus a 2-cycle flush and checks every valid output against the direct sum of products.

    pipe2.sv
    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
    26
    27
    28
    29
    30
    31
    32
    33
    module pipe2 (
      input  logic       clk,
      input  logic       rst_n,
      input  logic [3:0] a,
      input  logic [3:0] b,
      input  logic [3:0] c,
      input  logic [3:0] d,
      input  logic       v_in,
      output logic [9:0] y,
      output logic       v_out
    );
      logic [4:0] s1, s2;
      logic [4:0] q1, q2;
      logic       v1, v2;
      assign s1 = {1'b0, a} + {1'b0, b};
      assign s2 = {1'b0, c} + {1'b0, d};
      always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
          q1 <= '0;
          q2 <= '0;
          y <= '0;
          v1 <= 1'b0;
          v2 <= 1'b0;
        end else begin
          q1 <= s1;
          q2 <= s2;
          y <= q1 * q2;
          v1 <= v_in;
          v2 <= v1;
        end
      end
      assign v_out = v2;
    endmodule
    

    Common pitfall

    A valid bit that skips a stage marks stale data as fresh. Shift one valid bit per data stage, and clear all of them on reset.

    Interview

    Likely probes: latency cost and balance of the split.

    • Two new stages add exactly two cycles of latency here.

    • The 5 ns stage sets the 5.5 ns period; the 3 ns stage has 2 ns of slack.

    • All 64 testbench outputs match only when each valid bit is delayed by two cycles.

    Check yourself The 3 ns stage finishes long before the 5 ns stage. Can its slack rescue the period?

    No. The period follows the slowest stage, so the 5 ns stage plus overhead sets 5.5 ns regardless.

    Check yourself Reset clears the data registers but not a valid bit. What breaks?

    That stage claims valid data while holding reset values. The checker compares garbage and reports a mismatch.

    Related topics

    • Reset, initial state and equivalence

    • Pipelining

    Previous

    69 / 139

    Next: A Retiming Model and the Tool Flow

    Up next

    Up nextA Retiming Model and the Tool Flow

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • What Retiming Moves
    • Latency, Throughput and Register Count