Repository navigation
Conversation
Validate both literal labels at their argument spans and register them in a shared function scope. Track source locations so a speculative parse can revisit one assertion without reporting a duplicate. Update existing DSLX callers, examples, and parser coverage for the common contract.
ericastor
reviewed
Nov 23, 2026
| } | ||
| } else { | ||
| // A parenthesized specialization such as (assert!<N>)(...) puts a | ||
| // FunctionRef in the callee position, bypassing the direct builtin call. |
Contributor
There was a problem hiding this comment.
It'd be nice if we could handle this correctly, but agreed.
ericastor
approved these changes
Nov 23, 2026
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 23, 2026
… fail! Upstream-head: 6c237a0
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
… fail! Upstream-head: 6c237a0
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
… fail! Upstream-head: 6c237a0
cdleary
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Nov 24, 2026
… fail! Upstream-head: 6c237a0
This branch has not been deployed
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.
DSLX introduced
assert!(ok, label)as shorthand for taking afail!(label, ())path whenokis false. Both lower to the same IR assertion. The parser already checked labels onfail!calls. Original changePreviously,
assert!(ok, "bad input")could pass DSLX interpreter tests and IR verification, then fail in default SystemVerilog codegen because the label becomes an assertion name. Two surviving assertions with the same label can also collide there. Plain Verilog codegen normally omits assertions, which explains why builds such as the Zstd RTL targets could succeed. Upstream reproductionApply the same label rule to both builtins during parsing. A label must be a string literal with identifier spelling and must be unique across both builtins in its enclosing function. Each lambda and each proc member function (
config,init, andnext) owns its own label scope. Diagnostics point at the offending argument. Recording its span allows speculative parsing to revisit one assertion without treating it as a duplicate.This tightens source compatibility for
assert!. For example, a constant byte array spelling a legal RTL name, such as[u8:111, u8:107], must now be written as"ok". The change updates affected callers and documents the shared rules. Direct calls with explicit parametrics retain the same checks, and an unsupported parenthesized specialization now produces a parser diagnostic.Validation
//xls/...sweep passed. The selection excludescontrib,dev_tools,visualization, and five test targets that require OpenROAD, Yosys, or Clang.git diff --checkpassed.