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

[FIRRTL] IMDCE: not removing all dead instances #7992

Open
youngar opened this issue Dec 13, 2024 · 0 comments
Open

[FIRRTL] IMDCE: not removing all dead instances #7992

youngar opened this issue Dec 13, 2024 · 0 comments
Labels
FIRRTL Involving the `firrtl` dialect

Comments

@youngar
Copy link
Member

youngar commented Dec 13, 2024

For the following test, I expect both instances m and p to be removed, but for some reason only p is removed:

circuit Foo:
  module Foo:
    input in : UInt<1>
    output out : UInt<1>
    output out2 : UInt<1>

    inst m of Child
    m.in <= in

    inst m2 of Child
    m2.in <= in
    out <= m2.out

    inst p of PassThrough
    p.in <= in

    inst p2 of PassThrough
    p2.in <= in
    out2 <= p2.out

  module PassThrough :
    input in : UInt<1>
    output out : UInt<1>
    out <= in

  module Child :
    input in : UInt<1>
    output out : UInt<1>
    inst output_chain of PassThrough
    output_chain.in <= in
    out <= output_chain.out

running with firtool imdce.fir gives:

// Generated by CIRCT firtool-1.42.0-60-g3093438b0
module Foo(
  input  in,
  output out,
         out2
);

  Child m (
    .in  (in),
    .out (/* unused */)
  );
  Child m2 (
    .in  (in),
    .out (out)
  );
  PassThrough p2 (
    .in  (in),
    .out (out2)
  );
endmodule

module PassThrough(
  input  in,
  output out
);

  assign out = in;
endmodule

module Child(
  input  in,
  output out
);

  PassThrough output_chain (
    .in  (in),
    .out (out)
  );
endmodule

This is a regression which was introduced in #5226.

@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

No branches or pull requests

1 participant