Skip to content

[circt-bmc] Add multi-clock BMC support via independent toggling#9803

Draft
robert-at-pretension-io wants to merge 3 commits intollvm:mainfrom
robert-at-pretension-io:robert/bmc-multi-clock
Draft

[circt-bmc] Add multi-clock BMC support via independent toggling#9803
robert-at-pretension-io wants to merge 3 commits intollvm:mainfrom
robert-at-pretension-io:robert/bmc-multi-clock

Conversation

@robert-at-pretension-io
Copy link

This PR removes the single-clock restriction from circt-bmc to enable the formal verification of Clock Domain Crossing (CDC) logic.

Per feedback on previous PR #9729, this implements a mathematically rigorous asynchronous model:

  1. Metadata Tracking: Introduces verif.clocked_by during ExternalizeRegisters to associate
    externalized registers with their specific driving clocks, preventing the loss of clock relationships in
    the SSA graph.
  2. Independent Toggling: Updates LowerToBMC to XOR the clocks with a verif.symbolic_value at
    each step. This forces the SMT solver to explore all possible asynchronous clock drift interleavings
    rather than assuming lockstep behavior.
  3. SMT Emission: Updates VerifToSMT to parse the metadata and generate strict If-Then-Else
    logic, ensuring registers only update state when their specific clock domain experiences a posedge.

Remove the single-clock restriction from ExternalizeRegisters and add
support for verifying designs with multiple independent clock domains.

- Add verif.clocked_by op to associate externalized registers with their
  clock, preserving clock-register relationships through the pipeline.
- LowerToBMC generates per-clock init/loop regions; each clock toggles
  independently via verif.symbolic_value, allowing the SMT solver to
  explore all asynchronous interleavings.
- Update VerifToSMT to use per-register posedge detection based on the
  clock mapping from verif.clocked_by, replacing the single-clock
  assumption.
Add detailed inline documentation explaining:
1. Why symbolic values are used to non-deterministically toggle clocks in LowerToBMC.
2. Why the auxiliary verif.clocked_by ops must be erased before SMT conversion.
3. How the If-Then-Else (ITE) logic enforces strict per-register posedge gating based on clock domain mapping.
@robert-at-pretension-io robert-at-pretension-io marked this pull request as draft March 2, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant