Skip to content

Unpacked 2-D Array Not Supported as Mailbox Type #5632

@mrstrike007

Description

@mrstrike007

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

`timescale 1ns / 1ps

class genericClass;

    localparam DWIDTH = 6;

    typedef int my_type_t [2**DWIDTH];

    mailbox #(my_type_t) foo_mbx;

    function new();
        this.foo_mbx = new(1);
    endfunction

endclass

module tb_top();

    genericClass genCls;

    initial begin
        genCls = new();

        $finish();
    end

endmodule
The error shows the following:

- V3LinkCells.cpp:210:Link --top-module: MODULE 0x1083460 <e923#> {d17ai} u1=0x1085530 u4=0x1083580  tb_top  L0 [1ns]
- V3LinkLevel.cpp:42: modSortByLevel()
- V3Ast.cpp:1323:     Dumping obj_dir/Vtb_top_001_cells.tree
- V3LinkDot.cpp:4179: linkDotPrimary:
- V3LinkJump.cpp:375: linkJump:
- V3Ast.cpp:1323:     Dumping obj_dir/Vtb_top_006_linkjump.tree
- V3LinkInc.cpp:306:  linkIncrements:
- V3Ast.cpp:1323:     Dumping obj_dir/Vtb_top_007_linkinc.tree
- V3Param.cpp:1517:   param:
%Error: tb_top.sv:9:5: Missing type parameter: 'T'
                     : ... note: In instance 'tb_top'
-node: CLASSREFDTYPE 0x108a690 <e1331> {d9af} @dt=this@(w0)class:mailbox  mailbox cpkg=0x105c6c0 -> CLASS 0x105c6c0 <e9> {c29ae} u3=0x108e9a0  mailbox  L5 [1ns]
    9 |     mailbox #(my_type_t) foo_mbx;
      |     ^~~~~~~

Please note that when changing the typedef to a packed 2D array of type logic the code compiles.

What 'verilator' command line do we use to run your example?

verilator --top-module tb_top --debug --binary --assert -Wall -Wno-fatal --timescale 1ns/1ps --trace --trace-structs ./tb_top.sv

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

Verilator 5.030 2024-10-27 rev v5.030-45-g2cb1a8de7

What OS and distribution are you using?

Fedora

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

Yes.

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