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
    • SRAM and ROM
    • Register Files
    • Valid/Ready Handshake
    • AXI-Lite
    • AXI-Stream
    • Bus Integration
    • Synchronous FIFO
    • Register-Map and CSR RTL
    • Memory Reliability
    • Peripheral RTL Integration
      • Peripheral Shell
      • Clock, Reset, and Power Contract
      • Interrupts and Events
      • FIFO and DMA Boundary
      • Errors and Integration Signoff
    • Full AXI4: RTL Roadmap
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Peripheral RTL Integration
  1. Topics
  2. RTL Design
  3. Memory & Buses
  4. Peripheral RTL Integration
  5. Interrupts and Events

Part 7 · Memory & Buses · Intermediate

Interrupts and Events

Capture edge events, expose causes, support masking, and prevent interrupt storms or lost acknowledgements.

Why this matters

A level cause such as RX data that software only clears as a bit reasserts at once. A one-cycle pin pulse can fall between two destination samples and never set pending.

After this lesson you can: classify peripheral events as level or sticky, and capture a short external pulse by stretching it across two destination samples.

Peripheral events such as RX-not-empty, TX-below-watermark, transfer-done, timeout, and protocol-error have different persistence. Convert them into explicit level or sticky status before aggregation.

The sensor controller uses RX watermark and TX space as level conditions, while transfer-done, timeout, and illegal-command events become sticky pending bits. That distinction determines whether software clears a latch or removes an underlying condition.

Source

Recommended form

RX data available

Level from FIFO occupancy

TX space available

Level from watermark

Transfer done

Sticky edge event

Timeout/error

Sticky event with diagnostic context

External pin edge

Synchronized edge detector then sticky pending

Level causes reassert immediately after software clears them if the underlying condition remains true. Sticky edge causes remain pending until W1C acknowledgement.

An external pin edge first needs a capture contract. A 2FF synchronizer plus edge detector can miss a pulse that rises at 2 ns and falls at 8 ns between destination samples at 0 and 10 ns: both samples see zero, so pending never sets. Stretch high across at least two destination sampling opportunities with setup/hold margin and a similarly observable low gap; a raw asynchronous pin may need a source latch/acknowledged capture. Toggle capture requires that successive toggles be separated enough for the destination to observe each state; otherwise two toggles cancel. For unbounded destination stalls use an acknowledged event transfer and source buffering/backpressure.

Compare the missed 2..8 ns pulse with a stretched 2..28 ns level: ideal samples at 10/20 ns see high and the synchronized edge eventually sets pending. Physical synchroniser reliability, timing margins and reset history still need implementation checks. After capture, repeated events can still coalesce in one sticky bit; use counters or FIFO service when occurrences must be counted.

Each slot is 2 ns. Slot 0 is the reset state, and the destination clock rises at slots 5, 10 and 15, which are the 10, 20 and 30 ns samples.

  • The short pulse is high in slots 1 to 3 only. Both destination samples see 0, so the first synchronizer never captures it and its pending bit stays 0.

  • The stretched level stays high from slot 1 to slot 13. The 10 ns sample captures it into the first flop and the 20 ns sample moves it to the second flop.

  • The sticky pending bit rises after the 30 ns edge, driven only by the stretched side. A second event would still merge into the same bit.

Common pitfall

Do not make software clear a level condition. It will reassert on the next cycle. Software must remove the cause, such as draining RX data, or mask the source.

Check yourself Why might RX-not-empty reassert immediately after an interrupt clear?

Because it is a level condition and the FIFO still contains data. The correct service action is to drain data below the threshold, not merely clear a bit.

Remember

  • Level causes (watermark, FIFO space) are cleared by removing the condition. Sticky causes (done, timeout, error) are cleared by W1C.

  • A pulse shorter than the destination sampling gap can be missed by a two-flop synchroniser.

  • Repeated events merge into one sticky bit. Count them if occurrences matter.

Rule of thumb: software clears sticky bits and removes level causes.

Keep going

  • Practice: CDC synchroniser for a memory-peripheral transfer

  • Code lab: Interrupt aggregator

  • Interview: run a mock interview on this topic

Related topics

  • Canonical pulse capture and event spacing

  • Interrupt register pattern

  • FIFO and DMA boundary

Previous

241 / 350

Next: FIFO and DMA Boundary

Up next

Up nextFIFO and DMA Boundary

Sign in to save progress

Practice this lessonReport an error

See also

  • Peripheral Shell
  • Errors and Integration Signoff
dst_clkpin_shortsync_ffpin_stretchedsync_ff2pending
A 2 to 8 ns pin pulse falls between destination samples and never sets pending, while a 2 to 28 ns stretched level is caught at the 10 and 20 ns samples and sets pending