RTL Studio Open IDE

Clock-Domain Crossing

Toggle Synchronizer 1-Bit — L2 Upgrade

Toggle synchronizer with 4-bit payload hold for asynchronous clock domain crossing.

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

Toggle Synchronizer 1-Bit — L2 Upgrade is a Verilog reference block in the Clock-Domain Crossing catalog. Clock-domain crossing FIFOs, synchronizers, and handshake bridges. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.

This IP implements a robust toggle-based synchronizer for crossing a single control bit between asynchronous clock domains, accompanied by a 4-bit payload hold mechanism. It ensures data integrity by capturing the payload in the source domain and releasing it in the destination domain only upon acknowledgment. The design utilizes a standard two-stage flip-flop chain for the control signal to mitigate metastability risks and employs a handshake protocol (valid/ready) to manage flow control.

This solution is ideal for L2 upgrade scenarios or any interface requiring safe data transfer across clock domains without losing payload information.

The module synchronizes a valid signal while holding the associated payload_data.

  • Metastability Protection: A two-stage synchronizer chain handles the control bit crossing.
  • Data Integrity: The payload is captured in the source domain when valid is asserted and ready_src is high. It remains stable until the destination acknowledges receipt.
  • Flow Control: The ready_src signal indicates to the source that the synchronizer is free to accept new data.
  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Toggle Synchronizer 1-Bit — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Toggle synchronizer with 4-bit payload hold for asynchronous clock domain crossing.
  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.

Architecture

The design consists of two main blocks:

  1. Source Domain: Captures payload, asserts request, and waits for ready.
  2. Destination Domain: Synchronizes the request, asserts valid, and acknowledges receipt.

### Block Diagram

Ports

Port NameDirectionWidthDescription
clk_srcInput1Source clock domain
rst_n_srcInput1Source asynchronous reset, active low
payload_validInput1Valid signal from source
payload_dataInput4Data payload from source
ready_srcOutput1Ready signal to source (high when idle)
clk_dstInput1Destination clock domain
rst_n_dstInput1Destination asynchronous reset, active low
payload_outOutput4Data payload to destination
valid_dstOutput1Valid signal to destination

Verification

The testbench verifies basic payload transfer functionality across clock domains. It checks for correct data propagation for various input values and validates the ready_src signal behavior during idle states.

### Test Cases

Test CaseDescriptionExpected Result
TC1Basic payload transferPayload passed correctly
TC2Different payload valuePayload passed correctly
TC3Zero payloadPayload passed correctly
TC4Max payloadPayload passed correctly
TC5Ready signal checkready_src is high when idle

### Simulation Log

After running the simulation, the Log panel should confirm:

  • All test cases (TC1-TC5) pass.
  • Final status: Simulation ends with INFO: PASS.

More in Clock-Domain Crossing

All Clock-Domain Crossing blocks