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
    • STA Foundations
    • Setup, Hold and Slack
    • Skew and Variation
    • Timing Exceptions
    • Clock Gating
    • RTL for Timing
      • Practice
      • Fanout
      • Patterns
      • RTL Hooks
      • Checklist
      • Cutting Logic Depth: a Timing-Closure Story
      • Mini Project: Close Timing on a FIR Filter
    • Clock Architecture
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Timing & Clocking
  1. Topics
  2. RTL Design
  3. Timing & Clocking
  4. RTL for Timing

Part 5 · Timing & Clocking · Intermediate

RTL for Timing

RTL habits that ease timing closure: depth budgets, fanout control, shallow structures and review.

  • 7topics
  • 7lessons

Topics in this section

  1. 1Practice1 lesson
  2. 2Fanout1 lesson
  3. 3Patterns1 lesson
  4. 4RTL Hooks1 lesson
  5. 5Checklist1 lesson
  6. 6Cutting Logic Depth: a Timing-Closure Story1 lesson
  7. 7Mini Project: Close Timing on a FIR Filter1 lesson
On this page

    Timing closure is cheapest when the RTL already has the right shape. This topic turns paths, slack, skew, exceptions and gating into habits for writing code.

    Lessons in this topic

    7 lessons, about 39 min

    1. 1PracticeYou can turn a clock period into a logic depth budget, compare an operation against it, and apply the seven design rules.4 min
    2. 2FanoutYou can estimate the delay of a high-fanout net, replicate a register, and keep the copies from being merged.4 min
    3. 3PatternsYou can pick a shallower structure for a mux or priority select, say what assumption it relies on, and guard that assumption with an assertion.4 min
    4. 4RTL HooksYou can add a timing hook to a design, such as a pipeline depth, a fast or small variant, a replication count or a preserve attribute, and keep the testbench latency-aware.4 min
    5. 5ChecklistYou can review RTL for timing with a list that covers interfaces, depth, fanout, assumptions, parameters, exceptions, gating, resets and constraints.3 min
    6. 6Cutting Logic Depth: a Timing-Closure StoryYou can measure logic depth with a synthesis run, choose between restructuring, a register cut and a loop change, count the flops and latency each costs, and explain why a feedback loop cannot be pipelined.9 min
    7. 7Mini Project: Close Timing on a FIR FilterYou can measure a filter's logic depth with Yosys, convert a direct form to a transposed form or a pipelined tree, count flops and latency, and catch a misaligned pipeline with an impulse test.11 min
    Check yourself Looking ahead to the RTL hooks lesson: which is cheaper to change late in a project: the logic depth of a path or the number of pipeline stages controlled by a parameter?

    The parameter makes the RTL edit small, but the interface owner must approve the changed latency. Update valid/control/side-data alignment, consumer timing, scoreboards and integration checks; a local parameter change alone does not close that work.

    Interview

    “How do you write RTL to meet timing?” Name the levers: register boundaries, depth budget, fanout control, shallow structures (one-hot/AND-OR, trees), and parametrised pipeline stages.

    Then give a measured example.

    Revision sheet

    The whole topic on one page, taken from each lesson's Remember box. Read it before an interview, or print it.

    Practice

    • Depth budget = (period - clock-to-Q - setup - margin) / gate-plus-wire delay.

    • Register interfaces where appropriate, put late signals last, limit fanout, and make pipeline stages a parameter when the path is uncertain.

    • Gate levels are not equal delays. Check the target library, corner, load and wire before you choose an architecture.

    Rule of thumb: use the budget to decide, not to chase the minimum.

    Fanout

    • Buffer levels grow with log of the load count: 2 levels at 16 loads, 5 at 1,024.

    • Replicate the register, not the logic before it. Use 2 to 4 copies, only on nets the timing report shows as high fanout.

    • Identical registers are merged. The copies survive only with a preserve-hierarchy boundary or the tool's do-not-merge attribute.

    Rule of thumb: replicate at the source, and check the synthesis report to see that the copies are still there.

    Patterns

    • A one-hot 16:1 mux is only slightly shallower than d[s], because the tool already builds a good tree.

    • AND-OR selects need at most one request. Registered control and prefix structures trade latency or area for depth.

    • A shallow pattern is valid only with its assumption. Keep $onehot0(req) asserted at the caller boundary.

    Rule of thumb: never apply a shallow pattern without writing down and checking the assumption it relies on.

    RTL Hooks

    • Hooks cover depth, implementation choice, output registers, replication, preserve, fanout limits and don't-touch.

    • Valid bits, control and side data must be delayed by the same number of stages as the data, so put them in the same hook.

    • Attribute names are tool specific. Put them in one wrapper or macro per tool.

    Rule of thumb: let the scoreboard take its latency from the same parameter as the design.

    Checklist

    • Registered interfaces, estimated depth of the three worst paths and an identified list of high-fanout controls.

    • Every shallow structure has an assertion. Every exception has an RTL reason and a test.

    • Gating uses library ICGs with a test enable, and the unconstrained-endpoints report is empty.

    Rule of thumb: keep a short, specific list in the pull-request template, because a long generic one is skipped.

    Cutting Logic Depth: a Timing-Closure Story

    • Restructure first: a tree instead of a chain cut 119 levels to 73 with no flops and no latency.

    • A register only helps outside a loop. Once the loop is the longest path, extra registers add latency and change nothing, or change the function.

    • Shorten a loop by changing it: split it with a registered carry, use lookahead or a redundant total, and align the result.

    Rule of thumb: find where the longest path starts and ends before choosing a fix; if it starts and ends at the same register, change the loop.

    Mini Project: Close Timing on a FIR Filter

    • Yosys already merges a sum of products into one adder tree, so rewriting the sum as a tree in RTL changed nothing: 48 levels both ways.

    • The transposed form makes every path one multiply and one add, at the same latency: 48 levels down to 38 for 72 flops.

    • Every branch of a pipelined sum must cross the same number of registers; an impulse with distinct coefficients shows which taps moved.

    Rule of thumb: measure where the path starts and ends before restructuring, and re-run an impulse test after every pipelining change.

    Practise it

    • Practice question: Pipelined arbiter for timing closure

    • Code lab: AI pooling max

    • Code lab: Pipeline register stage

    • Interview: run a mock interview on this topic

    PreviousNext: Practice

    Up next

    Up nextPractice

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • STA Foundations
    • Setup, Hold and Slack
    • Skew and Variation