[ImportVerilog] Look through labels on module-level concurrent assertions#10796
Open
AmurG wants to merge 1 commit into
Open
[ImportVerilog] Look through labels on module-level concurrent assertions#10796AmurG wants to merge 1 commit into
AmurG wants to merge 1 commit into
Conversation
…ions A statement label on a module-level concurrent assertion (`CHK: assert property (p);` -- the ubiquitous verification-IP checker idiom) wraps the assertion in a single-statement block, which defeats the module-scope conversion short-circuit: the labeled assertion converts inside a `moore.procedure always` while its unlabeled twin converts at module scope, so a label silently changes which lowering an assertion gets and module-scope consumers of the assertion ops never see labeled checkers. Our own builtins.sv test documents the artifact: its labeled sampled-value assertions are pinned inside procedure wrappers that their unlabeled equivalents would not get. Look through label blocks in the synthesized `always` wrapper so labeled and unlabeled assertions take the same path; for a body that reduces to a single concurrent assertion the two forms are equivalent (IEEE 1800-2017 16.14.6). Assertions in initial/final procedures keep one-attempt semantics and are deliberately NOT rerouted -- pinned in the new test. builtins.sv expectations updated: the sampled-value assertion checks lose their `moore.procedure always` wrappers (same op chains, now at module scope like their unlabeled forms). New test labeled-concurrent-assertions.sv pins labeled==unlabeled and the initial-block non-reroute. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A statement label on a module-level concurrent assertion wraps it in a single-statement block, which defeats the module-scope conversion short-circuit. On current main the labeled assertion converts inside a
moore.procedure alwayswhile its unlabeled twin converts at module scope, so a label silently changes which lowering an assertion gets:Labeled checkers are the norm in verification IP, and our own
builtins.svdocuments the artifact: its 19 labeled sampled-value assertions pinmoore.procedure alwayswrappers that their unlabeled equivalents would not get.Look through label blocks in the synthesized
alwayswrapper so labeled and unlabeled assertions take the same path; for a body that reduces to a single concurrent assertion the two forms are equivalent (IEEE 1800-2017 16.14.6). Assertions in initial/final procedures keep their one-attempt semantics and are deliberately not rerouted.Tested: new
labeled-concurrent-assertions.sv(labeled == unlabeled at module scope; initial-block form not rerouted);builtins.svexpectations updated to the module-scope form (same per-assertion op chains, each block anchored on itsltl.clock+verif.assert).Written with AI assistance; I've reviewed the diff and tests.