From cdd70ff8fcf01d3fdebc3670fa88b78b9ce89d30 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 24 Jun 2018 08:08:34 -0400 Subject: [PATCH 1/5] Commentary --- bin/verilator | 80 ++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/bin/verilator b/bin/verilator index 370122c80..a3c5ce590 100755 --- a/bin/verilator +++ b/bin/verilator @@ -4147,7 +4147,7 @@ When possible, please instead report bugs to L. Wilson Snyder -Major concepts by Paul Wasson, Duane Galbi and Jie Xu. +Major concepts by Paul Wasson, Duane Galbi, John Coiner and Jie Xu. =head1 CONTRIBUTORS @@ -4171,50 +4171,52 @@ Some of the people who have provided ideas and feedback for Verilator include: Ahmed El-Mahmoudy, David Addison, Tariq B. Ahmad, Nikana Anastasiadis, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Sharad Bagri, Andrew Bardsley, Matthew Barr, Geoff Barrett, Julius Baxter, Jeremy -Bennett, Michael Berman, David Binderman, Johan Bjork, David Black, Daniel -Bone, Gregg Bouchard, Christopher Boumenot, Nick Bowler, Byron Bradley, -Bryan Brady, Charlie Brej, J Briquet, Lane Brooks, John Brownlee, Jeff -Bush, Lawrence Butcher, Ted Campbell, Chris Candler, Lauren Carlson, Donal -Casey, Terry Chen, Enzo Chi, Robert A. Clark, Allan Cochrane, John Coiner, -Gunter Dannoritzer, Ashutosh Das, Bernard Deadman, John Demme, Mike Denio, -John Deroo, Philip Derrick, John Dickol, Ruben Diez, Danny Ding, Ivan -Djordjevic, Jonathon Donaldson, Sebastian Dressler, Alex Duller, Jeff -Dutton, Usuario Eda, Chandan Egbert, Joe Eiler, Ahmed El-Mahmoudy, Robert +Bennett, Michael Berman, Victor Besyakov, David Binderman, Johan Bjork, +David Black, Tymoteusz Blazejczyk, Daniel Bone, Gregg Bouchard, Christopher +Boumenot, Nick Bowler, Byron Bradley, Bryan Brady, Charlie Brej, J Briquet, +Lane Brooks, John Brownlee, Jeff Bush, Lawrence Butcher, Ted Campbell, +Chris Candler, Lauren Carlson, Donal Casey, Terry Chen, Enzo Chi, Robert +A. Clark, Allan Cochrane, John Coiner, Laurens van Dam, Gunter Dannoritzer, +Ashutosh Das, Bernard Deadman, John Demme, Mike Denio, John Deroo, Philip +Derrick, Joe DErrico, John Dickol, Ruben Diez, Danny Ding, Ivan Djordjevic, +Jonathon Donaldson, Sebastian Dressler, Alex Duller, Jeff Dutton, Usuario +Eda, Chandan Egbert, Joe Eiler, Ahmed El-Mahmoudy, Trevor Elbourne, Robert Farrell, Eugen Fekete, Fabrizio Ferrandi, Brian Flachs, Andrea Foletto, Bob Fredieu, Christian Gelinek, Glen Gibb, Shankar Giri, Dan Gisselquist, Sam Gladstone, Amir Gonnen, Chitlesh Goorah, Xuan Guo, Neil Hamilton, Jannis Harder, Junji Hashimoto, Thomas Hawkins, Robert Henry, David Hewson, Jamey -Hicks, Hiroki Honda, Alex Hornung, David Horton, Jae Hossell, Alan Hunter, -Jamie Iles, Ben Jackson, Shareef Jalloq, Krzysztof Jankowski, HyungKi -Jeong, Iztok Jeras, James Johnson, Christophe Joly, Franck Jullien, Mike -Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand Kamendje, Vasu Kandadi, -Patricio Kaplan, Ralf Karge, Dan Katz, Sol Katzman, Jonathan Kimmitt, Olof -Kindgren, Sobhan Klnv, Gernot Koch, Soon Koh, Steve Kolecki, Brett Koonce, -Wojciech Koszek, Varun Koyyalagunta, David Kravitz, Roland Kruse, Sergey -Kvachonok, Ed Lander, Steve Lang, Stephane Laurent, Walter Lavino, -Christian Leber, Igor Lesik, John Li, Eivind Liland, Charlie Lind, Andrew -Ling, Paul Liu, Derek Lockhart, Arthur Low, Stefan Ludwig, Dan Lussier, -Fred Ma, Duraid Madina, Mark Marshall, Alfonso Martinez, Yves Mathieu, -Patrick Maupin, Jason McMullan, Elliot Mednick, Wim Michiels, Miodrag -Milanovic, Wai Sum Mong, Sean Moore, Dennis Muhlestein, John Murphy, -Richard Myers, Dimitris Nalbantis, Bob Newgard, Cong Van Nguyen, Paul -Nitza, Pete Nixon, Lisa Noack, Mark Nodine, Andreas Olofsson, James -Pallister, Brad Parker, Maciej Piechotka, David Pierce, Dominic Plunkett, -David Poole, Mike Popoloski, Rich Porter, Niranjan Prabhu, Usha -Priyadharshini, Mark Jackson Pulver, Prateek Puri, Chris Randall, Anton -Rapp, Odd Magne Reitan, Frederic Requin, Alberto Del Rio, Oleg Rodionov, -Paul Rolfe, Jan Egil Ruud, John Sanguinetti, Galen Seitz, Salman Sheikh, +Hicks, Joel Holdsworth, Hiroki Honda, Alex Hornung, David Horton, Jae +Hossell, Alan Hunter, James Hutchinson, Jamie Iles, Ben Jackson, Shareef +Jalloq, Krzysztof Jankowski, HyungKi Jeong, Iztok Jeras, James Johnson, +Christophe Joly, Franck Jullien, James Jung, Mike Kagen, Arthur Kahlich, +Kaalia Kahn, Guy-Armand Kamendje, Vasu Kandadi, Patricio Kaplan, Ralf +Karge, Dan Katz, Sol Katzman, Jonathan Kimmitt, Olof Kindgren, Dan Kirkham, +Sobhan Klnv, Gernot Koch, Soon Koh, Steve Kolecki, Brett Koonce, Wojciech +Koszek, Varun Koyyalagunta, David Kravitz, Roland Kruse, Sergey Kvachonok, +Ed Lander, Steve Lang, Stephane Laurent, Walter Lavino, Christian Leber, +Igor Lesik, John Li, Eivind Liland, Charlie Lind, Andrew Ling, Paul Liu, +Derek Lockhart, Arthur Low, Stefan Ludwig, Dan Lussier, Fred Ma, Duraid +Madina, Mark Marshall, Alfonso Martinez, Yves Mathieu, Patrick Maupin, +Jason McMullan, Elliot Mednick, Wim Michiels, Miodrag Milanovic, Wai Sum +Mong, Sean Moore, Dennis Muhlestein, John Murphy, Richard Myers, Dimitris +Nalbantis, Bob Newgard, Cong Van Nguyen, Paul Nitza, Pete Nixon, Lisa +Noack, Mark Nodine, Andreas Olofsson, James Pallister, Brad Parker, Maciej +Piechotka, David Pierce, Dominic Plunkett, David Poole, Mike Popoloski, +Rich Porter, Niranjan Prabhu, Usha Priyadharshini, Mark Jackson Pulver, +Prateek Puri, Chris Randall, Anton Rapp, Josh Redford, Odd Magne Reitan, +Frederic Requin, Alberto Del Rio, Oleg Rodionov, Paul Rolfe, Arjen +Roodselaar, Jan Egil Ruud, John Sanguinetti, Galen Seitz, Salman Sheikh, Mike Shinkarovsky, Rafael Shirakawa, Jeffrey Short, Rodney Sinclair, Steven Slatter, Brian Small, Alex Solomatnikov, Wei Song, Art Stamness, John -Stevenson, Rob Stoddard, Todd Strader, John Stroebel, Sven Stucki, Emerson -Suguimoto, Gene Sullivan, Renga Sundararajan, Yutetsu Takatsukasa, Peter -Tengstrand, Wesley Terpstra, Stefan Thiede, Gary Thomas, Kevin Thompson, -Ian Thompson, Mike Thyer, Hans Tichelaar, Steve Tong, Michael Tresidder, -Holger Waechtler, Stefan Wallentowitz, Shawn Wang, Greg Waters, Thomas -Watts, Eugene Weber, David Welch, Thomas J Whatson, Leon Wildman, Gerald -Williams, Trevor Williams, Jeff Winston, Joshua Wise, Clifford Wolf, Johan -Wouters, Ding Xiaoliang, Jie Xu, Mandy Xu, Luke Yang, and Amir -Yazdanbakhsh. +Stevenson, Patrick Stewart, Rob Stoddard, Todd Strader, John Stroebel, Sven +Stucki, Emerson Suguimoto, Gene Sullivan, Renga Sundararajan, Yutetsu +Takatsukasa, Peter Tengstrand, Wesley Terpstra, Rui Terra, Stefan Thiede, +Gary Thomas, Kevin Thompson, Ian Thompson, Mike Thyer, Hans Tichelaar, +Steve Tong, Michael Tresidder, Holger Waechtler, Stefan Wallentowitz, Shawn +Wang, Greg Waters, Thomas Watts, Eugene Weber, David Welch, Thomas J +Whatson, Leon Wildman, Gerald Williams, Trevor Williams, Jeff Winston, +Joshua Wise, Clifford Wolf, Johan Wouters, Junyi Xi, Ding Xiaoliang, Jie +Xu, Mandy Xu, Luke Yang, and Amir Yazdanbakhsh. Thanks to them, and all those we've missed including above. From b1bf742544744cd2a6f77a83a3769fca846b2065 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 24 Jun 2018 18:44:16 -0400 Subject: [PATCH 2/5] Internals: rank() public for future optimizers. --- src/V3Graph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/V3Graph.h b/src/V3Graph.h index 2664f3417..d25b161c6 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -159,7 +159,6 @@ protected: void verticesPushBack(V3Graph* graphp); // ACCESSORS void fanout(double fanout) { m_fanout = fanout; } - void rank(uint32_t rank) { m_rank = rank; } void inUnlink() { m_ins.reset(); } // Low level; normally unlinkDelete is what you want void outUnlink() { m_outs.reset(); } // Low level; normally unlinkDelete is what you want protected: @@ -192,6 +191,7 @@ public: uint32_t color() const { return m_color; } void color(uint32_t color) { m_color = color; } uint32_t rank() const { return m_rank; } + void rank(uint32_t rank) { m_rank = rank; } double fanout() const { return m_fanout; } void user(uint32_t user) { m_user = user; } uint32_t user() const { return m_user; } From d4b9b5aba675d1f7ae4685728cad68354d14b4f5 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 26 Jun 2018 07:11:56 -0400 Subject: [PATCH 3/5] Fix to ignore Unicode UTF-8 BOM sequences, msg2576. --- Changes | 2 ++ src/V3PreLex.l | 3 +++ test_regress/t/t_unicode.pl | 50 +++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100755 test_regress/t/t_unicode.pl diff --git a/Changes b/Changes index cb4acaa4a..ab0f73c49 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix define argument stringification (`"), broke since 3.914. [Joe DErrico] +**** Fix to ignore Unicode UTF-8 BOM sequences, msg2576. [HyungKi Jeong] + * Verilator 3.924 2018-06-12 diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 24762e978..7766eec41 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -76,10 +76,13 @@ symb ([a-zA-Z_][a-zA-Z0-9_$]*|\\[^ \t\f\r\n]+) symbdef ([a-zA-Z_][a-zA-Z0-9_$]*|\\[^ \t\f\r\n`]+) word [a-zA-Z0-9_]+ drop [\032] +bom [\357\273\277] + /**************************************************************/ %% +{bom} { } ^{ws}*"`line"{ws}+.*{crnl} { LEXP->lineDirective(yytext); return(VP_LINE); } diff --git a/test_regress/t/t_unicode.pl b/test_regress/t/t_unicode.pl new file mode 100755 index 000000000..ecc4c14c2 --- /dev/null +++ b/test_regress/t/t_unicode.pl @@ -0,0 +1,50 @@ +#!/usr/bin/perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2003 by Wilson Snyder. This program is free software; you can +# redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +use IO::File; +#use Data::Dumper; +use strict; +use vars qw($Self); + +scenarios(simulator => 1); + +sub gen { + my $filename = shift; + + my $fh = IO::File->new(">$filename"); + $fh->print(chr(0xEF).chr(0xBB).chr(0xBF)); # BOM + $fh->print("// Bom\n"); + $fh->print("// Generated by t_unicode.pl\n"); + $fh->print("module t;\n"); + $fh->print(" // Chinese " + .chr(0xe8).chr(0xaf).chr(0x84).chr(0xe8).chr(0xae).chr(0xba) # Comment + ."\n"); + $fh->print(" initial begin\n"); + $fh->print(" \$write(\"Hello " + .chr(0xe4).chr(0xb8).chr(0x96).chr(0xe7).chr(0x95).chr(0x8c) # World + ."\\n\");\n"); + $fh->print(" \$write(\"*-* All Finished *-*\\n\");\n"); + $fh->print(" \$finish;\n"); + $fh->print(" end\n"); + $fh->print("endmodule\n"); +} + +top_filename("$Self->{obj_dir}/t_unicode.v"); + +gen($Self->{top_filename}); + +compile( + ); + +execute( + check_finished => 1, + expect => q{Hello \344\270\226\347\225\214.*}, + ); + +ok(1); +1; From 45eddfb33553d08deb99028f4cccd7f52229f909 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 26 Jun 2018 07:33:55 -0400 Subject: [PATCH 4/5] Warn if using pre-C++11 so find out who needs it. --- configure.ac | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/configure.ac b/configure.ac index 226724a12..444117685 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,21 @@ AC_ARG_ENABLE([longtests], AC_SUBST(CFG_WITH_LONGTESTS) AC_MSG_RESULT($CFG_WITH_LONGTESTS) +# CFG_WITH_PREC11 +AC_MSG_CHECKING(whether allow pre-C++11) +AC_ARG_ENABLE([prec11], + [AS_HELP_STRING([--enable-prec11], + [enable pre-C++11 compilers])], + [case "${enableval}" in + yes) CFG_WITH_PREC11=yes ;; + no) CFG_WITH_PREC11=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-prec11]) ;; + esac], + [CFG_WITH_PREC11=no;] + ) +AC_SUBST(CFG_WITH_PREC11) +AC_MSG_RESULT($CFG_WITH_PREC11) + # Compiler flags CFLAGS=-I${includedir} CPPFLAGS=-I${includedir} @@ -250,6 +265,22 @@ CFG_WITH_THREADED=$_my_result AC_SUBST(CFG_WITH_THREADED) AC_MSG_RESULT($CFG_WITH_THREADED) +# Check compiler flag +if test "$CFG_WITH_THREADED" = "no" ; then + if test "$CFG_WITH_PREC11" = "no" ; then + AC_MSG_NOTICE([[]]) + AC_MSG_ERROR([[the $CXX compiler appears to not support C++11. + +Verilator plans to require a C++11 or newer compiler in a future release, +unless sufficient people report problems. Therefore, if you do not have a +C++11 compiler, please post a message to +https://www.veripool.org/boards/3/topics/2580-Verilator-Requiring-C-11-compiler +indicating your OS and when you think C++11 might be ok, and then rerun +configure with the --enable-prec11 argument. Thanks.]]) + + fi +fi + # Checks for library functions. AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec], [AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])], From 4f962bddd8127e1fb75e54da9be7da29a8f7ee30 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 28 Jun 2018 18:55:36 -0400 Subject: [PATCH 5/5] Fix std:: build error, bug1322. --- Changes | 2 ++ src/V3Global.h | 4 ++++ src/VlcMain.cpp | 7 +++++++ src/config_build.h.in | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/Changes b/Changes index ab0f73c49..bac574aa7 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix to ignore Unicode UTF-8 BOM sequences, msg2576. [HyungKi Jeong] +**** Fix std:: build error, bug1322. + * Verilator 3.924 2018-06-12 diff --git a/src/V3Global.h b/src/V3Global.h index a194bae45..2716dd75e 100644 --- a/src/V3Global.h +++ b/src/V3Global.h @@ -22,6 +22,10 @@ #define _V3GLOBAL_H_ 1 #include "config_build.h" +#ifndef HAVE_CONFIG_BUILD +# error "Something failed during ./configure as config_build.h is incomplete." +#endif + #include "verilatedos.h" #include diff --git a/src/VlcMain.cpp b/src/VlcMain.cpp index ef7781b7b..a00fd72ee 100644 --- a/src/VlcMain.cpp +++ b/src/VlcMain.cpp @@ -19,6 +19,13 @@ //************************************************************************* // Cheat for speed and compile .cpp files into one object +#include "config_build.h" +#ifndef HAVE_CONFIG_BUILD +# error "Something failed during ./configure as config_build.h is incomplete." +#endif + +#include "verilatedos.h" + #define _V3ERROR_NO_GLOBAL_ 1 #include "V3Error.cpp" #include "V3String.cpp" diff --git a/src/config_build.h.in b/src/config_build.h.in index e0cf99e09..ffb7368d7 100644 --- a/src/config_build.h.in +++ b/src/config_build.h.in @@ -78,3 +78,7 @@ using namespace std; //**** OS and compiler specifics #include "verilatedos.h" + +//********************************************************************** +//**** This file sometimes gets truncated, so check in consumers +#define HAVE_CONFIG_BUILD