[circt-bmc] Add dbg.trace for BMC counterexample value tracking#10747
[circt-bmc] Add dbg.trace for BMC counterexample value tracking#107475iri wants to merge 1 commit into
Conversation
|
Results of circt-tests run for 4fb8df5 compared to results for 462fc74: sv-testsChanges in emitted diagnostics:
|
| }]; | ||
| } | ||
|
|
||
| def TraceOp : DebugOp<"trace"> { |
There was a problem hiding this comment.
I'm not totally sure having this in the debug dialect is the right move when it's very specific to BMC. Maybe the verif dialect would make more sense?
| let description = [{ | ||
| Records a named value at a specific step for later counterexample | ||
| materialization. This is intended as an internal bridge from the BMC flow | ||
| to the final runtime-backed text/VCD emission path. |
There was a problem hiding this comment.
I'm not sure the motivation for this op is entirely clear to me; what's the aim for its eventual lowering?
Would the aim be to lower this op to some call that reaches out to the BMCTrace runtime with a value and a cycle number? If that's the case then I'm not sure it's completely clear to me why we need a dedicated op for this instead of building this IR directly as we build the for loop that it sits in.
There was a problem hiding this comment.
The intended lowering is a later counterexample-materialization step that consumes dbg.trace(step, name, value) and lowers it to the BMC runtime trace path. I introduced a dedicated op to keep VerifToSMT backend-neutral instead of constructing runtime-specific IR directly in the loop body. You’re right that this isn’t clear from the current patch.
|
|
||
| return | ||
| } | ||
|
|
|
I think I split this too early. I introduced the IR marker at the pass boundary where the information is available, and added the erase pattern because SMTToZ3LLVM requires all debug ops to be legalized. But without the actual consumer, the motivation is under-explained. I’ll either fold the lowering into this PR or move the op to the follow-up where the consumer lands. |
This PR adds a new
dbg.traceoperation to record named runtime values at a specific step during BMC lowering, becausedbg.variableis good for describing named values, but it does not capture the "this value at this time step" information needed for counterexample tracing.AI Assisted by: codex:gpt-5.4(medium)