RTL Studio Open IDE

Clock-Domain Crossing

Toggle Bus Capture 4-bit

Captures a 4-bit data bus synchronized to a destination clock domain using a toggle mechanism and 2-stage synchronizer.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Toggle Bus Capture 4-bit 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 core captures a 4-bit data bus synchronized to a destination clock domain using a toggle mechanism.

It employs a 2-stage synchronizer on the valid_src signal to ensure metastability safety during cross-domain transfer.

The design guarantees data integrity when moving signals between asynchronous clock domains with low latency.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Toggle Bus Capture 4-bit.
  2. Read the Verilog module in the editor. The catalog line for this block: Captures a 4-bit data bus synchronized to a destination clock domain using a toggle mechanism and 2-stage synchronizer.
  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_nInput1Active-low asynchronous reset
data_inInput[3:0]4-bit data bus from source domain
valid_srcInput1Source valid signal (toggle flag)
data_outOutput[3:0]Captured 4-bit data in destination domain
valid_dstOutput1Destination valid pulse

Architecture

The design consists of a synchronizer chain and a capture logic block.

  1. Synchronizer Stages: Align the source valid signal to the destination clock domain.
  2. Edge Detection: Identifies the rising transition of the synchronized signal.
  3. Capture Registers: Store the input data upon edge detection.

Verification

The testbench validates basic transfer, multiple transfers, and rapid successive transfers. All test cases passed successfully in the Icarus Verilog simulation environment.

Test CaseDescriptionResult
TC1Basic single transferPASS
TC2Multiple transfers with different dataPASS
TC3Rapid successive transfersPASS

### Expected Simulation Output

After running the simulation, the Log panel should show:

  • TC1 PASS - Data captured correctly
  • TC2 PASS - All transfers correct
  • TC3 PASS - Rapid transfers correct
  • Simulation ends with INFO: PASS.

More in Clock-Domain Crossing

All Clock-Domain Crossing blocks