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] Moved and renamed arc/inlineModules to hw/flattenModules #6964

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

dobios
Copy link
Member

@dobios dobios commented Apr 29, 2024

This PR moves the arc::inlineModulesPass to the HW dialect, all while renaming it to something more suitable for what it actually does, as per @fabianschuiki 's recommendation.

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring looks great to me! InlineModules pass currently doesn't handle inner symbols so can we open a tracking issue?

$ 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.innerNameRef<@Bar::@a>], sym_name = "hier"} : () -> ()

include/circt/Dialect/HW/Passes.td Outdated Show resolved Hide resolved
tools/arcilator/arcilator.cpp Outdated Show resolved Hide resolved
@dobios dobios merged commit 6ce4438 into main Apr 29, 2024
4 checks passed
@dobios dobios deleted the dev/dobios/move-inline-modules-pass branch April 29, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants