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

Instantiating an interface inside a generate conditional causes internal error #998

Closed
veripoolbot opened this issue Nov 12, 2015 · 4 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Johan Bjork
Original Redmine Issue: 998 from https://www.veripool.org
Original Date: 2015-11-12
Original Assignee: Wilson Snyder (@wsnyder)


Testcase pushed to https://github.com/phb/verilator-dev/tree/gen_intf_symboltable.

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty.

interface intf
#(parameter PARAM = 0)
();
    logic val;
endinterface

module t1(intf mod_intf);
    initial begin
       $display("%d", mod_intf.val);
    end
endmodule

module t();
    generate 
       if(1) begin // : Test
          intf #(.PARAM(1)) my_intf;
          t1 t (.mod_intf(my_intf));
          initial begin
             $write("*-* All Finished *-*\n");
             $finish;
          end
       end
    endgenerate
endmodule

results in
%Error: Internal Error: t/t_gen_named.v:20: ../V3LinkDot.cpp:1120: No symbol for interface cell: my_intf

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2015-11-12T05:21:02Z


So what happens here is that the Interface cell gets renamed to it's dotted name , but the IfaceRefDType cellname keeps the old, non-dotted name. Later on when V3LinkDot tries to find the cell it uses the wrong name and fails.
I'm guessing something needs to happen in LinkDotFindVisitor perhaps. Any ideas?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2015-11-13T17:25:03Z


Wilson,

Would you mind taking a quick look here and see if you have some ideas how this might best be fixed? I'm quite lost in what happens in the interaction of FindLinkDot and V3LinkDot and how this is supposed to work. Happy to do the patch but if you have some ideas it'd be greatly appreciated.

thanks
/Johan

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-11-14T14:08:14Z


Fixed in git towards 3.890.

Backtracing the rename, in V3Begin it renames the interface. I added a visitor to correct the DType's name.

Then get a similar error

%Error: Internal Error: t/t_interface_gen5.v:23: ../V3LinkDot.cpp:1160: No symbol for interface alias rhs

Likewise the VarRef needed a visitor in V3Begin to correct it.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-12-19T15:33:09Z


In 3.880.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants