RTL Studio Open IDE

Clock-Domain Crossing

Two-Flip-Flop Synchronizer Chain — L1 Upgrade

Two-flip-flop CDC synchronizer with async reset stretching for source and destination domains.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Two-Flip-Flop Synchronizer Chain — L1 Upgrade is a Verilog reference block in the Clock-Domain Crossing catalog. Clock-domain crossing FIFOs, synchronizers, and handshake bridges. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements a two-flip-flop synchronizer with async reset stretching. It safely transfers a single-bit signal between two asynchronous clock domains. The reset logic stretches the reset assertion if either source or destination domain is resetting. This prevents metastability propagation during reset deassertion.

The module synchronizes din from clk_src to clk_dst. It uses two flip-flops registered on clk_dst. Both flip-flops are cleared by a stretched reset signal. The stretched reset is active low and derived from rst_n_src AND rst_n_dst. This ensures the synchronizer is fully reset when either domain is in reset.

This IP provides a robust two-FF synchronizer with domain-independent reset stretching. It is suitable for L1 integration where simple CDC is required. Simulation confirms correct behavior under various reset and data transition scenarios. Use the VCD dump for detailed signal inspection.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Two-Flip-Flop Synchronizer Chain — L1 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Two-flip-flop CDC synchronizer with async reset stretching for source and destination domains.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Ports

Port NameDirectionWidthDescription
clk_srcInput1Source clock domain
clk_dstInput1Destination clock domain
rst_n_srcInput1Active-low reset for source domain
rst_n_dstInput1Active-low reset for destination domain
dinInput1Data input from source domain
doutOutput1Synchronized data output

Verification

The testbench verifies reset stretching and data propagation. It uses Icarus Verilog for simulation. VCD dump is enabled for waveform analysis.

Test CaseDescriptionExpected ResultStatus
TC1Reset StretchOutput stays 0 when only dst reset is assertedPASS
TC2Propagation 0->1Output becomes 1 after 3 dst cyclesPASS
TC3Propagation 1->0Output becomes 0 after 3 dst cyclesPASS
TC4Async ResetOutput clears to 0 when src reset is assertedPASS

More in Clock-Domain Crossing

All Clock-Domain Crossing blocks