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
    • Clock Architecture
      • Clock-Domain Plan
      • Glitch-Free Clock Mux
      • Generated and Virtual Clocks
      • PLL Lock and Reset Coordination
      • Source-Synchronous Interfaces
      • DVFS Transition Protocol
      • Clock Constraint Examples
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Clock Architecture
  1. Topics
  2. RTL Design
  3. Timing & Clocking
  4. Clock Architecture
  5. PLL Lock and Reset Coordination

Part 5 · Timing & Clocking · Intermediate

PLL Lock and Reset Coordination

Treat clock validity and reset release as an ordered system protocol, not a combinational AND of status pins.

Why this matters

The lock pin can be asynchronous and can chatter near acquisition. Using it directly as reset release lets the core out of reset before its synchroniser has seen enough clean clock edges.

After this lesson you can: sequence clock validity and reset release, qualify PLL lock with a counter, and say what must happen when lock is lost.

PLL and reset sequencing state machine.
Clock controller states from reset through qualified lock and synchronous domain release.

For the worked tree, the controller keeps the core isolated until the 400 MHz PLL output has remained qualified, then lets the core reset synchronizer observe enough clean clock edges. A later lock loss returns the same domain to containment before any fallback clock is selected.

  • Synchronize or qualify asynchronous lock status.

  • Require lock stable for a documented interval.

  • Assert reset asynchronously on clock loss (from the clock-fault/reset controller) if the safety requirement needs immediate containment.

  • Release reset synchronously in each destination clock domain.

  • Mask traffic until both clock and reset contracts are complete.

design.sv
1
2
3
4
5
6
7
8
9
10
// snippet: qualify lock before allowing reset release
// pll_lock_sync is already synchronised to ref_clk, so lost lock clears the
// count synchronously. Only power-on reset is an asynchronous clear; immediate
// containment on clock loss belongs to the separate clock-fault/reset controller.
always_ff @(posedge ref_clk or negedge por_n)
  if (!por_n)              lock_count_q <= '0;
  else if (!pll_lock_sync) lock_count_q <= '0;
  else if (!(&lock_count_q)) lock_count_q <= lock_count_q + 1'b1;

assign clock_qualified = &lock_count_q;

Each slot is one ref_clk cycle, sampled just after its rising edge. The counter here is 2 bits wide, so lock must be high for three samples.

  • pll_lock_sync rises in slot 0; the count reaches 3 in slot 3 and clock_qualified rises with it.

  • Lock drops in slot 5. The next edge clears the count, so clock_qualified falls in slot 6.

  • Lock returns in slot 7, but the count restarts from 0: a short return of lock does not re-qualify the clock.

Common pitfall

Do not use raw pll_lock as reset deassertion. Lock can be asynchronous, chatter near acquisition, and arrive in a clock domain that has not yet produced enough clean edges for synchronous release.

Check yourself What happens if PLL lock drops while the domain is running?

The architecture must define immediate reset/containment, isolation of outputs and transactions, diagnostics, reacquisition qualification, and a controlled resume sequence.

Remember

  • Synchronise lock, require it stable for a documented interval, then release reset synchronously in each destination domain.

  • Immediate containment on clock loss belongs to a clock-fault and reset controller, with outputs isolated and traffic masked.

  • After lock is lost, reacquisition is qualified again and resume follows a controlled sequence.

Rule of thumb: do not use raw pll_lock as reset deassertion.

Keep going

  • Interview: run a mock interview on this topic

Related topics

  • Reset architecture

  • Source-synchronous interfaces

Previous

151 / 350

Next: Source-Synchronous Interfaces

Up next

Up nextSource-Synchronous Interfaces

Sign in to save progress

Practice this lessonReport an error

See also

  • Clock-Domain Plan
  • Glitch-Free Clock Mux
  • DVFS Transition Protocol
ref_clkpll_lock_synclock_count_q0123012clock_qualified
Simulation of the lock qualifier with a 2-bit counter: lock is qualified after three high samples, lost at once when lock drops, and counted again from zero