Skip to content

Confusing error message for "input reg" #1284

@shirriff

Description

@shirriff

If I use "input reg", the resulting error message claims that I declared the variable as a wire, when I declared it as a reg. This is confusing.

I ran iverilog on this code:

module foo(input reg i, output reg o);
  always @* begin
    i <= o;
  end
endmodule

It produces the error:

bad.v:3: error: 'i' is not a valid l-value for a procedural assignment.
bad.v:1:      : 'i' is declared here as a wire.
Elaboration failed

Expected behavior: I should get an error, but the error shouldn't claim that I declared the variable as a wire when I didn't. (Presumably, the message happens because the compiler changes the variable to a wire behind the scenes.)

I'm using Icarus Verilog version 13.0 (devel) (s20250103)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions