From d6a5c97f3a6a3b475d8ca04155a2757e6e2999bb Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 14 Jun 2007 18:34:08 +0000 Subject: [PATCH] Fix last change: percents must be literalized git-svn-id: file://localhost/svn/verilator/trunk/verilator@938 77ca24e4-aefa-0310-84f0-b9a241c72d87 --- Changes | 2 ++ src/V3Const.cpp | 8 +++++++- test_regress/t/t_display.pl | 2 +- test_regress/t/t_display.v | 2 +- test_regress/t/t_display_noopt.pl | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index ecc965ef4..8a79b4496 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Support V2K portlists with "input a,b,...". [Mark Nodine] +**** Optimize constant $display arguments. + **** Fix Preprocessor dropping some `line directives. [Mark Nodine] * Verilator 3.651 5/22/2007 diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 4cd82c195..6dba37125 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -972,7 +972,13 @@ private: if (argp && argp->castConst()) { // Convert it string out = argp->castConst()->num().displayed(fmt); UINFO(9," DispConst: "< "<unlinkFrBack()->deleteTree(); } argp=nextp; diff --git a/test_regress/t/t_display.pl b/test_regress/t/t_display.pl index 0982a817a..5689cac4f 100755 --- a/test_regress/t/t_display.pl +++ b/test_regress/t/t_display.pl @@ -24,7 +24,7 @@ execute ( [0] %x=00abc1234567812345678 %0x=abc1234567812345678 %o=012570110642547402215053170 %b=000001010101111000001001000110100010101100111100000010010001101000101011001111000 [0] %s=! %s= what! %s= hmmm!1234 -[0] hello, from a very long string. This gets substituted in. +[0] hello, from a very long string. Percent %s are literally substituted in. *-* All Finished *-* '), ); diff --git a/test_regress/t/t_display.v b/test_regress/t/t_display.v index 0b019c362..5679b6ebc 100644 --- a/test_regress/t/t_display.v +++ b/test_regress/t/t_display.v @@ -34,7 +34,7 @@ module t; str2[7:0], str2, str3); $display("[%0t] %s%s%s", $time, - "hel", "lo, fr", "om a very long string. This gets substituted in."); + "hel", "lo, fr", "om a very long string. Percent %s are literally substituted in."); // Str check `ifndef nc // NC-Verilog 5.3 chokes on this test diff --git a/test_regress/t/t_display_noopt.pl b/test_regress/t/t_display_noopt.pl index 55373ae46..f72857113 100755 --- a/test_regress/t/t_display_noopt.pl +++ b/test_regress/t/t_display_noopt.pl @@ -27,7 +27,7 @@ execute ( [0] %x=00abc1234567812345678 %0x=abc1234567812345678 %o=012570110642547402215053170 %b=000001010101111000001001000110100010101100111100000010010001101000101011001111000 [0] %s=! %s= what! %s= hmmm!1234 -[0] hello, from a very long string. This gets substituted in. +[0] hello, from a very long string. Percent %s are literally substituted in. *-* All Finished *-* '), );