RTL Studio Open IDE

Clock-Domain Crossing

Toggle CDC with 8-bit Payload Hold

Clock Domain Crossing module that transfers an 8-bit payload using a synchronized toggle signal for handshaking.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Toggle CDC with 8-bit Payload Hold 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 OpenIP implements a robust Clock Domain Crossing (CDC) module designed to transfer an 8-bit payload between two asynchronous clock domains.

It utilizes a synchronized toggle handshake mechanism to ensure data integrity. The design guarantees that the payload remains stable at the destination until the source acknowledges receipt, preventing data loss during rapid toggles or clock domain mismatches.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Toggle CDC with 8-bit Payload Hold.
  2. Read the Verilog module in the editor. The catalog line for this block: Clock Domain Crossing module that transfers an 8-bit payload using a synchronized toggle signal for handshaking.
  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 module operates on a request-acknowledge handshake protocol:

  1. Source Side: The source captures the payload when a request toggle is detected. A double-flop synchronizer transfers the request signal to the destination clock domain safely.
  2. Handshake: The destination detects the synchronized toggle and asserts an acknowledge signal. Simultaneously, it latches the payload.
  3. Payload Hold: The source holds the payload valid until the destination's acknowledge signal is received. This ensures that if a new request occurs prematurely, the current data is not overwritten.

### Block Diagram

Interface

Signal NameDirectionWidthDescription
src_clkInput1Source clock domain
src_rst_nInput1Active-low reset for source
dst_clkInput1Destination clock domain
dst_rst_nInput1Active-low reset for destination
src_reqInput1Request signal to initiate transfer
src_payloadInput8Data payload to be transferred
dst_ackOutput1Acknowledge signal from destination
dst_payloadOutput8Received data payload

Verification

The provided testbench (tb/tb_toggle_payload_hold_8.v) verifies the following scenarios:

  1. Basic Transfer: Verifies single payload transfer with correct data integrity.
  2. Subsequent Transfers: Checks handling of different payload values in sequential transfers.
  3. Rapid Toggles: Ensures the design holds the first payload if a new request occurs before the previous one is acknowledged.

### Running the Simulation

To run the simulation, use your preferred Verilog simulator (e.g., Verilator, ModelSim, VCS). The testbench is located in tb/.

### Expected Results

  • TC1 PASS
  • TC2 PASS
  • TC3 PASS
  • INFO: PASS
Test CaseDescriptionResult
TC1Basic single payload transferPASS
TC2Second different payload transferPASS
TC3Payload hold during rapid togglesPASS

More in Clock-Domain Crossing

All Clock-Domain Crossing blocks