llvm / llvm/circt

[FIRRTL] Missing Verifier that External Modules have Unique Names

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

Description

Consider the following:

``` mlir
firrtl.circuit "Foo" {
firrtl.extmodule @Foo(
in a: !firrtl.uint<1>,
out a: !firrtl.uint<1>
)
}
```

This isn't tripping any verifier error:

``` console
# circt-opt Foo.reduced.0.mlir
module {
firrtl.circuit "Foo" {
firrtl.extmodule @Foo(in a: !firrtl.uint<1>, out a: !firrtl.uint<1>)
}
}
```

Apparently, this is only being checked in the parser:

``` console
# circt-translate -export-firrtl Foo.reduced.0.mlir | firtool -parse-only -format=fir
:5:12: error: redefinition of name 'a'
output a : UInt<1> @[Foo.reduced.0.mlir 4:9]
^
:4:11: note: previous definition here
input a : UInt<1> @[Foo.reduced.0.mlir 3:8]
^
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the FIRRTL verifier path exercised by circt-opt and compare it with the export path used by circt-translate. Reproduce the duplicate input/output name example; done means verifier diagnostics reject external modules with non-unique names before export.

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.