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
      • Interview: FSM and Control
      • Interview: Timing and STA
        • Reading a critical path report
        • Fixing setup vs hold violations
        • False paths and multicycle paths you must justify
        • Corners, sign-off and clock-gating checks
      • 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: Timing and STA
  1. Topics
  2. RTL Design
  3. Senior & Interview
  4. Senior RTL Interview Questions & Model Answers
  5. Interview: Timing and STA
  6. Fixing setup vs hold violations

Part 9 · Senior · Senior

Fixing setup vs hold violations

Setup and hold remedies, with a functionally checked pipeline candidate and separate STA obligations.

On this page

    Why this matters

    Setup fails when the path is too slow and hold fails when it is too fast, so the fixes pull opposite ways. Slowing the clock cannot repair hold, because the period is not in the hold equation.

    After this lesson you can: choose a setup fix and a hold fix for a given violation, and explain why hold must be rechecked after every setup change.

    The question

    “Setup fails on this path. Do you fix it in RTL or with an ECO?” A follow-up adds a hold violation on a neighbouring path.

    The question tests fix direction. Setup is about too much delay, hold about too little, and the two fixes pull opposite ways.

    Model answer

    Setup slack is required minus arrival with the period inside required. Anything that shortens arrival or lengthens the budget helps: less logic, a faster implementation, or a pipeline cut.

    For the ordinary same-clock hold relationship, slack is minimum data arrival minus required, without a period term. Added minimum data delay is common; reducing harmful capture-minus-launch skew also helps. Moving capture earlier or launch later can improve hold but spend setup margin. Recheck both checks in every required view.

    Violation

    What helps

    What does not help

    Setup (too slow)

    Pipeline the cone, resize or buffer, useful skew, slower clock

    Adding delay cells

    Hold (too fast)

    Minimum-data-delay insertion or correction of harmful capture-minus-launch skew

    Slowing an ordinary same-clock period

    Both at once

    Fix setup structurally first, then re-check hold

    Fixing hold first, since setup work moves it

    Interview

    Setup needs less maximum delay or more budget. Hold needs enough minimum delay or less harmful skew. Recheck both across all views after either change.

    Solution and testbench

    A pipeline cut is a candidate structural setup remedy: two adder levels in one cycle become one level per cycle, with the second operand delayed to match. Mapped topology and STA across the required views must establish the actual setup improvement and hold closure.

    add_comb puts two adders between registers. add_pipe registers a + b as s1 and delays c into c1 in the same cycle, so the second adder sees operands from the same input cycle.

    Read each row left to right from the inputs to register y. The highlighted registers are the pipeline cut.

    • Top row: two adder levels sit between the inputs and y, so both count against one clock period.

    • Bottom row: each period sees only one adder level, at the cost of one more cycle of latency.

    • c1 exists only to keep c in step with s1. Without it, the second adder would add this cycle's c to last cycle's a + b.

    Both forms plus the testbench sit in one block below. The check sweeps all 4096 input combinations of the 4-bit operands.

    add_comb.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    module add_comb #(parameter int W = 4) (
      input  logic         clk,
      input  logic [W-1:0] a, b, c,
      output logic [W-1:0] y
    );
      always_ff @(posedge clk) y <= a + b + c;        // two adder levels in one cycle
    endmodule
    
    module add_pipe #(parameter int W = 4) (
      input  logic         clk,
      input  logic [W-1:0] a, b, c,
      output logic [W-1:0] y
    );
      logic [W-1:0] s1, c1;
      always_ff @(posedge clk) begin
        s1 <= a + b;                                  // first level
        c1 <= c;                                      // delay c to match s1
      end
      always_ff @(posedge clk) y <= s1 + c1;          // second level, one cycle later
    endmodule
    

    Follow-ups

    • Q: The pipeline cut changes latency. Who approves that? The block owner and the system architect. Latency is a protocol change, so the valid and handshake logic must move with the data.

    • Q: Hold fails after your ECO added buffers. What now? Compare the before/after minimum-delay reports and clock paths. Data-path delay normally helps hold; a changed clock skew or faster data branch may explain the regression. Add only the missing minimum delay on the failing data branch, or correct the clock change, then recheck setup and hold. Reducing data-path delay would worsen that hold failure.

    • Q: When is an RTL change wrong and a gate-level ECO right? Late in the flow with a small, local violation. An ECO avoids re-verification of the whole block.

    Common wrong answers

    Common pitfall

    Fixing hold by slowing the clock shows the terms are mixed up. The period is absent from hold slack, so the clock cannot move it.

    • “Buffers always fix setup.” Buffering can improve setup on high-load or long RC nets by improving slew and drive, but unnecessary stages add delay. Compare total cell-plus-net delay before and after; recheck minimum delay and all affected endpoints too.

    • “Pipeline without delaying the side inputs.” The listing above delays c beside s1 for a reason. An undelayed side input mixes cycles and corrupts the sum.

    • “Fix hold first, it is smaller.” Setup restructuring moves hold afterwards. Order fixes setup first, then hold.

    Check yourself A netlist ECO fixes setup but the next run shows new hold violations. What happened?

    The setup fix sped slow paths and starved fast ones of delay. Hold must be re-checked after every setup change, with minimal delay added only where needed.

    Remember

    • Setup needs less maximum delay or more budget: less logic, a faster implementation or a pipeline cut.

    • Hold needs enough minimum delay or less harmful skew, and has no period term.

    • Order fixes setup first, then hold, and recheck both in every view.

    Rule of thumb: a pipeline cut changes latency, so move the valid and handshake logic with the data.

    How this was checked

    The pipeline-cut bench is untimed RTL, run with Icarus Verilog 13.0 (2026-10-16), and checks function and latency only. No timing result is claimed.

    Keep going

    • Interview: run a mock interview on this topic

    Related topics

    • Fix strategy: setup vs hold

    Previous

    326 / 350

    Next: False paths and multicycle paths you must justify

    Up next

    Up nextFalse paths and multicycle paths you must justify

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Corners, sign-off and clock-gating checks