DescriptionQ1002
Q1002DesignGoogleASIC interview problem
Cross commands across independent resets
TechniquesDesignCDCRDCHandshake
DifficultyHard
TopicCDC and Reset
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
A source sends one-bit command events to an unrelated destination clock. Either domain may request reset independently; either request restarts both endpoints of this one logical channel. Traffic in flight may be discarded during reset, but after both domains advertise ready there must be no lost, duplicated, or ghost command. Implement a reset-safe request/acknowledge toggle protocol and enable sequence.
Starting declarationSystemVerilog
src_clk, src_rst_n, src_cmd_valid, src_cmd_ready
dst_clk, dst_rst_n, dst_cmd_pulse
src_ready_local, dst_ready_local
synchronized ready, request, and acknowledge togglesExample input and output
Use this case to check your interpretationInput
Both domains are active, then dst_rst_n falls while request and acknowledge differ; no new command is presented until recovery completesOutput
No pulse is emitted during recovery; after both ready signals return, one newly accepted command produces exactly one destination pulseExplanation
The destination reset request asynchronously restarts both channel endpoints, so their toggles cannot straddle different epochs. Each side then releases on its own clock and completes the low/high ready rendezvous before a mismatch may represent a command.
02
Requirements (4)
- Form protocol_rst_n=src_rst_n&&dst_rst_n. Assert this channel reset asynchronously into both endpoints, release it synchronously in each clock domain, and drive both local-ready outputs low; either raw reset therefore starts one shared disabled epoch and discards any in-flight command.
- Allow a source command only when both ready indications are high and request equals synchronized acknowledge; toggle request exactly once on acceptance.
- The destination emits one pulse when synchronized request differs from acknowledge, then copies request into acknowledge.
- During a disabled epoch accept no command, suppress pulses, re-baseline acknowledge to request, and resume only after the destination-then-source low-observation and ready handshake completes.
