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

Internal Error: ../V3Width.cpp:1201: Unlinked #469

Closed
veripoolbot opened this issue Mar 23, 2012 · 9 comments
Closed

Internal Error: ../V3Width.cpp:1201: Unlinked #469

veripoolbot opened this issue Mar 23, 2012 · 9 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Alex Solomatnikov
Original Redmine Issue: 469 from https://www.veripool.org
Original Date: 2012-03-23
Original Assignee: Wilson Snyder (@wsnyder)


Code snippet:

module a
1. (
     parameter
         CFG_BUFFER_ADDR_WIDTH         =   6
)
...

     // -----------------------------
     // local parameter declarations
     // -----------------------------

     localparam CTL_BUFFER_DEPTH             =   two_pow_N(CFG_BUFFER_ADDR_WIDTH);
...


     function integer two_pow_N;
         input integer value;
     begin
         two_pow_N = 2 << (value-1);
     end
     endfunction



endmodule

error on localparam line:

%Error: Internal Error: ...: ../V3Width.cpp:1201: Unlinked

Unfortunately, it does not happen when I am trying to compile only this single module, only during compile of large piece of RTL

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-03-23T21:48:33Z


There is a workaround - inlining the function.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-03-23T23:43:41Z


Last message was incorrect - there is no "Can't find definition" error.

I ran under gdb and got backtrace just before error:

Breakpoint 1, WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1829bb0, vup=0x7fffffff6480) at ../V3Width.cpp:1201
1201		if (!nodep->taskp()) nodep->v3fatalSrc("Unlinked");
(gdb) bt
#0  WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1829bb0, vup=0x7fffffff6480) at ../V3Width.cpp:1201
#1  0x0000000000632250 in WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1829bb0, vup=0x7fffffff6480) at ../V3Width.cpp:1194
#2  0x000000000042cf43 in AstFuncRef::accept (this=0x1829bb0, v=..., vup=0x7fffffff6480) at ../V3AstNodes.h:1242
#3  0x0000000000488b3b in AstNode::iterateAndNext (this=0x1829bb0, v=..., vup=0x7fffffff6480) at ../V3Ast.cpp:775
#4  0x000000000062e2a4 in WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1823d50, vup=0x7fffffff6630) at ../V3Width.cpp:707
#5  0x0000000000491fb3 in AstVar::accept (this=0x1823d50, v=..., vup=0x7fffffff6630) at ../V3AstNodes.h:674
#6  0x0000000000489072 in AstNode::acceptSubtreeReturnEdits (this=0x1823d50, v=..., vup=0x7fffffff6630) at ../V3Ast.cpp:846
#7  0x0000000000638d79 in WidthVisitor::mainAcceptEdit (this=0x7fffffff6660, nodep=0x1823d50) at ../V3Width.cpp:1974
#8  0x0000000000624953 in V3Width::widthParamsEdit (nodep=0x1823d50) at ../V3Width.cpp:1995
#9  0x00000000004b655b in V3Const::constifyParamsEdit (nodep=0x1823d50) at ../V3Const.cpp:1994
#10 0x00000000005d45a2 in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0x1823d50) at ../V3Param.cpp:137
#11 0x0000000000491fb3 in AstVar::accept (this=0x1823d50, v=..., vup=0x0) at ../V3AstNodes.h:674
#12 0x0000000000488b3b in AstNode::iterateAndNext (this=0x182a460, v=..., vup=0x0) at ../V3Ast.cpp:775
#13 0x00000000004889b5 in AstNode::iterateChildren (this=0x1825eb0, v=..., vup=0x0) at ../V3Ast.cpp:757
#14 0x00000000005d449d in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0x1825eb0) at ../V3Param.cpp:127
#15 0x0000000000477aaf in AstNVisitor::visit (this=0x7fffffff6a80, nodep=0x1825eb0, vup=0x0) at ./V3Ast__gen_visitor.h:117
#16 0x000000000042b3a9 in AstModule::accept (this=0x1825eb0, v=..., vup=0x0) at ../V3AstNodes.h:1012
#17 0x0000000000488b3b in AstNode::iterateAndNext (this=0x53e5630, v=..., vup=0x0) at ../V3Ast.cpp:775
#18 0x000000000048898d in AstNode::iterateChildren (this=0xaaebc0, v=..., vup=0x0) at ../V3Ast.cpp:756
#19 0x00000000005d43c6 in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0xaaebc0) at ../V3Param.cpp:123
#20 0x00000000004759ad in AstNetlist::accept (this=0xaaebc0, v=..., vup=0x0) at ../V3AstNodes.h:4134
#21 0x00000000005d5017 in ParamVisitor::ParamVisitor (this=0x7fffffff6a80, nodep=0xaaebc0) at ../V3Param.cpp:248
#22 0x00000000005d3cd8 in V3Param::param (rootp=0xaaebc0) at ../V3Param.cpp:387
#23 0x000000000046ee2f in process () at ../Verilator.cpp:177
#24 0x0000000000474692 in main (argc=204, argv=0x7fffffff78e8, env=0x7fffffff7f50) at ../Verilator.cpp:672

