[circt-bmc] Preserve signal names before lowering#10075
[circt-bmc] Preserve signal names before lowering#10075ankit-cybertron wants to merge 1 commit intollvm:mainfrom
Conversation
TaoBi22
left a comment
There was a problem hiding this comment.
Thanks for looking at this! Could we add a test or two in test/Tools/circt-bmc/ to make sure this is working properly?
b153b5c to
13aa5cf
Compare
Thanks for the review! Added 2 tests in |
13aa5cf to
6a55d3f
Compare
TaoBi22
left a comment
There was a problem hiding this comment.
Thanks! This is looking good modulo some comments below.
While I think landing this makes sense for now as a first step, I wonder if the best way to handle module hierarchy would actually be to add another pass to the circt-bmc pipeline that adds the dbg.variable ops to every module. Then these changes in LowerToBMC could just be to make sure those ops get carried across (not even sure that wouldn't just happen automatically). Not a blocker on this, just a thought!
That sounds like a really interesting direction -- I can definitely try exploring that as well. Not sure if something like this will work for circt-bmc at this stage, but happy to look into it |
TaoBi22
left a comment
There was a problem hiding this comment.
Thanks! LGTM modulo a couple of nits - let me know if you need me to hit merge once these are addressed.
| #include "circt/Dialect/Seq/SeqOps.h" | ||
| #include "circt/Dialect/Seq/SeqTypes.h" | ||
| #include "circt/Dialect/Verif/VerifOps.h" | ||
|
|
| // RUN: circt-opt --lower-to-bmc="top-module=Passthrough bound=2" %s | FileCheck %s --check-prefix=PASSTHROUGH | ||
|
|
||
| // SIMPLE: dbg.scope "Simple" | ||
| // SIMPLE-DAG: dbg.variable "in", %[[VAL:.*]] scope %{{.*}} : i8 |
There was a problem hiding this comment.
Can we check this is actually using the right value, as opposed to just matching anything for VAL? Also is there a reason for not matching the specific scope?
|
Ah looks like the CI is failing on this - we probably need some kind of placeholder to discard dbg ops for now further down the pipeline. |
This patch adds
dbg.scopeanddbg.variableops inLowerToBMCto preserve hardware signal names beforehwModule->erase()discards them.This is needed to support counter-example generation -- without preserving names here, there is no way to produce human-readable waveform output when the solver finds a violation.