Skip to content

[ExportVerilog] Omit bitwidth of constant array index #2593

Open
@uenoku

Description

@uenoku
hw.module @Foo(%a: !hw.array<1xi1>) -> (b: i1) {
  %false = hw.constant false
  %0 = hw.array_get %a[%false] : !hw.array<1xi1>
  hw.output %0 : i1
}
module Foo(	// foo.fir:2:10
  input  [0:0] a,
  output       b);

  assign b = a[1'h0];	// foo.fir:2:10, :5:12
endmodule

I'm not 100% sure it is always legal but can't we just emit assign b = a[0] ?

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