Skip to content

parameter string cannot be referenced in parameter-override expressions #1442

Open

Description

@matx-amy

two cases: passing it down unmodified, and passing a concatenation both fail

unmodified:

// t2_passdown.v
module child;
  parameter string memName = "";
  initial $display("child memName=%s", memName);
endmodule
module mid;
  parameter string memName = "";
  child #(.memName(memName)) c();
endmodule
module top;
  mid #(.memName("foo")) m();
endmodule
$ iverilog -g2009 -o /dev/null t2_passdown.v
t2_passdown.v:7: error: Unable to bind variable `memName' in `top.m'
1 error(s) during elaboration.

concat:

// t3_concat.v
module child;
  parameter string memName = "";
  initial $display("child memName=%s", memName);
endmodule
module top;
  parameter string memName = "m";
  child #(.memName({memName, "_", "0"})) c();
endmodule
$ iverilog -g2009 -o /dev/null t3_concat.v
t3_concat.v:7: internal error: I don't know how to elaborate(ivl_type_t) this expression: {memName, "_", "0"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions