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

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
    • Low-Power RTL Hub
    • DFT and Scan Hub
    • Physical Awareness Hub
    • Waveform Debug Hub
    • STA and ECO Hub
    • RTL-to-Implementation Closure
    • DFT-Ready RTL
    • Capstone: Resilient Streaming Peripheral
    • Principal Design Review
    • Senior RTL Interview Questions & Model Answers
      • Interview: Combinational and Arithmetic
      • Interview: Sequential and Pipelines
        • Blocking vs non-blocking: the race demo
        • Pipeline latency vs throughput
        • Stalling without deadlock
        • Enables, resets and counters
      • Interview: FSM and Control
      • Interview: Timing and STA
      • Interview: CDC and Reset
      • Interview: Memories and Buses
      • Interview: Low-Power Design
      • Interview: Debug and ECO
      • Interview: Coding and Whiteboard
  • Glossary and Notation
Loading lesson

‹Interview: Sequential and Pipelines
  1. Topics
  2. RTL Design
  3. Senior & Interview
  4. Senior RTL Interview Questions & Model Answers
  5. Interview: Sequential and Pipelines
  6. Pipeline latency vs throughput

Part 9 · Senior · Senior

Pipeline latency vs throughput

Latency grows a cycle per stage while throughput stays one per cycle, measured by the testbench.

On this page

    Why this matters

    A four-cycle pipeline delivers one result per cycle, so its latency is four and its throughput is one. Calling it four times faster, or defining throughput as one over latency, is the classic junior answer.

    After this lesson you can: state latency in cycles per item and throughput in items per cycle, and say what an extra stage changes.

    The question

    The interviewer asks what changes when a pipeline gains a stage. The expected answer names two numbers moving in opposite directions and says what each costs.

    What is really under test is whether the candidate separates per-item delay from aggregate rate. Confusing the two is the classic junior error this question hunts.

    Model answer

    Adding a stage adds one cycle of latency and, once the pipe is full, changes nothing about throughput. The clock rate can rise if the cut stage was critical; the first result arrives one cycle later.

    Change

    Latency

    Throughput

    Cost

    One more balanced stage

    +1 cycle per item

    Still 1 result per cycle when full

    One rank of registers and their clock load.

    Splitting the slowest stage with an added register rank

    +1 cycle per item

    Can rise if the achievable clock rate rises

    The registers that split the logic; sideband alignment.

    A gap in the input (bubble)

    Unchanged per item

    Dips for the gap cycles

    Nothing structural; valid tracking absorbs it.

    The testbench below uses four register ranks and twenty consecutive items. Input 1 is accepted at edge 1; it is visible after NBA at edge 4 (three elapsed periods), and a downstream register consumes it at edge 5 (four elapsed periods). Then one result is consumed per cycle.

    Edge

    Input 1 location after NBA

    Downstream consumption before NBA

    1

    Rank 0: acceptance

    None

    2

    Rank 1

    None

    3

    Rank 2

    None

    4

    Rank 3: output visible

    None

    5

    Next item at output

    Input 1 consumed

    Each slot shows all four rank outputs just after a clock edge, with a new item entering every cycle. Slots are numbered from 0, so slot 0 is the picture after edge 1, the same edge numbering as the table above.

    • Slot 3 (after edge 4): item 1 is visible at the output rank, three periods after it entered. A downstream register reading the pre-edge output consumes it at edge 5, four periods after acceptance.

    • Slots 4 to 6 (edges 5 to 7): items 2, 3 and 4 arrive one per cycle. The pipe is full, so throughput holds at one result per cycle.

    • Cost: each extra rank adds one cycle of latency and one rank of registers, while full-pipe throughput stays flat.

    Latency is a cycle count per item; throughput is items per cycle in steady state. Only the testbench timing both at once keeps them apart.

    Follow-ups

    When does pipelining not help? In a feedback loop where the next input needs the previous output, such as an accumulator. Extra stages cannot overlap iterations that depend on each other.

    How does the consumer know which cycles carry real results? A valid bit travels beside the data through the same stages. The testbench checks data only on valid cycles.

    What if the input has gaps? Throughput dips for exactly the gap cycles and recovers after. Latency per item is unchanged; bubbles propagate like data.

    Common wrong answers

    A weaker candidate says the pipeline is now four times faster. Only the steady-state rate for streams improved, and only if the clock rose; each item is slower than before.

    Another defines throughput as one over latency. A four-cycle pipeline delivering one result per cycle has latency four and throughput one; the two numbers describe different things.

    A third calls the registers free. Each rank adds area, clock power and verification state, which is why shallow logic is never pipelined for its own sake.

    Common pitfall

    Reading the output before the latency has elapsed compares against a previous item, not the current one. Gate every check on the delayed valid, never on a cycle count held in the testbench alone.

    Interview

    Give both numbers with units: latency in cycles per item, throughput in items per cycle. Then say which one the change moved.

    Check yourself Four ranks, acceptance at edge 1. When is the first result visible and consumed?

    Visible after NBA at edge 4, three periods after acceptance; consumed from pre-edge output at edge 5, four periods after acceptance. Each stream spans 20 consecutive result edges.

    Check yourself The clock rises 30 percent after adding one stage but items per cycle are unchanged. What happens?

    Throughput rises 30 percent. Elapsed latency changes from S/f to (S+1)/(1.3f), so it falls only when S > 10/3. For two stages becoming three, latency grows from 2/f to about 2.31/f despite the faster clock.

    Solution and testbench

    A four-deep valid-tracking pipe plus the testbench that measures first-result latency and per-cycle rate.

    scale_pipe.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    module scale_pipe #(parameter int S = 4, parameter int W = 8) (
      input  logic         clk, rst_n,
      input  logic         in_valid,
      input  logic [W-1:0] in_data,
      output logic         out_valid,
      output logic [W-1:0] out_data
    );
      logic         v [S];
      logic [W-1:0] d [S];
      always_ff @(posedge clk or negedge rst_n)
        if (!rst_n) begin
          for (int i = 0; i < S; i++) begin v[i] <= 1'b0; d[i] <= '0; end
        end else begin
          v[0] <= in_valid; d[0] <= in_data;
          for (int i = 1; i < S; i++) begin v[i] <= v[i-1]; d[i] <= d[i-1]; end
        end
      assign out_valid = v[S-1];
      assign out_data  = d[S-1];
    endmodule
    

    Remember

    • An extra stage adds one cycle of latency and one rank of registers; steady-state throughput stays flat.

    • The clock can rise if the cut stage was critical, which is the only gain.

    • A feedback loop, such as an accumulator, cannot overlap iterations, so more stages do not help.

    Rule of thumb: give both numbers with units, then say which one the change moved.

    Keep going

    • Practice: Two-stage valid/ready pipeline: throughput vs latency and backpressure

    • Interview: run a mock interview on this topic

    Related topics

    • Throughput and latency

    Previous

    318 / 350

    Next: Stalling without deadlock

    Up next

    Up nextStalling without deadlock

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Enables, resets and counters
    clkin_data1234567r01234567r10123456r2012345r301234
    Four pipeline ranks fed one item per cycle: item 1 reaches the output after the fourth edge, then one result per cycle