(gdb) n
%Error: Internal Error: ...:49: ../V3Width.cpp:1201: Unlinked
-node: 0x1829bb0
%Error: Internal Error: See the manual and http://www.veripool.org/verilator for more assistance.
- V3StatsReport.cpp:208:statsReport: 
%Error: Internal Error: Aborting since under --debug

Program received signal SIGABRT, Aborted.
0x00002aaaaaf7d285 in raise () from /lib64/libc.so.6

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-24T14:30:09Z


The unlinked error means the earlier link stage messed up and missed processing this node (the function). It's likely related to some parameterization issue, perhaps even connected to #�.

If you're using the git version, use --dump-treei 9. The last obj/*.tree file it makes should have this node number (0x1829bb0 from the backtrace) listed. Please send this node, plus each parent of that node (for example 1:2:1:2 VAR 0x1829bb0, also send the 1:2:1 above, and 1:2 above. 1: above will be the NETLIST.)

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-03-25T00:31:29Z


Indeed, after fix for #� this issue disappeared.

I will try to generate nodes later.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-04-01T03:09:30Z


I rolled back the fix for #� and re-produced this issue:

#0  WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1829c70, vup=0x7fffffff6480) at ../V3Width.cpp:1201
#1  0x0000000000632250 in WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1829c70, vup=0x7fffffff6480) at ../V3Width.cpp:1194
#2  0x000000000042cf43 in AstFuncRef::accept (this=0x1829c70, v=..., vup=0x7fffffff6480) at ../V3AstNodes.h:1242
#3  0x0000000000488b3b in AstNode::iterateAndNext (this=0x1829c70, v=..., vup=0x7fffffff6480) at ../V3Ast.cpp:775
#4  0x000000000062e2a4 in WidthVisitor::visit (this=0x7fffffff6660, nodep=0x1823e10, vup=0x7fffffff6630) at ../V3Width.cpp:707
#5  0x0000000000491fb3 in AstVar::accept (this=0x1823e10, v=..., vup=0x7fffffff6630) at ../V3AstNodes.h:674
#6  0x0000000000489072 in AstNode::acceptSubtreeReturnEdits (this=0x1823e10, v=..., vup=0x7fffffff6630) at ../V3Ast.cpp:846
#7  0x0000000000638d79 in WidthVisitor::mainAcceptEdit (this=0x7fffffff6660, nodep=0x1823e10) at ../V3Width.cpp:1974
#8  0x0000000000624953 in V3Width::widthParamsEdit (nodep=0x1823e10) at ../V3Width.cpp:1995
#9  0x00000000004b655b in V3Const::constifyParamsEdit (nodep=0x1823e10) at ../V3Const.cpp:1994
#10 0x00000000005d45a2 in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0x1823e10) at ../V3Param.cpp:137
#11 0x0000000000491fb3 in AstVar::accept (this=0x1823e10, v=..., vup=0x0) at ../V3AstNodes.h:674
#12 0x0000000000488b3b in AstNode::iterateAndNext (this=0x182a520, v=..., vup=0x0) at ../V3Ast.cpp:775
#13 0x00000000004889b5 in AstNode::iterateChildren (this=0x1825f70, v=..., vup=0x0) at ../V3Ast.cpp:757
#14 0x00000000005d449d in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0x1825f70) at ../V3Param.cpp:127
#15 0x0000000000477aaf in AstNVisitor::visit (this=0x7fffffff6a80, nodep=0x1825f70, vup=0x0) at ./V3Ast__gen_visitor.h:117
#16 0x000000000042b3a9 in AstModule::accept (this=0x1825f70, v=..., vup=0x0) at ../V3AstNodes.h:1012
#17 0x0000000000488b3b in AstNode::iterateAndNext (this=0x53e5940, v=..., vup=0x0) at ../V3Ast.cpp:775
#18 0x000000000048898d in AstNode::iterateChildren (this=0xaaebc0, v=..., vup=0x0) at ../V3Ast.cpp:756
#19 0x00000000005d43c6 in ParamVisitor::visit (this=0x7fffffff6a80, nodep=0xaaebc0) at ../V3Param.cpp:123
#20 0x00000000004759ad in AstNetlist::accept (this=0xaaebc0, v=..., vup=0x0) at ../V3AstNodes.h:4134
#21 0x00000000005d5017 in ParamVisitor::ParamVisitor (this=0x7fffffff6a80, nodep=0xaaebc0) at ../V3Param.cpp:248
#22 0x00000000005d3cd8 in V3Param::param (rootp=0xaaebc0) at ../V3Param.cpp:387
#23 0x000000000046ee2f in process () at ../Verilator.cpp:177
#24 0x0000000000474692 in main (argc=205, argv=0x7fffffff78e8, env=0x7fffffff7f58) at ../Verilator.cpp:672

