diff --git a/Changes b/Changes index b2392e09f..05de8d4da 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix isolate_assignments when many signals per always. [Mike Shinkarovsky] +**** Fix isolate_assignments across task temporaries. [Mike Shinkarovsky] + * Verilator 3.632 1/17/2007 *** Add /*verilator isolate_assignments*/ attribute. [Mike Shinkarovsky] diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 24b308ff3..a9019cbd6 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -382,6 +382,14 @@ private: //nodep->v3warn(GENCLK,"Signal unoptimizable: Generated clock: "<prettyName()); } else if (nodep->varp()->isSigPublic()) { nodep->v3warn(UNOPT,"Signal unoptimizable: Feedback to public clock or circular logic: "<prettyName()); + if (!nodep->fileline()->warnIsOff(V3ErrorCode::UNOPT)) { + nodep->fileline()->warnOff(V3ErrorCode::UNOPT, true); // Complain just once + // Give the user an example. + bool tempWeight = (edgep && edgep->weight()==0); + if (tempWeight) edgep->weight(1); // Else the below loop detect can't see the loop + m_graph.reportLoops(&OrderEdge::followComboConnected, vertexp); // calls OrderGraph::loopsVertexCb + if (tempWeight) edgep->weight(0); + } } else { // We don't use UNOPT, as there are lots of V2 places where it was needed, that aren't any more // First v3warn not inside warnIsOff so we can see the suppressions with --debug diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 14b2d1552..4409cf4f9 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -306,6 +306,7 @@ private: AstVar* newvarp = new AstVar (invarp->fileline(), AstVarType::BLOCKTEMP, name, invarp); newvarp->funcLocal(false); + newvarp->propagateAttrFrom(invarp); m_modp->addStmtp(newvarp); AstVarScope* newvscp = new AstVarScope (newvarp->fileline(), m_scopep, newvarp); m_scopep->addVarp(newvscp); @@ -628,7 +629,7 @@ private: if (!funcp) nodep->v3fatalSrc("unlinked"); // Inline func refs in the function iterateIntoFTask(funcp); - // Create output variabls + // Create output variable string namePrefix = "__Vfunc_"+funcp->shortName()+"__"+cvtToStr(m_modNCalls++); AstVarScope* outvscp = createVarScope (funcp->fvarp()->castVar(), namePrefix+"__out"); diff --git a/test_regress/t/t_unopt_combo.v b/test_regress/t/t_unopt_combo.v index 1c5abae61..948d10ed1 100644 --- a/test_regress/t/t_unopt_combo.v +++ b/test_regress/t/t_unopt_combo.v @@ -54,7 +54,7 @@ module t (/*AUTOARG*/ $write("*-* All Finished *-*\n"); $write("[%0t] cyc==%0d crc=%x %x\n",$time, cyc, crc, sum); if (crc !== 64'hc77bb9b3784ea091) $stop; - if (sum !== 64'he281f003f6dd16b2) $stop; + if (sum !== 64'h649ee1713d624dd9) $stop; $finish; end end @@ -90,15 +90,23 @@ module file (/*AUTOARG*/ d = {crc[15:0],~c[31:16]}; end default: begin - b = ~crc; - set_d(~c); // d = ~c; + set_b_d(crc, c); end endcase end - task set_d; - input [31:0] to; - d = to; + task set_b_d; +`ifdef ISOLATE + input [31:0] t_crc /* verilator isolate_assignments*/; + input [31:0] t_c /* verilator isolate_assignments*/; +`else + input [31:0] t_crc; + input [31:0] t_c; +`endif + begin + b = {t_crc[31:16],~t_crc[23:8]}; + d = {t_crc[31:16], ~t_c[23:8]}; + end endtask always @* begin diff --git a/test_regress/t/t_unopt_combo_isolate.pl b/test_regress/t/t_unopt_combo_isolate.pl index 4a45d8da2..d88c987f7 100755 --- a/test_regress/t/t_unopt_combo_isolate.pl +++ b/test_regress/t/t_unopt_combo_isolate.pl @@ -14,7 +14,7 @@ compile ( ); if ($Last_Self->{v3}) { - file_grep ($Last_Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+1/i); + file_grep ($Last_Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+3/i); } execute (