llvm / llvm/circt

[FIRRTL] Verify that lowerToBind is never nested

Open
#5,530 3 comments 0 reactions 0 assignees View on GitHub
FIRRTL good first issue
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

If a circuit contains a bind-under-bind, then this can't be lowered to SystemVerilog without transformation. It would be simpler (for now) to make any nested bind a verifier error.

E.g., the following should be a verifier error:

```mlir
firrtl.circuit "Foo" {
firrtl.module @Baz() {}
firrtl.module @Bar() {
firrtl.instance baz {lowerToBind} @Baz()
}
firrtl.module @Foo() {
firrtl.instance bar {lowerToBind} @Bar()
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the FIRRTL verifier logic for instances marked lowerToBind and the handling of nested bind-under-bind cases. Use the provided MLIR example to check that the nested case is rejected as a verifier error, while a non-nested bind remains valid.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.