Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrstrike007 opened this issue Nov 26, 2024 · 1 comment
Open

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

mrstrike007 opened this issue Nov 26, 2024 · 1 comment
Labels
status: ready Issue is ready for someone to fix; then goes to 'status: assigned'

Comments

@mrstrike007
Copy link

mrstrike007 commented Nov 26, 2024

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.

@mrstrike007 mrstrike007 added the new New issue not seen by maintainers label Nov 26, 2024
@wsnyder wsnyder added status: ready Issue is ready for someone to fix; then goes to 'status: assigned' and removed new New issue not seen by maintainers labels Nov 27, 2024
@wsnyder
Copy link
Member

wsnyder commented Nov 27, 2024

The first problem here is that V3Param thinks a Void data type matches the mailbox. Bypassing that there's a problem with hashing these nodes, then bypassing that there's a SIDEEFFECT problem in the std:: package to fix.

Will need to get back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready Issue is ready for someone to fix; then goes to 'status: assigned'
Projects
None yet
Development

No branches or pull requests

2 participants