From bd264006efcf3dc793e565d1e5b134cd16a57e83 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 27 Feb 2007 14:30:22 +0000 Subject: [PATCH] Fix empty for blocks git-svn-id: file://localhost/svn/verilator/trunk/verilator@888 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- Changes | 14 +++++++++----- src/V3Unroll.cpp | 7 ++++++- test_regress/t/t_unroll_signed.v | 11 +++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index a4ea1bf94..f0afd53fc 100644 --- a/Changes +++ b/Changes @@ -3,11 +3,15 @@ Revision history for Verilator The contributors that suggested a given feature are shown in []. [by ...] indicates the contributor was also the author of the fix; Thanks! +* Verilator 3.63** + +**** Fix internal error when public for loop has empty body. [David Addison] + * Verilator 3.633 2/7/2007 *** Add --trace-depth option for minimizing VCD file size. [Emerson Suguimoto] -*** With VL_DEBUG, show wires causing convergance errors. [Mike Shinkarovsky] +*** With VL_DEBUG, show wires causing convergence errors. [Mike Shinkarovsky] **** Fix isolate_assignments when many signals per always. [Mike Shinkarovsky] @@ -95,7 +99,7 @@ indicates the contributor was also the author of the fix; Thanks! **** Removed coverage request variable; see Coverage limitations in docs. -**** Fix DOS carrage returns in multiline defines. [Ralf Karge] +**** Fix DOS carriage returns in multiline defines. [Ralf Karge] **** Fix printf format warnings on 64-bit linux. @@ -107,7 +111,7 @@ indicates the contributor was also the author of the fix; Thanks! *** Added --inhibit-sim flag for environments using old __Vm_inhibitSim. -*** Added `systemc_dtor for destructor extentions. [Allan Cochrane] +*** Added `systemc_dtor for destructor extensions. [Allan Cochrane] *** Added -MP to make phony dependencies, ala GCC's. @@ -142,7 +146,7 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix extraneous UNSIGNED warning when comparing genvars. [David Hewson] -**** Fix extra whitespace in $display %c. [by David Addison] +**** Fix extra white space in $display %c. [by David Addison] **** vl_finish and vl_fatal now print via VL_PRINTF rather then cerr/cout. @@ -245,7 +249,7 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix functions where regs are declared before inputs. [Danny Ding] -**** Fix bad deep expressions with bitselects and rotate. [Prabhat Gupta] +**** Fix bad deep expressions with bit-selects and rotate. [Prabhat Gupta] * Verilator 3.500 10/30/2005 Stable diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index 644519f54..122b32572 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -252,7 +252,12 @@ private: if (clonedIncsp) { // Previous iteration of loop set the variable. // This set is redundant with this next iteration and can be removed. - clonedIncsp->unlinkFrBack()->deleteTree(); + if (clonedIncsp == newbodysp) { // Increment was only thing in list + newbodysp = NULL; + } else { + clonedIncsp->unlinkFrBack(); + } + clonedIncsp->deleteTree(); } clonedIncsp = incp->clonep(); if (!clonedIncsp) nodep->v3fatalSrc("inc failed"); } diff --git a/test_regress/t/t_unroll_signed.v b/test_regress/t/t_unroll_signed.v index 9f3a379b9..04ff3dd9c 100644 --- a/test_regress/t/t_unroll_signed.v +++ b/test_regress/t/t_unroll_signed.v @@ -11,6 +11,17 @@ module t (/*AUTOARG*/ input clk; + // Check empty blocks + task EmptyFor; + /* verilator public */ + integer i; + begin + for (i = 0; i < 2; i = i+1) + begin + end + end + endtask + // Check look unroller reg signed signed_tests_only = 1'sb1; integer total;