diff --git a/Changes b/Changes index 0a716ad72..60f0e4534 100644 --- a/Changes +++ b/Changes @@ -38,6 +38,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix false unused message on __Vemumtab, msg3180. [Tobias Rosenkranz] +**** Fix assertion on dotted parameter arrayed function, bug1620. [Rich Porter] + * Verilator 4.022 2019-11-10 diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 7d70fa169..3030dadad 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -1942,7 +1942,9 @@ private: // m_curSymp is symbol table of outer expression // m_ds.m_dotSymp is symbol table relative to "."'s above now UASSERT_OBJ(m_ds.m_dotSymp, nodep, "NULL lookup symbol table"); - UASSERT_OBJ(m_statep->forPrimary(), nodep, "ParseRefs should no longer exist"); + // Generally resolved during Primay, but might be at param time under AstUnlinkedRef + UASSERT_OBJ(m_statep->forPrimary() || m_statep->forPrearray(), + nodep, "ParseRefs should no longer exist"); DotStates lastStates = m_ds; bool start = (m_ds.m_dotPos == DP_NONE); // Save, as m_dotp will be changed if (start) { diff --git a/test_regress/t/t_func_dotted.v b/test_regress/t/t_func_dotted.v index df17433a9..4c985ea75 100644 --- a/test_regress/t/t_func_dotted.v +++ b/test_regress/t/t_func_dotted.v @@ -12,6 +12,9 @@ module t (/*AUTOARG*/ ma ma0 (); + initial t.ma0.u_b[0].f(1); + initial t.ma0.u_b[0].f(clk); + global_mod #(32'hf00d) global_cell (); global_mod #(32'hf22d) global_cell2 (); @@ -138,3 +141,13 @@ module mc (); mc.checkName (mc.getName(1'b0)); end endmodule + +module b; + + function void f(bit v); + $display("%m"); + endfunction : f; + +endmodule : b + +bind ma b u_b[0:1];