Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #469

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

Added by Alex Solomatnikov over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
TranslationError
% Done:

0%


Description

Code snippet:

module a
# (
    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

History

#1 Updated by Alex Solomatnikov over 7 years ago

There is a workaround - inlining the function.

#2 Updated by Alex Solomatnikov over 7 years ago

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

#3 Updated by Wilson Snyder over 7 years ago

  • Status changed from New to AskedReporter

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 bug470.

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.)

#4 Updated by Alex Solomatnikov over 7 years ago

Indeed, after fix for bug470 this issue disappeared.

I will try to generate nodes later.

#5 Updated by Alex Solomatnikov over 7 years ago

I rolled back the fix for bug470 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.

#6 Updated by Wilson Snyder over 7 years ago

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 bug470 has fixed this.

#7 Updated by Alex Solomatnikov over 7 years ago

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

#8 Updated by Wilson Snyder over 7 years ago

  • Category set to TranslationError
  • Status changed from AskedReporter to Resolved
  • Assignee set to Wilson Snyder

Great, we'll mark this fixed with bug470.

#9 Updated by Wilson Snyder over 7 years ago

  • Status changed from Resolved to Closed

In 3.833.

Also available in: Atom