Beginning of tree file:

Tree Dump from <e1018565> to <e1019176>
      NETLIST 0xaaebc0 <e1> {a0} w0
     1: MODULE 0x53e5940 <e487901> {gf6} w0  ddr3_ctlr_m0_q11_1sp2  L2
     1:2: VAR 0x53e6c80 <e486967> {gf7} w0  pll_ref_clk [I] INPUT

The part of tree file you asked about (if I understood it correctly):

grep -n -B6 0x1829c70 Vddr3_ctlr_m0_q11_1sp2_99_final.tree
3300-    1: MODULE 0x1825f70 <e488126> {r14} w0  alt_mem_ddrx_buffer_manager  L3
3301-    1:2: VAR 0x182a520 <e88184> {r17} swu32/3  CFG_BUFFER_ADDR_WIDTH GPARAM
3302-    1:2:1: BASICDTYPE 0x68e45e0 <e1019174#> {r17} sw32  logic kwd=logic range=[31:0] [IMPLICIT]
3303-    1:2:3: CONST 0x18240d0 <e88187> {r17} swu32/3  ?32?sh6
3304-    1:2: VAR 0x1823e10 <e88869> {r49} w0  CTL_BUFFER_DEPTH LPARAM
3305-    1:2:1: BASICDTYPE 0x1823d50 <e88215> {r49} w1  logic kwd=logic [IMPLICIT]
3306:    1:2:3: FUNCREF 0x1829c70 <e88224> {r49} w0  two_pow_N -> UNLINKED

Please, let me know if you need anything else. I have all files saved but tarball is large - 19 MB.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-04-01T11:39:31Z


When you run with "--debugi-V3LinkDot 9" do you get a message:

Dead module for 0x1825f70   (e.g. the MODULE from above - note the number might now be different).

If so I believe that #� has fixed this.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2012-04-02T05:05:17Z


Yes, I got:

- V3LinkDot.cpp:608:    MODULE 0x1824b90 <e488126> {r14} w0  alt_mem_ddrx_buffer_manager  L3
- V3LinkDot.cpp:610:  Dead module for MODULE 0x1824b90 <e488126> {r14} w0  alt_mem_ddrx_buffer_manager  L3

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-04-02T11:17:42Z


Great, we'll mark this fixed with #�.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-04-15T20:39:24Z


In 3.833.

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