Skip to content

[ExportVerilog] Type scope emission in split outputs mode #2583

Open
@uenoku

Description

@uenoku

Currently type scopes are all copied to each output file:
For example this mlir, firtool -split-verilog creates two files "UseA.sv" and "UseB.sv".

hw.type_scope @scope_A  { hw.typedecl @T_A : i1 }
hw.module @UseA(%source: !hw.typealias<@scope_A::@T_A, i1>) {}
hw.type_scope @scope_B  { hw.typedecl @T_B : i1 }
hw.module @UseB(%source: !hw.typealias<@scope_B::@T_B, i1>) {}

Followings are current outputs.

  • UseA.sv
typedef logic T_A;
module UseA(    // hoge.mlir:2:1
  input T_A source);

endmodule

typedef logic T_B;
  • UseB.sv
typedef logic T_A;
typedef logic T_B;
module UseB(    // hoge.mlir:4:1
  input T_B source);

endmodule

It is better not to emit all type decls but emit subsets of types used by emitted module.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions