51. Clock and Reset Design

Question.5

A controller uses active-LOW nReset. During a fault, its clock may stop, but its state registers must reset without waiting for a clock edge. Once the fault clears and the clock returns, reset must be released safely.

Which reset approach is most appropriate?

Need Help? Refer to the Quick Guide below

Digital circuits must deliver correct results at the correct time. This guide covers timing checks, clock control, reset, and clock-domain crossing. It focuses on practical circuit choices and common failures.

1. Sequential Timing, Critical Path and Clock Non-Idealities

A synchronous path must produce correct data before the capture edge and keep it stable around that edge.

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
───────►│ Launch   │───►│ Combinational│───►│ Capture  │──────►
        β”‚ Register β”‚    β”‚     Logic    β”‚    β”‚ Register β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β–²                                    β–²
             └────────────── Clock β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Timing pathFrom β†’ To
Register-to-registerLaunch register β†’ Capture register
Input-to-registerInput β†’ Register
Register-to-outputRegister β†’ Output
Input-to-outputInput β†’ Output

Setup, Hold and Slack

  • Clock-to-Q: tCQ,max, tCQ,min β€” launch-register output delay.
  • Combinational delay: tcomb,max, tcomb,min β€” delay through logic.
  • Setup: tsetup β€” data must arrive before the capture edge.
  • Hold: thold β€” data must remain stable after the capture edge.

For the basic zero-skew, zero-uncertainty register-to-register model:

Setup: TCLK β‰₯ tCQ,max + tcomb,max + tsetup
Hold:  tCQ,min + tcomb,min β‰₯ thold

Arrival = tCQ,max + tcomb,max
Required = TCLK - tsetup
Setup Slack = Required - Arrival
Hold Slack  = tCQ,min + tcomb,min - thold

Positive slack: pass; zero: boundary; negative: violation.

Example: TCLK=6 ns, tCQ,max=0.8 ns, tcomb,max=3.9 ns, tsetup=0.7 ns. Arrival = 4.7 ns; required = 5.3 ns; setup slack = +0.6 ns. With tCQ,min=0.25 ns, tcomb,min=0.35 ns, thold=0.80 ns, hold slack = βˆ’0.20 ns, so hold fails although setup passes.

Critical Path and Fmax

The path requiring the longest clock period limits the operating frequency.

Reg A ──► Path 1 ──► Reg B
Reg C ──► Path 2 ──► Reg D
Reg E ──► Path 3 ──► Reg F
PathRequired period
14.6 ns
26.1 ns
35.2 ns

Path 2 is critical: TCLK,min = 6.1 ns and Fmax(MHz) = 1000 / TCLK,min(ns) β‰ˆ 163.9 MHz.

Clock Non-Idealities

  • Latency: clock propagation delay to a register.
  • Skew: capture-clock arrival minus launch-clock arrival.
  • Jitter: variation in edge timing.
  • Uncertainty: modeled margin for clock-edge variation.
SkewSetup marginHold margin
PositiveIncreasesDecreases
NegativeDecreasesIncreases

With skew and uncertainty:

Setup Slack = TCLK + Skew - Setup_Uncertainty
              - (tCQ,max + tcomb,max + tsetup)
Hold Slack  = tCQ,min + tcomb,min - thold
              - Skew - Hold_Uncertainty

Debug: setup failure β†’ inspect maximum delay, period, skew, uncertainty. Hold failure β†’ inspect minimum delay and clock relationship. Slowing the clock can help setup but does not normally repair same-clock hold.

2. Clock Control, Generated Clocks and Safe Clock Selection

Prefer one master clock with clock enables when only the update rate changes.

Clock Enable

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
Data ───────────►│                β”‚
Enable ─────────►│    Register    │────► Output
Clock ──────────►│      with      β”‚
                 β”‚ Clock Enable   β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enable at active edgeRegister action
0Hold
1Capture
100 MHz Master Clock

Block A β†’ Enable every cycle
Block B β†’ Enable every 4 cycles

Both blocks remain in the 100 MHz clock domain; Block B updates every fourth cycle without a divided clock.

Safe Clock Gating

A direct Clock Β· Enable gate can generate shortened or extra pulses if Enable changes while the clock is HIGH. For positive-edge-triggered logic, a low-level-sensitive latch holds the gating enable during the HIGH phase.

Safe Clock Gating

Gated_Clock = Clock Β· Safe_Enable. The latch is transparent while Clock=0 and closed while Clock=1.

Technology choice: ASICs commonly use integrated clock-gating cells; FPGAs normally prefer dedicated enables or supported clock-control resources, not arbitrary fabric gates.

Generated Clocks

A generated clock is derived by division, multiplication, phase shift, or clock management. Timing analysis must know its frequency/phase relationship to the source; generated clocks are not automatically asynchronous.

A PLL manages clock frequency/phase; a DLL provides delay/phase alignment. A Locked indication signals that the intended relationship has been established.

Glitch-Free Clock Selection

