llvm / llvm/circt

[ExportVerilog][SV] Emit an error for invalid symbol substitutions

Open
#6,286 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

```mlir
sv.verbatim "{{0}}" {symbols = [@Foo]}
```

Currently `circt-opt -export-verilog` doesn't raise an error even though `@Foo` doesn't exist. Ideally we should have a verifier to reject such IR in the first place (I guess there is on going work regarding SymbolUserInterface?) but at least we should cause a hard error at ExportVerilog.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the shown sv.verbatim IR and circt-opt -export-verilog. Trace the ExportVerilog handling of symbol substitutions and ensure an unresolved @Foo produces a hard error; the existing behavior should be covered by a regression test if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.