Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HW] Inner symbols dropped by InlineModules #6967

Open
uenoku opened this issue Apr 30, 2024 · 0 comments
Open

[HW] Inner symbols dropped by InlineModules #6967

uenoku opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working HW Involving the `hw` dialect

Comments

@uenoku
Copy link
Member

uenoku commented Apr 30, 2024

InlineModules pass currently strips inner symbols so it could break design.

$ cat test.mlir
  hw.hierpath @hier [@Foo::@bar, @Bar::@a]
  hw.module private @Bar(in %a : i1 {hw.exportPort = #hw<innerSym@a>}, out b : i1) {
    hw.output %a : i1
  }
  hw.module @Foo(in %a : i1, out b : i1) {
    %bar.b = hw.instance "bar" sym @bar @Bar(a: %a: i1) -> (b: i1)
    hw.output %bar.b : i1
  }

$ circt-opt test.mlir -hw-flatten-modules -hw-verify-irn
test.mlir:1:3: error: 'hw.hierpath' op  module: "Foo" does not contain any instance with symbol: "bar"
  hw.hierpath @hier [@Foo::@bar, @Bar::@a]  
  ^
test.mlir:1:3: note: see current operation: "hw.hierpath"() {namepath = [#hw.innerNameRef<@Foo::@bar>, #hw.innerN
@uenoku uenoku added bug Something isn't working HW Involving the `hw` dialect labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HW Involving the `hw` dialect
Projects
None yet
Development

No branches or pull requests

1 participant