google / google/xls

[DSLX] `assert!` and `fail!` labels can clash in generated verilog (leading to e.g. elab warnings)

Open
#1,937 0 comments 0 reactions 0 assignees View on GitHub
dslx
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

**Describe the bug**
If you use the same label for a `fail!` and an `assert!` they can clash as asserted property labels in the generated sv, which can lead to things like elab warnings, where we probably want to give an early error.

**To Reproduce**
assert!(something, "my_name");
fail!("my_name", default_value);

**Expected behavior**
Probably flagging that the label is being reused in the function scope.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.