8000 Unlinked when getting bit width of type defined in parameterized class · Issue #4391 · verilator/verilator · GitHub
[go: up one dir, main page]

Skip to content
Unlinked when getting bit width of type defined in parameterized class #4391
@em2machine

Description

@em2machine
XXX@MacBook-Pro-8 tb % verilator --binary --timing -o intf_test intf_test.sv
%Error: Internal Error: intf_test.sv:28:22: ../V3Width.cpp:1804: Unlinked
                                          : ... In instance top
   28 |    xxx_class#(Cfg0)::cmd_tag_t tag, tag_q;
      |                      ^~~~~~~~~
                        ... See the manual at https://verilator.org/verilator_doc.html for more assistance.

Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)


package pf;
   typedef struct packed {
      int unsigned CcNumTl;
      int unsigned PqSize;
   } cfg_t;
endpackage

virtual class xxx_class #(parameter pf::cfg_t Cfg);
   typedef struct packed {
      logic [$clog2(Cfg.CcNumTl)-1:0] tl_index;
      logic [$clog2(Cfg.PqSize)-1:0] pq_index;
   } cmd_tag_t;
endclass

module mod2  #(parameter p_width=16) (
   output logic [p_width-1:0] q,
   input logic [p_width-1:0] d
);
   assign q = d;
endmodule

module top();
   localparam pf::cfg_t Cfg0 = '{
      CcNumTl:8
      ,PqSize:12
   };

   xxx_class#(Cfg0)::cmd_tag_t tag, tag_q;

   mod2 #($bits(tag)) t0(tag_q, tag);

   initial begin
      #100;
      $finish;
   end
endmodule

What 'verilator --version' are you using? Did you try it with the git master version?

XXX@MacBook-Pro-8 tb % verilator --version
Verilator 5.013 devel rev v5.012-68-g959387b69

What OS and distribution are you using?

XXX@MacBook-Pro-8 tb % uname -a
Darwin MacBook-Pro-8.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64

May we assist you in trying to fix this in Verilator yourself?

Unsure. Suspect related to #3441, #2783, #4256

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: elaborationIssue involves elaboration phasestatus: readyIssue is ready for someone to fix; then goes to 'status: assigned'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0