Skip to content

[LLHD] Preserve explicit register initializers through Deseq - #11081

Open
5iri wants to merge 2 commits into
llvm:mainfrom
5iri:codex/fix-bmc-register-initializers
Open

[LLHD] Preserve explicit register initializers through Deseq#11081
5iri wants to merge 2 commits into
llvm:mainfrom
5iri:codex/fix-bmc-register-initializers

Conversation

@5iri

@5iri 5iri commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This preserves explicit SystemVerilog register initializers when lowering LLHD processes to seq.firreg.

Before this change, the initializer reached llhd.sig, but was dropped when Deseq created the register. This left the initial BMC state unconstrained and could produce false counterexamples for initialized registers.

For example:

logic [3:0] count = 4'd0;
always_ff @(posedge clk)
  count <= count + 4'd1;

The resulting register now has preset 0, so BMC starts count at zero.

MooreToCore marks explicit declaration initializers so Deseq can distinguish them from the zero values synthesized for variables without an initializer. Only explicit constant initializers become register presets.

Adds regression coverage for zero and nonzero initializers, and for registers that must remain unconstrained.

Tested with check-circt and the initializer integration test.

Assisted-by: Codex:gpt-6

Carry explicit declaration initializers from MooreToCore to register presets
in Deseq. This prevents BMC from treating initialized registers as having an
unconstrained initial state without turning synthesized default zeros into
register presets.

Assisted-by: Codex:gpt-6
@circt-bot

circt-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

Results of circt-tests run for 8caeb14 compared to results for e7f97d4: no change to test results.

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