Selecting live clocks with an ordinary combinational MUX risks extra or shortened pulses. Cross-coupled interlocks ensure break-before-make selection.

Select=0 chooses Clock_A; Select=1 chooses Clock_B.

Request_A = Select' Β· Enable_B'
Request_B = Select Β· Enable_A'
Glitch Free Clock Selection
Gated_A = Clock_A Β· Enable_A
Gated_B = Clock_B Β· Enable_B
Clock_Out = Gated_A + Gated_B

The matching labels represent cross-coupled feedback: Enable_B' feeds Interlock AND A, and Enable_A' feeds Interlock AND B:

Enable_A β†’ NOT β†’ Enable_A'
Enable_B β†’ NOT β†’ Enable_B'

Each clock enable can assert only when the other is LOW. During an A→B switch:

Select β†’ 1
   ↓
Request_A β†’ 0
   ↓
Enable_A clears during the LOW phase of Clock_A
   ↓
Request_B can become 1
   ↓
Enable_B sets during the LOW phase of Clock_B
   ↓
Clock_B drives Clock_Out

This preserves pulse integrity. Limitation: a stopped source may prevent its latch from reaching the safe phase, delaying or blocking the switch.

RequirementPreferred choice
Same clock, slower updatesClock enable
Suppress ASIC clock activityIntegrated clock gating
Related new frequency/phaseClock-management resource
Select between active clocksGlitch-free clock selector
If only the update rate changes,
prefer one master clock + clock enable.

Create or switch clocks only when
the architecture genuinely requires another clock relationship.

3. Reset Architecture and Safe Reset Release

A reset design must define polarity, synchronous/asynchronous behavior, and priority. Active-LOW reset is named nReset (0 = asserted).

Reset Behavior and Priority

ResetAssertionDeassertion
SynchronousAt active clock edgeAt active clock edge
AsynchronousImmediatelyMay occur between edges unless synchronized

Example sequential priority:

nReset = 0       β†’ Reset state
else Load = 1    β†’ Load data
else Enable = 1  β†’ Update / state transition
else             β†’ Hold

Reset must dominate Load and Enable if that priority is specified.

Safe Asynchronous Reset Release

Recovery: reset is released sufficiently before the active clock edge. Removal: reset is not released too soon after it. A common strategy is asynchronous assertion with synchronous deassertion.

Two-Stage Reset Synchronizer

2 Stage Reset Synchronizer

When nReset=0, both DFFs clear immediately. After release with adequate timing margin, the two-stage sequence is:

Destination rising edgeStage 1nReset_Sync
Before first00
First10
Second11

Thus nReset_Sync releases on the second destination edge in the defined sequence.

Multi-Domain Release and Sequencing

Multi-domain Release and Sequencing

Each independent domain uses its own clock to synchronize reset release; do not reuse another domain's already-synchronized release.

Clock_A β†’ controls release of nReset_A
Clock_B β†’ controls release of nReset_B
Multi-domain Release and Sequencing Flow

Synchronization defines how release enters a domain; sequencing defines when it may occur. Dependencies include clock lock, initialization, memory/interface readiness, and prior-block readiness.

Reset Distribution and Failures

A reset tree distributes a high-fanout reset. A reset domain groups sequential elements sharing reset behavior and release policy.

SymptomFirst check
Registers release inconsistentlyAsynchronous deassertion
One domain fails after releaseWrong domain clock/release sequence
Load/update wins over resetIncorrect reset priority
Dependent block starts earlyReset sequencing

4. Single-Bit and Event Clock-Domain Crossing

A clock-domain crossing (CDC) occurs when one clock domain's signal is sampled by another.

ClocksRelationship
SameIdentical clock waveform
RelatedKnown frequency/timing relation
Phase-unrelatedPhase alignment cannot be relied upon
AsynchronousNo guaranteed frequency or phase relation

Metastability and Two-FF Synchronization

An asynchronous transition close to a destination sampling edge can violate setup/hold and cause metastability.

Metastability and Two-FF synchronizer

A synchronizer reduces the likelihood of metastability propagating; it cannot eliminate it.

Metastability and Two-FF synchronizer 2

Both stages use Clock_B; downstream logic reads only DFF2. For an input stable before sampling, DFF1 updates on the first destination edge and Sync_Out on the second. Use this for independent single-bit levels, not pulses or related multi-bit words.

Short Pulses and Pulse Stretching

A pulse entirely between destination edges is missed:

Source Pulse:      ___
                  |   |
__________________|   |________________

Clock_B:       ↑           ↑           ↑

When pulse widening is permitted, stretch the pulse long enough to guarantee a destination sampling edge with adequate setup/hold margin.

Short Pulse and Pulse Streching

The optional edge detector creates a one-cycle destination pulse; otherwise use the synchronized level. Events must be spaced far enough apart.

Toggle Event Transfer

One event toggles a retained source state; the destination detects the synchronized change.

Toggle Event Transfer

Source_Toggle ← Source_Toggle'; Pulse_Dst = Sync_2 βŠ• Prev_Sync. Sync_1, Sync_2, and Prev_Sync are destination-clocked. Initialize Source_Toggle = Sync_1 = Sync_2 = Prev_Sync = 0 to prevent a false event after reset.

Event-rate limit: two source toggles before observation can cancel:

Source:       0 β†’ 1 β†’ 0
Destination:  0 ─────→ 0

Request/Acknowledge

When each event must be acknowledged before the next begins, use a two-way handshake:

Request-acknowledge handshake

Request crosses through destination synchronization; Acknowledge crosses back through source synchronization. A new request begins only after the source sees synchronized Acknowledge=0. This adds latency but provides completion confirmation.

NeedCDC technique
Stable independent level2-FF synchronizer
Pulse may be widenedPulse stretching
Occasional event without acknowledgementToggle synchronizer
Event requiring acknowledgementRequest/Acknowledge

5. Multi-Bit and Stream Clock-Domain Crossing

Coherency requires all related bits of a transferred word to represent the same transaction. Independent 2-FF synchronization of data bits can create mixed words:

Source change: 01 β†’ 10
Possible incoherent observation: 00 or 11

Stable-Data Handshake

For an occasional multi-bit word, the source holds Data stable while synchronized control determines destination capture.

Stable Data Handshake

The destination captures the held bus directly and only once; Request/Acknowledge controls use synchronizers. Source data must remain stable until acknowledgement, and a new transaction waits for handshake return-to-idle.

Gray Code and Pointer Crossing

Adjacent legal source counter states change one Gray bit. Conversion:

Gray = Binary βŠ• (Binary >> 1)

BinaryGray
0000
0101
1011
1110
Gray Code and Pointer crossing

The Gray value is registered in the source domain, then each bit passes through destination-clocked 2-FF synchronization. Remote pointer visibility is delayed. A slow destination may skip source states, so consecutive observations need not differ by one bit.

Boundary: Gray code is suitable for restricted counters/pointers, not arbitrary multi-bit data, and never replaces synchronization.

Asynchronous FIFO

For continuous multi-bit streaming across independent clocks:

Asynchronous FIFO

The data uses dual-port storage; each domain maintains its own binary pointer and receives a synchronized, registered Gray pointer from the other:

Pointer sentDestination synchronizer
Write Gray pointer β†’ Read domainPer-bit 2-FF, Read Clock
Read Gray pointer β†’ Write domainPer-bit 2-FF, Write Clock
Status flagCalculated inRemote information
FullWrite domainSynchronized read pointer
EmptyRead domainSynchronized write pointer

The write side accepts writes only when Full = 0, and the read side accepts reads only when Empty = 0. Remote activity becomes visible after synchronization delay.

TransferPreferred architecture
Independent level2-FF
Short eventStretch or toggle
Acknowledged eventRequest/Acknowledge
Multi-bit transactionStable-data handshake
Restricted pointerGray + synchronization
Continuous streamAsynchronous FIFO

6. Timing Intent, Exceptions and Debugging

Timing constraints define when transfers must meet their requirements, not how the hardware operates.

Clock and I/O Timing Intent

Clock and I/O Timing Intent
Constraint intentWhat analysis needs
Clock periodInterval between active edges
Input timingEarliest/latest external arrival
Output timingExternal receiver's data requirement
Generated clockSource-derived frequency/phase relationship

For example, TCLK=10 ns corresponds to 100 MHz. External I/O timing consumes part of the internal budget. Related generated clocks must be analyzed with their actual relationship.

Timing Exceptions

ExceptionLegitimate case
False pathNo valid timed transfer is required in the analyzed mode
Multicycle pathA real transfer is deliberately allowed later capture

A test-only path inactive in the functional mode can be a false path. A multicycle path requires guaranteed suppression of the intermediate capture while the launched data remains valid:

Edge N       β†’ Launch data
Edge N + 1   β†’ Destination capture guaranteed disabled
Edge N + 2   β†’ Destination captures stable data

Multicycle exceptions must retain proper setup and hold checks. Never use an exception to conceal a real timing or CDC defect.

Setup, Hold and Functional Debugging

SymptomInspect first
Data arrives too lateSetup: maximum delay, period, skew, uncertainty
Data changes during hold windowHold: minimum delay, skew, clock relation
Extra or malformed clock edgeGating or clock-source selection
Related-clock timing mismatchGenerated-clock relationship
Startup/one-domain reset failureReset polarity, priority, release sequence
Unreliable asynchronous levelSingle-bit synchronizer
Missed/repeated eventPulse width, toggle rate, reconstruction
Corrupted multi-bit wordCoherency or handshake
Incorrect FIFO Full/EmptyPointer synchronization and status ownership

Start with the failing signal, its source/destination clocks, and the intended transfer. Fix the design or timing assumptionsβ€”not just the warning.

Select Answer

Restart quiz!