retro-silicon

Components

common/cdc

A flip-flop synchronizer for signals from another clock domain

Portable Sim: passing (3 passed). Used by Nintendo Entertainment System. Source.

BoardStateRun
Sipeed Tang Nano 20Kverified2026-10-28, at ac84cec
Sipeed Tang Console 138Kstale2026-10-25, at f2536e6
TUL PYNQ-Z2verified2026-10-28, at ac84cec

Verified: the latest run on that board of a system using it passed every test, and the component hasn't changed since. Stale: it has changed since that run.

README

A flip-flop synchronizer: brings a signal from another clock domain into this one through STAGES flip-flops, so a value that changes near the clock edge settles before anything uses it.

Module cdc_sync. It’s safe only for signals whose bits can be taken in any mix of old and new without harm:

Ports

PortDirWidthMeaning
clkin1This domain’s clock
dinWFrom the other domain
qoutWd, STAGES clocks later

Parameters

ParameterDefaultMeaning
W1Bits
STAGES2Flip-flops in the chain, 2 or more

Status

Sim test: the output is the input STAGES clocks later. In video/line-scaler and systems/nes, between the NES’s clock and the HDMI pixel clock, on a Tang Nano 20K.