Compare commits

..
7 Commits
57 changed files with 384 additions and 149 deletions
+154
View File
@@ -3,6 +3,13 @@ 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.821 2011/09/14
**** Fix PowerPC runtime error, bug288. [Ahmed El-Mahmoudy]
**** Fix internal error on integer casts, bug374. [Chandan Egbert]
* Verilator 3.820 2011/07/28
** Support 'real' numbers and related functions.
@@ -22,6 +29,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Use 'vluint64_t' for SystemC instead of (same sized) 'uint64' for MSVC++.
* Verilator 3.813 2011/06/28
*** Support bit vectors > 64 bits wide in DPI import and exports.
@@ -38,6 +46,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix compiler warnings on SPARC, bug288. [Ahmed El-Mahmoudy]
* Verilator 3.812 2011/04/06
*** Add --trace-max-width and --trace-max-array, bug319. [Alex Solomatnikov]
@@ -58,6 +67,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix concatenates and vectored bufif1, bug326. [Iztok Jeras]
* Verilator 3.811 2011/02/14
**** Report errors on duplicated or empty pins, bug321. [Christian Leber]
@@ -78,6 +88,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix error on constants connected to outputs, bug323. [Christian Leber]
* Verilator 3.810 2011/01/03
** Add limited support for VPI access to public signals, see docs.
@@ -111,6 +122,7 @@ indicates the contributor was also the author of the fix; Thanks!
*** The VARHIDDEN warning is now disabled by default, use -Wall to enable.
* Verilator 3.805 2010/11/02
**** Add warning when directory contains spaces, msg378. [Salman Sheikh]
@@ -121,6 +133,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix DPI export name not found, msg369. [Terry Chen]
* Verilator 3.804 2010/09/20
*** Support tracing/coverage of underscore signals, bug280. [by Jason McMullan]
@@ -131,6 +144,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** On core dump, print debug suggestions.
* Verilator 3.803 2010/07/10
*** Fix preprocessor preservation of newlines across macro substitutions.
@@ -141,6 +155,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix do {...} while() not requiring final semicolon.
* Verilator 3.802 2010/05/01
*** Support runtime access to public signal names.
@@ -167,6 +182,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix installing data files as non-executable, bug168. [by Ahmed El-Mahmoudy]
* Verilator 3.801 2010/03/17
*** Support "break", "continue", "return".
@@ -185,6 +201,7 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix parametrized defines with empty arguments.
* Verilator 3.800 2010/02/07
Application visible changes:
@@ -266,6 +283,7 @@ Bug fixes:
**** Fix lint_off/lint_on meta comments on same line as warning.
* Verilator 3.720 2009/10/26
** Support little endian bit vectors ("reg [0:2] x;").
@@ -282,6 +300,7 @@ Bug fixes:
**** Fix erroring on strings with backslashed newlines, bug168. [Pete Nixon]
* Verilator 3.714 2009/09/18
** Add --bbox-sys option to blackbox $system calls.
@@ -302,6 +321,7 @@ Bug fixes:
**** Fix --error-limit option being ignored.
* Verilator 3.713 2009/08/04
** Support constant function calls for parameters. [many!]
@@ -312,6 +332,7 @@ Bug fixes:
**** Fix escaped preprocessor identifiers, bug106. [Nimrod Gileadi]
* Verilator 3.712 2009/07/14
** Patching SystemC is no longer required to trace sc_bvs.
@@ -326,6 +347,7 @@ Bug fixes:
**** Add BLKLOOPINIT error code, and describe --unroll-count. [Jeff Winston]
* Verilator 3.711 2009/06/23
**** Support decimal constants of arbitrary widths. [Mark Marshall]
@@ -338,6 +360,7 @@ Bug fixes:
**** Fix compiler errors under Fedora release candidate 11. [Chitlesh Goorah]
* Verilator 3.710 2009/05/19
** Verilator is now licensed under LGPL v3 and/or Artistic v2.0.
@@ -353,6 +376,7 @@ Bug fixes:
**** Fix define formal arguments that contain newlines, bug84. [David A]
* Verilator 3.703 2009/05/02
*** Fix $clog2 calculation error with powers-of-2, bug81. [Patricio Kaplan]
@@ -367,6 +391,7 @@ Bug fixes:
**** Fix GCC 4.3.2 compile warnings.
* Verilator 3.702 2009/03/28
*** Add --pins-bv option to use sc_bv for all ports. [Brian Small]
@@ -377,6 +402,7 @@ Bug fixes:
**** Fix the SC_MODULE name() to not include __PVT__. [Bob Fredieu]
* Verilator 3.701 2009/02/26
** Support repeat and forever statements. [Jeremy Bennett]
@@ -391,6 +417,7 @@ Bug fixes:
**** Fix left associativity for ?: operators.
* Verilator 3.700 2009/01/08
** Add limited support for tristate inouts. Written by Lane Brooks,
@@ -436,6 +463,7 @@ Bug fixes:
**** Fix wrong result for read of delayed FSM signal, bug46. [Rodney Sinclair]
* Verilator 3.681 2008/11/12
*** Add SystemVerilog unique and priority case.
@@ -450,6 +478,7 @@ Bug fixes:
**** Fix MSVC compile error; bug42. [John Stroebel]
* Verilator 3.680 2008/10/08
** Support negative bit indexes. [Stephane Laurent]
@@ -466,6 +495,7 @@ Bug fixes:
**** Fix genvars causing link error when using --public. [Chris Candler]
* Verilator 3.671 2008/09/19
** SystemC uint64_t pins are now the default instead of sc_bv<64>.
@@ -488,6 +518,7 @@ Bug fixes:
**** Support arbitrary characters in identifiers. [Stephane Laurent]
* Verilator 3.670 2008/07/23
** Add --x-assign=fast option, and make it the default.
@@ -515,6 +546,7 @@ Bug fixes:
**** Internal changes to how $displays get compiled and executed.
* Verilator 3.665 2008/06/25
**** Ignore "// verilator" comments alone on endif lines. [Rodney Sinclair]
@@ -531,10 +563,12 @@ Bug fixes:
**** Fix Makefile to find headers/libraries under prefix. [by Holger Waechtler]
* Verilator 3.664 2008/05/08
**** Fix missing file in kit.
* Verilator 3.663 2008/05/07
**** Add DESTDIR to Makefiles to assist RPM construction. [Gunter Dannoritzer]
@@ -547,6 +581,7 @@ Bug fixes:
**** Fix comma separated list of primitives. [by Bryan Brady]
* Verilator 3.662 2008/04/25
*** Add Verilog 2005 $clog2() function.
@@ -574,6 +609,7 @@ Bug fixes:
**** Fix bug introduced in 3.661 with parametrized defines.
* Verilator 3.661 2008/04/04
*** The --enable-defenv configure option added in 3.660 is now the default.
@@ -604,6 +640,7 @@ Bug fixes:
**** Fix internal error after MSB < LSB error reported to user. [Stefan Thiede]
* Verilator 3.660 2008/03/23
*** Add support for hard-coding VERILATOR_ROOT etc in the executables,
@@ -625,10 +662,12 @@ Bug fixes:
**** Fix undefined assigns to be implicit warnings. [Stefan Thiede]
* Verilator 3.658 2008/02/25
**** Fix unistd compile error in 3.657. [Patricio Kaplan, Jonathan Kimmitt]
* Verilator 3.657 2008/02/20
**** Fix assignments of {a,b,c} = {c,b,a}. [Jonathan Kimmitt]
@@ -639,6 +678,7 @@ Bug fixes:
**** Fix parsing of always @(*). [Patricio Kaplan]
* Verilator 3.656 2008/01/18
**** Wide VL_CONST_W_#X functions are now made automatically. [Bernard Deadman]
@@ -648,6 +688,7 @@ Bug fixes:
**** Fixed tracing of SystemC w/o SystemPerl. [Bernard Deadman, Johan Wouters]
* Verilator 3.655 2007/11/27
*** Support "#delay <statement>;" with associated STMTDLY warning.
@@ -660,6 +701,7 @@ Bug fixes:
**** Fixed many internal memory leaks, and added leak detector.
* Verilator 3.654 2007/10/18
**** Don't exit early if many warnings but no errors are found. [Stan Mayer]
@@ -668,12 +710,14 @@ Bug fixes:
**** Fixed parsing system functions with empty parens. [Oleg Rodionov]
* Verilator 3.653 2007/8/1
**** Support SystemVerilog ==? and !=? operators.
**** Fixed SC_LIBS missing from generated makefiles. [Ding Xiaoliang]
* Verilator 3.652 2007/6/21
**** Report as many warning types as possible before exiting.
@@ -686,6 +730,7 @@ Bug fixes:
**** Fixed Preprocessor dropping some `line directives. [Mark Nodine]
* Verilator 3.651 2007/5/22
*** Added verilator_profcfunc utility. [Gene Weber]
@@ -700,6 +745,7 @@ Bug fixes:
**** Allow empty case/endcase blocks.
* Verilator 3.650 2007/4/20
** Add --compiler msvc option. This is now required when Verilated code
@@ -725,6 +771,7 @@ Bug fixes:
**** Fixed 3.640 `verilog forcing IEEE 1364-1995 only. [David Hewson]
* Verilator 3.640 2007/3/12
*** Support Verilog 2005 `begin_keywords and `end_keywords.
@@ -743,6 +790,7 @@ Bug fixes:
**** Fixed display %m names inside named blocks.
* Verilator 3.633 2007/2/7
*** Add --trace-depth option for minimizing VCD file size. [Emerson Suguimoto]
@@ -755,10 +803,12 @@ Bug fixes:
**** Fixed $display's with array select followed by wide AND. [David Hewson]
* Verilator 3.632 2007/1/17
*** Add /*verilator isolate_assignments*/ attribute. [Mike Shinkarovsky]
* Verilator 3.631 2007/1/2
** Support standard NAME[#] for cells created by arraying or generate for.
@@ -770,6 +820,7 @@ Bug fixes:
**** Fixed $readmem* with filenames < 8 characters. [Emerson Suguimoto]
* Verilator 3.630 2006/12/19
** Support $readmemb and $readmemh. [Eugene Weber, Arthur Kahlich]
@@ -784,6 +835,7 @@ Bug fixes:
**** Fixed missed split optimization points underneath other re-split blocks.
* Verilator 3.623 2006/12/05
*** Add --output-split-cfuncs for accelerating GCC compile. [Eugene Weber]
@@ -792,10 +844,12 @@ Bug fixes:
**** Add M32 make variable to support -m32 compiles. [Eugene Weber]
* Verilator 3.622 2006/10/17 Stable
**** Fixed --skip-identical without --debug, broken in 3.621. [Andy Meier]
* Verilator 3.621 2006/10/11 Beta
** Add /*verilator no_inline_task*/ to prevent over-expansion. [Eugene Weber]
@@ -810,6 +864,7 @@ Bug fixes:
**** Fixed core dump on printing error when not under --debug. [Allan Cochrane]
* Verilator 3.620 2006/10/04 Stable
*** Support simple inout task ports. [Eugene Weber]
@@ -827,6 +882,7 @@ Bug fixes:
**** Fixed dotted variables in always sensitivity lists. [Allan Cochrane]
* Verilator 3.610 2006/09/20 Stable
*** Verilator now works under DJGPP (Pentium GCC). [John Stroebel]
@@ -839,10 +895,12 @@ Bug fixes:
**** Fixed printf format warnings on 64-bit linux.
* Verilator 3.602 2006/09/11 Stable
**** Fixed function references under top inlined module. [David Hewson]
* Verilator 3.601 2006/09/06 Beta
*** Added --inhibit-sim flag for environments using old __Vm_inhibitSim.
@@ -866,6 +924,7 @@ Bug fixes:
**** Declare optimized lookup tables as 'static', to reduce D-Cache miss rate.
* Verilator 3.600 2006/08/28 Beta
** Support dotted cross-hierarchy variable and task references.
@@ -878,6 +937,7 @@ Bug fixes:
**** Fixed redundant statements remaining after table optimization.
* Verilator 3.542 2006/08/11 Stable
**** Fixed extraneous UNSIGNED warning when comparing genvars. [David Hewson]
@@ -888,6 +948,7 @@ Bug fixes:
**** Add VL_CONST_W_24X macro. [Bernard Deadman]
* Verilator 3.541 2006/07/05 Beta
*** Fixed "// verilator lint_on" not re-enabling warnings. [David Hewson]
@@ -900,6 +961,7 @@ Bug fixes:
**** Fixed GCC 4.0 header file warnings.
* Verilator 3.540 2006/06/27 Beta
**** Optimize combo assignments that are used only once, ~5-25% faster.
@@ -910,6 +972,7 @@ Bug fixes:
**** Fixed mis-width warning on dead generate-if branches. [Jae Hossell]
* Verilator 3.533 2006/06/05 Stable
*** Add PDF user manual, verilator.pdf.
@@ -920,6 +983,7 @@ Bug fixes:
**** Fixed Bison compile errors in verilog.y. [by Ben Jackson]
* Verilator 3.531 2006/05/10 Stable
*** Support $c routines which return 64 bit values.
@@ -928,11 +992,13 @@ Bug fixes:
**** Fixed Verilator core dump when have empty public function. [David.Hewson]
* Verilator 3.530 2006/04/24 Stable
** $time is now 64 bits. The macro VL_TIME_I is now VL_TIME_Q, but calls
the same sc_time_stamp() function to get the current time.
* Verilator 3.523 2006/03/06 Stable
**** Fixed error line numbers being off due to multi-line defines. [Mat Zeno]
@@ -941,10 +1007,12 @@ Bug fixes:
**** Fixed `systemc_imp_header "undefined macro" error.
* Verilator 3.522 2006/02/23 Beta
**** Add UNUSED error message, for forward compatibility.
* Verilator 3.521 2006/02/14 Beta
*** Create new --coverage-line and --coverage-user options. [Peter Holmes]
@@ -953,11 +1021,13 @@ Bug fixes:
**** Fixed public module's parent still getting inlined.
* Verilator 3.520 2006/01/14 Stable
** Added support for $fopen, $fclose, $fwrite, $fdisplay.
See documentation, as the file descriptors differ from the standard.
* Verilator 3.510 2005/12/17 Stable
** Improve trace-on performance on large multi-clock designs by 2x or more.
@@ -972,6 +1042,7 @@ Bug fixes:
**** Fixed VL_MULS_WWW compile error with MSVC++. [Wim Michiels]
* Verilator 3.502 2005/11/30 Stable
**** Fixed local non-IO variables in public functions and tasks.
@@ -979,6 +1050,7 @@ Bug fixes:
**** Fixed bad lifetime optimization when same signal is assigned multiple
times in both branch of a if. [Danny Ding]
* Verilator 3.501 2005/11/16 Stable
*** Add --profile-cfuncs for correlating profiles back to Verilog.
@@ -987,6 +1059,7 @@ Bug fixes:
**** Fixed bad deep expressions with bit-selects and rotate. [Prabhat Gupta]
* Verilator 3.500 2005/10/30 Stable
** Support signed numbers, >>>, $signed, $unsigned. [MANY!]
@@ -1003,12 +1076,14 @@ Bug fixes:
**** Fixed generate for cell instantiations with same name. [Mat Zeno]
* Verilator 3.481 2005/10/12 Stable
*** Add /*verilator tracing_on/off*/ for waveform control.
**** Fixed split optimization reordering $display statements.
* Verilator 3.480 2005/9/27 Beta
** Allow coverage of flattened modules, and multiple points per line.
@@ -1024,6 +1099,7 @@ Bug fixes:
**** Optimize local variables from delayed array assignments.
* Verilator 3.470 2005/9/6 Stable
*** Optimize staging flops under reset blocks.
@@ -1036,6 +1112,7 @@ Bug fixes:
**** Fixed preprocessor substitution of quoted parameterized defines.
* Verilator 3.464 2005/8/24 Stable
*** Add `systemc_imp_header, for use when using --output-split.
@@ -1044,10 +1121,12 @@ Bug fixes:
**** Fixed core dump with clock inversion optimizations.
* Verilator 3.463 2005/8/5 Stable
*** Fixed case defaults when not last statement in case list. [Wim Michiels]
* Verilator 3.462 2005/8/3 Stable
*** Fixed reordering of delayed assignments to same memory index. [Wim Michiels]
@@ -1056,10 +1135,12 @@ Bug fixes:
**** Fixed multiply-instantiated public tasks generating non-compilable code.
* Verilator 3.461 2005/7/28 Beta
**** Fixed compile error with older versions of bison. [Jeff Dutton]
* Verilator 3.460 2005/7/27 Beta
** Add -output-split option to enable faster parallel GCC compiles.
@@ -1081,6 +1162,7 @@ Bug fixes:
**** Internal tree dumps now indicate edit number that changed the node.
* Verilator 3.450 2005/7/12
** $finish will no longer exit, but set Verilated::gotFinish().
@@ -1096,18 +1178,22 @@ Bug fixes:
**** Fixed "=== 1'bx" to always be false, instead of random.
* Verilator 3.440 2005/6/28 Stable
** Add Verilog 2001 generate for/if/case statements.
* Verilator 3.431 2005/6/24 Stable
*** Fixed selection bugs introduced in 3.430 beta.
* Verilator 3.430 2005/6/22 Beta
** Add Verilog 2001 variable part selects [n+:m] and [n-:m]. [Wim Michiels]
* Verilator 3.422 2005/6/10 Stable
*** Added Verilog 2001 power (**) operator. [Danny Ding]
@@ -1116,12 +1202,14 @@ Bug fixes:
**** Fixed tracing of modules with public functions.
* Verilator 3.421 2005/6/2 Beta
**** Fixed error about reserved word on non-public signals.
**** Fixed missing initialization compile errors in 3.420 beta. [Ralf Karge]
* Verilator 3.420 2005/6/2 Beta
*** Fixed case defaults when not last statement in case list. [Ralf Karge]
@@ -1140,10 +1228,12 @@ Bug fixes:
**** Fixed gate optimization with top-flattened modules. [Mahesh Kumashikar]
* Verilator 3.411 2005/5/30 Stable
**** Fixed compile error in GCC 2.96. [Jeff Dutton]
* Verilator 3.410 2005/5/25 Beta
** Allow functions and tasks to be declared public.
@@ -1160,6 +1250,7 @@ Bug fixes:
**** Fixed compile error in GCC 2.96, and with SystemC 1.2. [Jeff Dutton]
* Verilator 3.400 2005/4/29 Beta
** Internal changes to support future clocking features.
@@ -1191,6 +1282,7 @@ Bug fixes:
**** Fixed crash with size mismatches on case items. [Gernot Koch]
* Verilator 3.340 2005/2/18 Stable
*** Report misconnected pins across all modules, instead of just first error.
@@ -1201,6 +1293,7 @@ Bug fixes:
**** Added additional internal assertions.
* Verilator 3.332 2005/1/27
*** Added -E preprocess only flag, similar to GCC.
@@ -1209,6 +1302,7 @@ Bug fixes:
**** Fixed loss of first -f file argument, introduced in 3.331.
* Verilator 3.331 2005/1/18
** The Verilog::Perl preprocessor is now C++ code inside of Verilator.
@@ -1219,6 +1313,7 @@ Bug fixes:
**** Fixed unlinked error with defparam. [Shawn Wang]
* Verilator 3.320 2004/12/10
** NEWS is now renamed Changes, to support CPAN indexing.
@@ -1237,12 +1332,14 @@ Bug fixes:
**** Fixed compile warnings on Suse 9.1
* Verilator 3.311 2004/11/29
** Support implicit wire declarations (as a warning). [Shawn Wang]
**** Fixed over-shift difference in Verilog vs C++. [Ralf Karge]
* Verilator 3.310 2004/11/15
** Support defparam.
@@ -1251,6 +1348,7 @@ Bug fixes:
*** Ignore all specify blocks.
* Verilator 3.302 2004/11/12
*** Support NAND and NOR operators.
@@ -1266,6 +1364,7 @@ Bug fixes:
**** Fixed runtime bit-selection of parameter constants.
* Verilator 3.301 2004/11/04
**** Fixed 64 bit [31:0] = {#{}} mis-simulation. [Ralf Karge]
@@ -1274,6 +1373,7 @@ Bug fixes:
**** Work around GCC 2.96 negation bug.
* Verilator 3.300 2004/10/21
** New backend that eliminates most VL_ macros.
@@ -1282,12 +1382,14 @@ Bug fixes:
**** Fixed "setting unsigned int from signed value" warning.
* Verilator 3.271 2004/10/21
**** Fixed "loops detected" error with some negedge clocks.
**** Cleaned up some output code spacing issues.
* Verilator 3.270 2004/10/15
*** Support Verilog 2001 parameters in module headers. [Ralf Karge]
@@ -1296,6 +1398,7 @@ Bug fixes:
**** Faster code to support compilers not inlining all Verilated functions.
* Verilator 3.260 2004/10/7
** Support Verilog 2001 named parameter instantiation. [Ralf Karge]
@@ -1306,22 +1409,26 @@ Bug fixes:
**** Fixed incorrect dependency in .d file when setting VERILATOR_BIN.
* Verilator 3.251 2004/9/9
**** Fixed parenthesis overflow in Microsoft Visual C++ [Renga Sundararajan]
* Verilator 3.250 2004/8/30
** Support Microsoft Visual C++ [Renga Sundararajan]
*** SystemPerl 1.161+ is required.
* Verilator 3.241 2004/8/17
** Support ,'s to separate multiple assignments. [Paul Nitza]
**** Fixed shift sign extension problem using non-GCC compilers.
* Verilator 3.240 2004/8/13
** Verilator now uses 64 bit math where appropriate.
@@ -1335,6 +1442,7 @@ Bug fixes:
**** Fixed concat value error introduced in 3.230.
* Verilator 3.230 2004/8/10
*** Added coverage output to test_sp example, SystemPerl 1.160+ is required.
@@ -1348,6 +1456,7 @@ Bug fixes:
**** Fixed wide signal width extension bug.
Only applies when width mismatch warnings were overridden.
* Verilator 3.220 2004/6/22
** Many waveform tracing changes:
@@ -1362,6 +1471,7 @@ Bug fixes:
**** Various Cygwin compilation fixes. [John Brownlee]
* Verilator 3.210 2004/4/1
** Compiler optimization switches have changed
@@ -1374,10 +1484,12 @@ Bug fixes:
*** Added warnings for SystemVerilog reserved words.
* Verilator 3.203 2004/3/10
*** Notes and repairs for Solaris. [Fred Ma]
* Verilator 3.202 2004/1/27
** The beta version is now the primary release. See below for many changes.
@@ -1391,6 +1503,7 @@ Bug fixes:
**** Added optimizations for common replication operations.
* Verilator 3.201-beta 2003/12/10
** BETA VERSION, USE 3.124 for stable release!
@@ -1411,10 +1524,12 @@ Bug fixes:
This name will be used to prefix any $display %m arguments, so users may
distinguish between multiple Verilated modules in a single executable.
* Verilator 3.125 2004/1/27
**** Optimization of bit replications
* Verilator 3.124 2003/12/05
*** A optimized executable will be made by default, in addition to a debug
@@ -1422,6 +1537,7 @@ Bug fixes:
**** Many minor invisible changes to support the next version.
* Verilator 3.123 2003/11/10
**** Wide bus performance enhancements.
@@ -1430,6 +1546,7 @@ Bug fixes:
**** Fixed __DOT__ compile problem with funcs in last revision. [Leon Wildman]
* Verilator 3.122 2003/10/29
*** Modules which are accessed from external code now must be marked with
@@ -1440,6 +1557,7 @@ Bug fixes:
**** Fixed function call bug when width warning suppressed. [Leon Wildman]
* Verilator 3.121 2003/09/29
*** Support multiplication over 32 bits. [Chris Boumenot]
@@ -1451,6 +1569,7 @@ Bug fixes:
**** Fixed width problems on function arguments. [Robert A. Clark]
* Verilator 3.120 2003/09/24
*** $finish now exits the model (via vl_finish function).
@@ -1469,28 +1588,33 @@ Bug fixes:
**** Fixed $display("%x");
* Verilator 3.112 2003/09/16
**** Fixed functions in continuous assignments. [Robert A. Clark]
**** Fixed inlining of modules with 2-level deep outputs.
* Verilator 3.111 2003/09/15
**** Fixed declaration of functions before using that module. [Robert A. Clark]
**** Fixed module inlining bug with outputs.
* Verilator 3.110 2003/09/12
** Support Verilog 2001 style input/output declarations. [Robert A. Clark]
*** Allow local vars in headers of function/tasks. [Leon Wildman]
* Verilator 3.109 2003/08/28
** Added support for local variables in named begin blocks. [Leon Wildman]
* Verilator 3.108 2003/08/11
** Added support for functions.
@@ -1503,6 +1627,7 @@ Bug fixes:
**** Many optimizations involving conditionals (?:)
* Verilator 3.107 2003/07/15
*** --private and --l2name are now the default,
@@ -1520,6 +1645,7 @@ Bug fixes:
**** Additional constant optimizations, ~5% speed improvement.
* Verilator 3.106 2003/06/17
** $c can now take multiple expressions as arguments.
@@ -1544,10 +1670,12 @@ Bug fixes:
**** Several cleanups for Redhat 8.0.
* Verilator 3.105 2003/05/08
**** Fixed more GCC 3.2 errors. [David Black]
* Verilator 3.104 2003/04/30
*** Indicate direction of ports with VL_IN and VL_OUT.
@@ -1566,6 +1694,7 @@ Bug fixes:
**** Fixed GCC 3.2 compile errors. [Narayan Bhagavatula]
* Verilator 3.103 2003/01/28
**** Fixed missing model evaluation when clock generated several levels of
@@ -1573,22 +1702,26 @@ Bug fixes:
**** Fixed sign-extension bug introduced in 3.102.
* Verilator 3.102 2003/01/24
**** Fixed sign-extension of X/Z's ("32'hx")
* Verilator 3.101 2003/01/13
**** Fixed 'parameter FOO=#'bXXXX' [Richard Myers]
**** Allow spaces inside numbers ("32'h 1234") [Sam Gladstone]
* Verilator 3.100 2002/12/23
** Support for simple tasks w/o vars or I/O. [Richard Myers]
**** Ignore DOS carriage returns in Linux files. [Richard Myers]
* Verilator 3.012 2002/12/18
**** Fixed parsing bug with casex statements containing case items
@@ -1602,6 +1735,7 @@ Bug fixes:
**** Fixed compile with threaded Perl. [Ami Keren]
* Verilator 3.010 2002/11/3
*** Support SystemC 2.0.1. SystemPerl version 1.130 or newer is required.
@@ -1609,12 +1743,14 @@ Bug fixes:
**** Fixed bug with inlined modules under other inlined modules. [Scott
Bleiweiss]
* Verilator 3.005 2002/10/21
**** Fixed X's in case (not casex/z) to constant propagate correctly.
**** Fixed missing include. [Kurachi]
* Verilator 3.004 2002/10/10
*** Added /* verilator module_inline */ and associated optimizations.
@@ -1630,6 +1766,7 @@ Bug fixes:
**** Additional concatenation optimizations.
* Verilator 3.003 2002/09/13
*** Now compiles on Windows 2000 with Cygwin.
@@ -1638,10 +1775,12 @@ Bug fixes:
**** Optimize wire assignments to constants.
* Verilator 3.002 2002/08/19
** First public release of version 3.
* Verilator 3.000 2002/08/03
** All new code base. Many changes too numerous to mention.
@@ -1652,6 +1791,7 @@ Bug fixes:
*** Supports `defines across multiple modules
*** Optimizes call ordering, constant propagation, and dead code elimination.
* Verilator 2.1.8 2002/04/03
** All applications must now link against include/verilated.cpp
@@ -1668,6 +1808,7 @@ Bug fixes:
**** Split evaluation function into clocked and non-clocked, 20% perf gain.
* Verilator 2.1.5 2001/12/1
** Added coverage analysis. In conjunction with SystemC provide line
@@ -1686,14 +1827,17 @@ Bug fixes:
**** Fixed corruption of assignments of signal over 32 bits with non-0 lsb.
* Verilator 2.1.4 2001/11/16
** Added $c("c_commands();"); for embedding arbitrary C code in Verilog.
* Verilator 2.1.3 2001/11/03
** Support for parameters.
* Verilator 2.1.2 2001/10/25
** Verilog Errors now reference the .v file rather then the .vpp file.
@@ -1709,6 +1853,7 @@ Bug fixes:
**** Fixed bug where XNOR on odd-bit-widths (~^ or ^~) had bad value.
* Verilator 2.1.1 2001/5/17
** New test_sp directory for System-Perl (SystemC) top level instantiation
@@ -1724,26 +1869,32 @@ of input ports exists for tracing.
**** Many code cleanups towards standard C++ style conventions.
* Verilator 2.1.0 2001/5/8
**** Many code cleanups towards standard C++ style conventions.
* {Version history lost}
* Verilator 1.8 1996/7/8
** [Versions 0 to 1.8 were by Paul Wasson]
**** Fixed single bit in concat from instance output incorrect offset bug.
* Verilator 1.7 1996/5/20
**** Mask unused bits of DONTCAREs.
* Verilator 1.6 1996/5/13
*** Added fasttrace script
* Verilator 1.5 1996/1/9
*** Pass structure pointer into translated code,
@@ -1751,14 +1902,17 @@ of input ports exists for tracing.
**** Fixed static value concat on casex items.
* Verilator 1.1 1995/3/30
*** Bug fixes, added verimake_partial script, performance improvements.
* Verilator 1.0c 1994/9/30
*** Initial release of Verilator
* Verilator 0.0 1994/7/8
**** First code written.
+9
View File
@@ -371,6 +371,15 @@ endif
# VERILATOR_AUTHOR_SITE
endif
CPPCHECK = cppcheck
CPPCHECK_FLAGS = --enable=all --inline-suppr --suppress=unusedScopedObject
CPPCHECK_CPP = $(wildcard $(srcdir)/include/*.cpp $(srcdir)/src/*.cpp)
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CPPCHECK_CPP))
cppcheck: $(CPPCHECK_DEP)
%.cppcheck: %.cpp
$(CPPCHECK) $(CPPCHECK_FLAGS) -DVL_DEBUG=1 -I$(srcdir)/include -I$(srcdir)/src $<
ftp: info
install-msg:
+4 -4
View File
@@ -292,8 +292,8 @@ descriptions in the next sections for more information.
--top-module <topname> Name of top level input module
--trace Enable waveform creation
--trace-depth <levels> Depth of tracing
--trace-max-array <bits> Maximum bit width for tracing
--trace-max-width <depth> Maximum array depth for tracing
--trace-max-array <depth> Maximum bit width for tracing
--trace-max-width <width> Maximum array depth for tracing
--trace-underscore Enable tracing of _signals
-U<var> Undefine preprocessor define
--unroll-count <loops> Tune maximum loop iterations
@@ -823,13 +823,13 @@ Specify the number of levels deep to enable tracing, for example
entire model. Using a small number will decrease visibility, but greatly
improve runtime and trace file size.
=item --trace-max-array I<bits>
=item --trace-max-array I<depth>
Rarely needed. Specify the maximum array depth of a signal that may be
traced. Defaults to 32, as tracing large arrays may greatly slow traced
simulations.
=item --trace-max-width I<depth>
=item --trace-max-width I<width>
Rarely needed. Specify the maximum bit width of a signal that may be
traced. Defaults to 256, as tracing large vectors may greatly slow traced
+1
View File
@@ -1079,6 +1079,7 @@ VerilatedScope::VerilatedScope() {
m_callbacksp = NULL;
m_namep = NULL;
m_funcnumMax = 0;
m_symsp = NULL;
m_varsp = NULL;
}
+6 -3
View File
@@ -86,8 +86,8 @@ private:
NameMap* m_namemapp; ///< List of names for the header
static vector<VerilatedVcd*> s_vcdVecp; ///< List of all created traces
inline size_t bufferSize() { return 256*1024; } // See below for slack calculation
inline size_t bufferInsertSize() { return 16*1024; }
inline static size_t bufferSize() { return 256*1024; } // See below for slack calculation
inline static size_t bufferInsertSize() { return 16*1024; }
void bufferFlush();
void bufferCheck() {
// Flush the write buffer if there's not enough space left for new information
@@ -110,6 +110,7 @@ private:
void dumpHeader();
void dumpPrep (vluint64_t timeui);
void dumpFull (vluint64_t timeui);
// cppcheck-suppress functionConst
void dumpDone ();
inline void printCode (vluint32_t code) {
if (code>=(94*94*94)) *m_writep++ = ((char)((code/94/94/94)%94+33));
@@ -117,7 +118,7 @@ private:
if (code>=(94)) *m_writep++ = ((char)((code/94)%94+33));
*m_writep++ = ((char)((code)%94+33));
}
string stringCode (vluint32_t code) {
static string stringCode (vluint32_t code) {
string out;
if (code>=(94*94*94)) out += ((char)((code/94/94/94)%94+33));
if (code>=(94*94)) out += ((char)((code/94/94)%94+33));
@@ -141,6 +142,8 @@ public:
m_evcd = false;
m_scopeEscape = '.'; // Backward compatibility
m_wroteBytes = 0;
m_fd = 0;
m_fullDump = true;
}
~VerilatedVcd();
+3 -1
View File
@@ -98,7 +98,9 @@ class VerilatedVpioCb : public VerilatedVpio {
s_vpi_value m_value;
QData m_time;
public:
VerilatedVpioCb(const t_cb_data* cbDatap, QData time) : m_cbData(*cbDatap), m_time(time) {
// cppcheck-suppress uninitVar // m_value
VerilatedVpioCb(const t_cb_data* cbDatap, QData time)
: m_cbData(*cbDatap), m_time(time) {
m_cbData.value = &m_value;
}
virtual ~VerilatedVpioCb() {}
+11 -10
View File
@@ -58,7 +58,7 @@ pkgdatadir = @pkgdatadir@
# Compile options
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CPPFLAGSNOWALL += @CPPFLAGS@
CPPFLAGS += @CPPFLAGS@
LDFLAGS += @LDFLAGS@
#### End of system configuration section. ####
@@ -85,17 +85,18 @@ endif
# -lfl not needed as Flex invoked with %nowrap option
LIBS = -lm
CPPFLAGSNOWALL += -MMD
CPPFLAGSNOWALL += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages
#CPPFLAGSNOWALL += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
CPPFLAGSNOWALL += $(COPT)
CPPFLAGS = $(CPPFLAGSNOWALL)
CPPFLAGS += -MMD
CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
CPPFLAGS += -DYYDEBUG # Required to get nice error messages
#CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
CPPFLAGS += $(COPT)
CPPFLAGS += -MP # Only works on recent GCC versions
ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users
CPPFLAGSNOWALL += -MP # Only works on recent GCC versions
CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror
#CPPFLAGS += -pedantic-errors
endif
CPPFLAGSWALL = $(CPPFLAGS)
CPPFLAGSNOWALL = $(CPPFLAGS) -Wno-unused
ifneq ($(SYSTEMPERL),) # Intuit SYSTEMPERL_INCLUDE as it's new
SYSTEMPERL_INCLUDE ?= $(SYSTEMPERL)/src
@@ -262,9 +263,9 @@ V3Number_test: V3Number_test.o
$(PERL) $(ASTGEN) -I$(srcdir) $*.cpp
%.o: %.cpp
$(OBJCACHE) ${CXX} ${CPPFLAGS} -c $<
$(OBJCACHE) ${CXX} ${CPPFLAGSWALL} -c $<
%.o: %.c
$(OBJCACHE) ${CC} ${CPPFLAGS} -c $<
$(OBJCACHE) ${CC} ${CPPFLAGSWALL} -c $<
V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
+5 -1
View File
@@ -148,7 +148,11 @@ public:
}
public:
// CONSTUCTORS
ActiveNamer() {}
ActiveNamer() {
m_scopep = NULL;
m_iActivep = NULL;
m_cActivep = NULL;
}
virtual ~ActiveNamer() {}
void main(AstScope* nodep) {
nodep->accept(*this);
+5 -5
View File
@@ -184,7 +184,7 @@ private:
}
if (nodep->fullPragma() || nodep->priorityPragma()) {
// Simply need to add a default if there isn't one already
m_statAsFull++;
++m_statAsFull;
if (!has_default) {
nodep->addItemsp(new AstCaseItem(nodep->fileline(), NULL/*DEFAULT*/,
newFireAssert(nodep, "synthesis full_case, but non-match found")));
@@ -193,7 +193,7 @@ private:
if (nodep->parallelPragma() || nodep->uniquePragma() || nodep->unique0Pragma()) {
// Need to check that one, and only one of the case items match at any moment
// If there's a default, we allow none to match, else exactly one must match
m_statAsFull++;
++m_statAsFull;
if (!has_default && !nodep->itemsp()) {
// Not parallel, but harmlessly so.
} else {
@@ -241,18 +241,18 @@ private:
if (m_beginp && nodep->name() == "") nodep->name(m_beginp->name());
newPslAssertion(nodep, nodep->propp(), nodep->sentreep(),
nodep->stmtsp(), nodep->name()); nodep=NULL;
m_statAsCover++;
++m_statAsCover;
}
virtual void visit(AstPslAssert* nodep, AstNUser*) {
nodep->iterateChildren(*this);
newPslAssertion(nodep, nodep->propp(), nodep->sentreep(),
NULL, nodep->name()); nodep=NULL;
m_statAsPsl++;
++m_statAsPsl;
}
virtual void visit(AstVAssert* nodep, AstNUser*) {
nodep->iterateChildren(*this);
newVAssertion(nodep, nodep->propp()); nodep=NULL;
m_statAsSV++;
++m_statAsSV;
}
virtual void visit(AstNodeModule* nodep, AstNUser*) {
+2 -2
View File
@@ -430,7 +430,7 @@ void AstNode::replaceWith(AstNode* newp) {
repHandle.relink(newp);
}
void AstNRelinker::dump(ostream& str) {
void AstNRelinker::dump(ostream& str) const {
str<<" BK="<<(uint32_t*)m_backp;
str<<" ITER="<<(uint32_t*)m_iterpp;
str<<" CHG="<<(m_chg==RELINK_NEXT?"[NEXT] ":"");
@@ -947,7 +947,7 @@ void AstNode::checkTree() {
}
}
void AstNode::dumpPtrs(ostream& os) {
void AstNode::dumpPtrs(ostream& os) const {
os<<"This="<<typeName()<<" "<<(void*)this;
os<<" back="<<(void*)backp();
if (nextp()) os<<" next="<<(void*)nextp();
+20 -12
View File
@@ -71,7 +71,7 @@ public:
};
return names[m_e];
};
inline AstNumeric () {}
inline AstNumeric () : m_e(UNSIGNED) {}
inline AstNumeric (en _e) : m_e(_e) {}
explicit inline AstNumeric (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -89,6 +89,7 @@ public:
class AstPragmaType {
public:
enum en {
ILLEGAL,
COVERAGE_BLOCK_OFF,
INLINE_MODULE,
NO_INLINE_MODULE,
@@ -97,7 +98,7 @@ public:
PUBLIC_TASK
};
enum en m_e;
inline AstPragmaType () {}
inline AstPragmaType () : m_e(ILLEGAL) {}
inline AstPragmaType (en _e) : m_e(_e) {}
explicit inline AstPragmaType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -120,7 +121,7 @@ public:
TRACE_CHANGE_SUB
};
enum en m_e;
inline AstCFuncType () {}
inline AstCFuncType () : m_e(FT_NORMAL) {}
inline AstCFuncType (en _e) : m_e(_e) {}
explicit inline AstCFuncType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -188,7 +189,7 @@ public:
};
return names[m_e];
};
inline AstEdgeType () {}
inline AstEdgeType () : m_e(ET_ILLEGAL) {}
inline AstEdgeType (en _e) : m_e(_e) {}
explicit inline AstEdgeType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -202,6 +203,7 @@ public:
class AstAttrType {
public:
enum en {
ILLEGAL,
EXPR_BITS, // V3Const converts to constant
//
VAR_BASE, // V3LinkResolve creates for AstPreSel, V3LinkParam removes
@@ -217,14 +219,14 @@ public:
enum en m_e;
const char* ascii() const {
static const char* names[] = {
"EXPR_BITS", "VAR_BASE",
"%E-AT", "EXPR_BITS", "VAR_BASE",
"VAR_CLOCK", "VAR_CLOCK_ENABLE", "VAR_PUBLIC",
"VAR_PUBLIC_FLAT", "VAR_PUBLIC_FLAT_RD","VAR_PUBLIC_FLAT_RW",
"VAR_ISOLATE_ASSIGNMENTS", "VAR_SFORMAT"
};
return names[m_e];
};
inline AstAttrType () {}
inline AstAttrType () : m_e(ILLEGAL) {}
inline AstAttrType (en _e) : m_e(_e) {}
explicit inline AstAttrType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -238,6 +240,7 @@ public:
class AstBasicDTypeKwd {
public:
enum en {
UNKNOWN,
BIT, BYTE, CHANDLE, INT, INTEGER, LOGIC, LONGINT,
DOUBLE, SHORTINT, FLOAT, TIME,
// Closer to a class type, but limited usage
@@ -250,6 +253,7 @@ public:
enum en m_e;
const char* ascii() const {
static const char* names[] = {
"%E-unk",
"bit", "byte", "chandle", "int", "integer", "logic", "longint",
"real", "shortint", "shortreal", "time",
"string",
@@ -260,6 +264,7 @@ public:
};
const char* dpiType() const {
static const char* names[] = {
"%E-unk",
"unsigned char", "char", "void*", "int", "int", "svLogic", "long long",
"double", "short int", "float", "long long",
"const char*",
@@ -268,7 +273,7 @@ public:
};
return names[m_e];
};
inline AstBasicDTypeKwd () {}
inline AstBasicDTypeKwd () : m_e(UNKNOWN) {}
inline AstBasicDTypeKwd (en _e) : m_e(_e) {}
explicit inline AstBasicDTypeKwd (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -351,7 +356,7 @@ public:
XTEMP
};
enum en m_e;
inline AstVarType () {}
inline AstVarType () : m_e(UNKNOWN) {}
inline AstVarType (en _e) : m_e(_e) {}
explicit inline AstVarType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -409,7 +414,7 @@ public:
CT_CASEZ
};
enum en m_e;
inline AstCaseType () {}
inline AstCaseType () : m_e(CT_CASE) {}
inline AstCaseType (en _e) : m_e(_e) {}
explicit inline AstCaseType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -431,7 +436,7 @@ public:
DT_FATAL
};
enum en m_e;
inline AstDisplayType () {}
inline AstDisplayType () : m_e(DT_DISPLAY) {}
inline AstDisplayType (en _e) : m_e(_e) {}
explicit inline AstDisplayType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
@@ -641,7 +646,7 @@ public:
AstNRelinker() { m_backp=NULL; m_chg=RELINK_BAD; m_iterpp=NULL;}
void relink(AstNode* newp);
AstNode* oldp() const { return m_oldp; }
void dump(ostream& str=cout);
void dump(ostream& str=cout) const;
};
inline ostream& operator<<(ostream& os, AstNRelinker& rhs) { rhs.dump(os); return os;}
@@ -754,6 +759,7 @@ class AstNode {
void deleteTreeIter();
void deleteNode();
static void relinkOneLink(AstNode*& pointpr, AstNode* newp);
// cppcheck-suppress functionConst
void debugTreeChange(const char* prefix, int lineno, bool next);
protected:
@@ -945,7 +951,7 @@ public:
bool sameTree(AstNode* node2p); // Does tree of this == node2p?
void deleteTree(); // Always deletes the next link
void checkTree(); // User Interface version
void dumpPtrs(ostream& str=cout);
void dumpPtrs(ostream& str=cout) const;
void dumpTree(ostream& str=cout, const string& indent=" ", int maxDepth=0);
void dumpTreeAndNext(ostream& str=cout, const string& indent=" ", int maxDepth=0);
void dumpTreeFile(const string& filename, bool append=false);
@@ -1012,6 +1018,7 @@ struct AstNodeTermop : public AstNodeMath {
ASTNODE_BASE_FUNCS(NodeTermop)
// Know no children, and hot function, so skip iterator for speed
// See checkTreeIter also that asserts no children
// cppcheck-suppress functionConst
void iterateChildren(AstNVisitor& v, AstNUser* vup=NULL) { }
};
@@ -1274,6 +1281,7 @@ public:
void packagep(AstPackage* nodep) { m_packagep=nodep; }
// Know no children, and hot function, so skip iterator for speed
// See checkTreeIter also that asserts no children
// cppcheck-suppress functionConst
void iterateChildren(AstNVisitor& v, AstNUser* vup=NULL) { }
};
+3 -3
View File
@@ -461,10 +461,10 @@ public:
virtual V3Hash sameHash() const { return V3Hash(); }
virtual bool same(AstNode* samep) const { return true; }
virtual int instrCount() const { return widthInstrs(); }
unsigned length() { return m_length; }
unsigned length() const { return m_length; }
void length(unsigned length) { m_length = length; }
void start(unsigned start) { m_start = start; }
unsigned start() { return m_start; }
unsigned start() const { return m_start; }
// Special operators
static int dimension(AstNode* nodep); ///< How many dimensions is this reference from the base variable?
static AstNode* baseFromp(AstNode* nodep); ///< What is the base variable (or const) this dereferences?
@@ -3465,7 +3465,7 @@ struct AstBufIf1 : public AstNodeBiop {
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opBufIf1(lhs,rhs); }
virtual string emitVerilog() { return "bufif(%r,%l)"; }
virtual string emitC() { V3ERROR_NA; return "";} // Lclean || Rclean
virtual string emitSimpleOperator() { V3ERROR_NA; return false;} // Lclean || Rclean
virtual string emitSimpleOperator() { V3ERROR_NA; return "";} // Lclean || Rclean
virtual bool cleanOut() {V3ERROR_NA; return "";} // Lclean || Rclean
virtual bool cleanLhs() {return false;} virtual bool cleanRhs() {return false;}
virtual bool sizeMattersLhs() {return false;} virtual bool sizeMattersRhs() {return false;}
+2 -2
View File
@@ -452,10 +452,10 @@ private:
if (isCaseTreeFast(nodep) && v3Global.opt.oCase()) {
// It's a simple priority encoder or complete statement
// we can make a tree of statements to avoid extra comparisons
m_statCaseFast++;
++m_statCaseFast;
replaceCaseFast(nodep); nodep=NULL;
} else {
m_statCaseSlow++;
++m_statCaseSlow;
replaceCaseComplicated(nodep); nodep=NULL;
}
}
+2 -1
View File
@@ -315,6 +315,7 @@ public:
m_exprp = exprp;
m_original = original;
m_state = STATE_UNKNOWN;
m_cloning = false;
if (debug()>=9) nodep->dumpTree(cout," GateBodyIn: ");
nodep->bodysp()->iterateAndNext(*this);
if (debug()>=9) nodep->dumpTree(cout," GateBodyOut: ");
@@ -696,7 +697,7 @@ class GaterVisitor : public GaterBaseVisitor {
// Blow old statements from new body
GaterBodyVisitor(alwp,exprp,false);
m_statGaters++;
++m_statGaters;
if (debug()>=9) alwp->dumpTree(cout," new: ");
}
+6 -4
View File
@@ -70,8 +70,8 @@ protected:
virtual ~CombBaseVisitor() {}
//***** optimization levels
bool emptyFunctionDeletion() { return true; }
bool duplicateFunctionCombine() { return true; }
static bool emptyFunctionDeletion() { return true; }
static bool duplicateFunctionCombine() { return true; }
// Note this is disabled, it still needed work
// Also repair it for DPI functions; when make __common need to insure proper
// flags get inherited from the old to new AstCFunc, and that AstText doesn't
@@ -146,7 +146,9 @@ private:
}
public:
// CONSTRUCTORS
CombCallVisitor() {}
CombCallVisitor() {
m_find = false;
}
virtual ~CombCallVisitor() {}
void main(AstNetlist* nodep) {
nodep->accept(*this);
@@ -257,7 +259,7 @@ private:
UINFO(5," DupFunc "<<hex<<V3Hash(newfuncp->user4p())<<" "<<newfuncp<<endl);
UINFO(5," and "<<hex<<V3Hash(oldfuncp->user4p())<<" "<<oldfuncp<<endl);
// Mark user3p on entire old tree, so we don't process it more
m_statCombs++;
++m_statCombs;
CombMarkVisitor visitor(oldfuncp);
m_call.replaceFunc(oldfuncp, newfuncp);
oldfuncp->unlinkFrBack();
+8 -2
View File
@@ -821,7 +821,9 @@ private:
AstNodeAssign* asn2ap=nodep->cloneType(lc2p, sel2p)->castNodeAssign();
asn1ap->width(msb1-lsb1+1,msb1-lsb1+1);
asn2ap->width(msb2-lsb2+1,msb2-lsb2+1);
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn1ap);
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn2ap);
} else {
if (!m_modp) nodep->v3fatalSrc("Not under module");
@@ -852,12 +854,16 @@ private:
asn2ap->width(msb2-lsb2+1,msb2-lsb2+1);
asn2bp->width(msb2-lsb2+1,msb2-lsb2+1);
// This order matters
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn1ap);
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn2ap);
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn1bp);
// cppcheck-suppress nullPointer // addNext deals with it
newp = newp->addNext(asn2bp);
}
if (debug()>=9) newp->dumpTreeAndNext(cout," _new: ");
if (debug()>=9 && newp) newp->dumpTreeAndNext(cout," _new: ");
nodep->addNextHere(newp);
// Cleanup
nodep->unlinkFrBack()->deleteTree(); nodep=NULL;
@@ -1534,7 +1540,7 @@ private:
UINFO(9," DispConst: "<<fmt<<" -> "<<out<<" for "<<argp<<endl);
{ // fmt = out w/ replace % with %% as it must be literal.
fmt = "";
for (string::iterator pos = out.begin(); pos != out.end(); pos++) {
for (string::iterator pos = out.begin(); pos != out.end(); ++pos) {
if (*pos == '%') fmt += '%';
fmt += *pos;
}
+1 -1
View File
@@ -97,7 +97,7 @@ private:
removep->unlinkFrBack(); pushDeletep(removep); removep=NULL;
// Remove node from comparison so don't hit it again
hashed.erase(dupit);
m_statToggleJoins++;
++m_statToggleJoins;
}
}
}
+1 -3
View File
@@ -224,7 +224,6 @@ private:
}
//
//=== Setting/not setting boolean: __Vdlyvset__
bool sharedVset = false;
AstVarScope* setvscp;
if (nodep->user3p()) {
@@ -232,9 +231,8 @@ private:
// then we told this nodep->user3 we can use its Vdlyvset rather than making a new one.
// This is good for code like:
// for (i=0; i<5; i++) vector[i] <= something;
sharedVset = true;
setvscp = nodep->user3p()->castNode()->castVarScope();
m_statSharedSet++;
++m_statSharedSet;
} else { // Create new one
string setvarname = (string("__Vdlyvset__")+oldvarp->shortName()+"__v"+cvtToStr(modVecNum));
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1);
+5 -2
View File
@@ -55,9 +55,9 @@ public:
}
// ACCESSORS
int splitFilenum() { return m_splitFilenum; }
int splitFilenum() const { return m_splitFilenum; }
int splitFilenumInc() { m_splitSize = 0; return ++m_splitFilenum; }
int splitSize() { return m_splitSize; }
int splitSize() const { return m_splitSize; }
void splitSizeInc(AstNode* nodep) { m_splitSize += EmitCBaseCounterVisitor(nodep).count(); }
bool splitNeeded() { return (splitSize() && v3Global.opt.outputSplit() > 1
&& v3Global.opt.outputSplit() < splitSize()); }
@@ -830,6 +830,8 @@ class EmitCImp : EmitCStmts {
public:
EmitCImp() {
m_modp = NULL;
m_slow = false;
m_fast = false;
}
virtual ~EmitCImp() {}
void main(AstNodeModule* modp, bool slow, bool fast);
@@ -1424,6 +1426,7 @@ void EmitCImp::emitStaticDecl(AstNodeModule* modp) {
// Need implementation here. Be careful of alignment code; needs to be uniquified
// with module name to avoid multiple symbols.
//emitVarList(modp->stmtsp(), EVL_ALL, modp->name());
puts(""); // NOP for cppcheck, otherwise const function
}
void EmitCImp::emitTextSection(AstType type) {
+2 -2
View File
@@ -526,8 +526,8 @@ void EmitCSyms::emitDpiHdr() {
puts("#endif\n");
puts("\n");
bool firstExp = false;
bool firstImp = false;
int firstExp = 0;
int firstImp = 0;
for (vector<AstCFunc*>::iterator it = m_dpis.begin(); it != m_dpis.end(); ++it) {
AstCFunc* nodep = *it;
if (nodep->dpiExportWrapper()) {
+1 -1
View File
@@ -370,7 +370,7 @@ void V3Error::suppressThisWarning() {
}
void V3Error::v3errorEnd (ostringstream& sstr) {
#ifdef __COVERITY__
#if defined(__COVERITY__) || defined(__cppcheck__)
if (s_errorCode==V3ErrorCode::EC_FATAL) __coverity_panic__(x);
#endif
if (!s_errorSuppressed
+2 -2
View File
@@ -90,7 +90,7 @@ public:
// ***Add new elements below also***
};
enum en m_e;
inline V3ErrorCode () {}
inline V3ErrorCode () : m_e(EC_MIN) {}
inline V3ErrorCode (en _e) : m_e(_e) {}
V3ErrorCode (const char* msgp); // Matching code or ERROR
explicit inline V3ErrorCode (int _e) : m_e(static_cast<en>(_e)) {}
@@ -315,7 +315,7 @@ public:
// OPERATORS
void v3errorEnd(ostringstream& str);
inline bool operator==(FileLine rhs) {
inline bool operator==(FileLine rhs) const {
return (m_lineno==rhs.m_lineno && m_filename==rhs.m_filename && m_warnOn==rhs.m_warnOn);
}
};
+3
View File
@@ -327,6 +327,7 @@ private:
#endif
}
// cppcheck-suppress functionConst
void checkFilter(bool hang) {
#ifdef INFILTER_PIPE
if (!m_pidExited && waitpid(m_pid, &m_pidStatus, hang?0:WNOHANG)) {
@@ -355,6 +356,7 @@ private:
|| errno == EWOULDBLOCK
#endif
) {
// cppcheck-suppress obsoleteFunctionsusleep
checkFilter(false); usleep(1000); continue;
} else { m_readEof = true; break; }
}
@@ -390,6 +392,7 @@ private:
|| errno == EWOULDBLOCK
#endif
) {
// cppcheck-suppress obsoleteFunctionsusleep
checkFilter(false); usleep(1000); continue;
}
else break;
+2 -2
View File
@@ -535,7 +535,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
AstNode* substp = okVisitor.substTree();
if (debug()>=5) logicp->dumpTree(cout,"\telimVar: ");
if (debug()>=5) substp->dumpTree(cout,"\t subst: ");
m_statSigs++;
++m_statSigs;
while (V3GraphEdge* edgep = vvertexp->outBeginp()) {
GateLogicVertex* consumeVertexp = dynamic_cast<GateLogicVertex*>(edgep->top());
AstNode* consumerp = consumeVertexp->nodep();
@@ -557,7 +557,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
}
// Remove the edge
edgep->unlinkDelete(); edgep=NULL;
m_statRefs++;
++m_statRefs;
}
// Remove input links
while (V3GraphEdge* edgep = vvertexp->inBeginp()) {
+4 -4
View File
@@ -70,7 +70,7 @@ private:
// MEMBERS
uint32_t m_step; // Processing step, so we can avoid clearUser all the time
HashMap m_hashMap; // Dfa Vertex for each set of NFA vertexes
int debug() { return 0; }
static int debug() { return 0; }
// METHODS
DfaGraph* graphp() { return static_cast<DfaGraph*>(m_graphp); }
@@ -94,7 +94,7 @@ private:
}
// Hashing
uint32_t hashVertex(V3GraphVertex* vertexp) {
static uint32_t hashVertex(V3GraphVertex* vertexp) {
union { void* up; struct {uint32_t upper; uint32_t lower;} l;} u;
u.l.upper=0; u.l.lower=0; u.up=vertexp;
return u.l.upper ^ u.l.lower;
@@ -362,7 +362,7 @@ void DfaGraph::nfaToDfa() {
class DfaGraphReduce : GraphAlg {
private:
// METHODS
int debug() { return 0; }
static int debug() { return 0; }
DfaGraph* graphp() { return static_cast<DfaGraph*>(m_graphp); }
bool isDead(DfaVertex* vertexp) {
@@ -507,7 +507,7 @@ private:
DfaVertex* m_tempNewerReject;
// METHODS
int debug() { return 9; }
static int debug() { return 9; }
DfaGraph* graphp() { return static_cast<DfaGraph*>(m_graphp); }
void add_complement_edges() {
+1
View File
@@ -326,6 +326,7 @@ public:
class V3GraphTestImport : public V3GraphTest {
// cppcheck-suppress functionConst
void dotImport();
public:
+1 -1
View File
@@ -106,7 +106,7 @@ private:
if (m_cellp) nodep->v3error("Cloning should have already been done bottom-up");
UINFO(5," Inline CELL "<<nodep<<endl);
UINFO(5," To MOD "<<m_modp<<endl);
m_statCells++;
++m_statCells;
// Before cloning simplify pin assignments
// Better off before, as if module has multiple instantiations
+3
View File
@@ -293,6 +293,7 @@ private:
// LIFE MAP
// For each basic block, we'll make a new map of what variables that if/else is changing
typedef std::map<AstVarScope*, LifeVarEntry> LifeMap;
// cppcheck-suppress memleak // cppcheck bug - it is deleted
LifeBlock* m_lifep; // Current active lifetime map for current scope
// METHODS
@@ -455,6 +456,8 @@ public:
m_sideEffect = false;
m_noopt = false;
{
// Cpp check bug, it is deleted
// cppcheck-suppress leak
m_lifep = new LifeBlock (NULL, m_statep);
nodep->accept(*this);
delete m_lifep; m_lifep=NULL;
+1 -1
View File
@@ -157,7 +157,7 @@ private:
// Mark so LifePostElimVisitor will get it
rhsp->varScopep()->user4p(lhsp->varScopep());
nodep->unlinkFrBack()->deleteTree(); nodep=NULL;
m_statAssnDel++;
++m_statAssnDel;
}
}
}
+7 -4
View File
@@ -60,7 +60,7 @@ private:
T m_nextp; // Pointer to next element, NULL=end
T m_prevp; // Pointer to previous element, NULL=beginning
friend class V3List<T>;
static V3ListEnt* baseToListEnt(void* newbasep, uint32_t offset) {
static V3ListEnt* baseToListEnt(void* newbasep, size_t offset) {
// "this" must be a element inside of *basep
// Use that to determine a structure offset, then apply to the new base
// to get our new pointer information
@@ -80,7 +80,8 @@ public:
// METHODS
void pushBack (V3List<T>& listr, T newp) {
// "this" must be a element inside of *newp
uint32_t offset = (vluint8_t*)(this) - (vluint8_t*)(newp);
// cppcheck-suppress thisSubtraction
size_t offset = (vluint8_t*)(this) - (vluint8_t*)(newp);
m_nextp = NULL;
if (!listr.m_headp) listr.m_headp = newp;
m_prevp = listr.m_tailp;
@@ -89,7 +90,8 @@ public:
}
void pushFront (V3List<T>& listr, T newp) {
// "this" must be a element inside of *newp
uint32_t offset = (vluint8_t*)(this) - (vluint8_t*)(newp);
// cppcheck-suppress thisSubtraction
size_t offset = (vluint8_t*)(this) - (vluint8_t*)(newp);
m_nextp = listr.m_headp;
if (m_nextp) baseToListEnt(m_nextp,offset)->m_prevp = newp;
listr.m_headp = newp;
@@ -99,7 +101,8 @@ public:
// Unlink from side
void unlink (V3List<T>& listr, T oldp) {
// "this" must be a element inside of *oldp
uint32_t offset = (vluint8_t*)(this) - (vluint8_t*)(oldp);
// cppcheck-suppress thisSubtraction
size_t offset = (vluint8_t*)(this) - (vluint8_t*)(oldp);
if (m_nextp) baseToListEnt(m_nextp,offset)->m_prevp = m_prevp;
else listr.m_tailp = m_prevp;
if (m_prevp) baseToListEnt(m_prevp,offset)->m_nextp = m_nextp;
+1 -1
View File
@@ -141,7 +141,7 @@ private:
&& nodep->user1p()) { // Single cfunc
// We don't need to test for tracing; it would be in the tracefunc if it was needed
UINFO(4," ModVar->BlkVar "<<nodep<<endl);
m_statLocVars++;
++m_statLocVars;
AstCFunc* newfuncp = nodep->user1p()->castNode()->castCFunc();
nodep->unlinkFrBack();
newfuncp->addInitsp(nodep);
+4 -22
View File
@@ -33,28 +33,10 @@
// Read class functions
// CREATION
void V3Number::width(int width, bool sized) {
// Set width. Only set m_width here, as we need to tweak vector size
if (width) { m_sized = sized; m_width=width; }
else { m_sized = false; m_width=1; }
if (m_value.size() < (unsigned)(words()+1)) {
m_value.resize(words()+1);
m_valueX.resize(words()+1);
}
}
void V3Number::init (FileLine* fileline, int swidth) {
m_fileline = fileline;
m_signed = false;
m_double = false;
m_autoExtend = false;
m_fromString = false;
width(swidth);
for (int i=0; i<words(); i++) m_value[i]=m_valueX[i] = 0;
}
V3Number::V3Number(VerilogString, FileLine* fileline, const string& str) {
// Create a number using a verilog string as the value, thus 8 bits per character.
// cppcheck bug - doesn't see init() resets these
// cppcheck: Member variable 'm_sized/m_width' is not initialized in the constructor
init(fileline, str.length()*8);
m_fromString = true;
for (unsigned pos=0; pos<str.length(); ++pos) {
@@ -416,9 +398,9 @@ bool V3Number::displayedFmtLegal(char format) {
string V3Number::displayed(const string& vformat) const {
string::const_iterator pos = vformat.begin();
UASSERT(pos != vformat.end() && pos[0]=='%', "display with non format argument "<<*this);
pos++;
++pos;
string fmtsize;
for (; pos != vformat.end() && (isdigit(pos[0]) || pos[0]=='.'); pos++) {
for (; pos != vformat.end() && (isdigit(pos[0]) || pos[0]=='.'); ++pos) {
fmtsize += pos[0];
}
string str;
+21 -2
View File
@@ -42,7 +42,6 @@ class V3Number {
vector<uint32_t> m_value; // The Value, with bit 0 being in bit 0 of this vector (unless X/Z)
vector<uint32_t> m_valueX; // Each bit is true if it's X or Z, 10=z, 11=x
// METHODS
void init(FileLine* fileline, int width);
V3Number& setSingleBits(char value);
void opCleanThis();
public:
@@ -118,6 +117,27 @@ public:
V3Number(FileLine* fileline, const char* source); // Create from a verilog 32'hxxxx number.
V3Number(VerilogString, FileLine* fileline, const string& vvalue);
private:
void init(FileLine* fileline, int swidth) {
m_fileline = fileline;
m_signed = false;
m_double = false;
m_autoExtend = false;
m_fromString = false;
width(swidth);
for (int i=0; i<words(); i++) m_value[i]=m_valueX[i] = 0;
}
public:
void width(int width, bool sized=true) {
// Set width. Only set m_width here, as we need to tweak vector size
if (width) { m_sized = sized; m_width=width; }
else { m_sized = false; m_width=1; }
if (VL_UNLIKELY(m_value.size() < (unsigned)(words()+1))) {
m_value.resize(words()+1);
m_valueX.resize(words()+1);
}
}
// SETTERS
V3Number& setAllBitsX();
V3Number& setAllBitsZ();
@@ -147,7 +167,6 @@ public:
bool isEqAllOnes(int optwidth=0) const;
bool isCaseEq(const V3Number& rhsp) const; // operator==
bool isLt(const V3Number& rhsp) const; // operator<
void width(int width, bool sized=true);
void isSigned(bool ssigned) { m_signed=ssigned; }
bool isUnknown() const;
uint32_t toUInt() const;
+7 -1
View File
@@ -528,6 +528,11 @@ string V3Options::version() {
return ver;
}
void V3Options::throwSigsegv() {
// cppcheck-suppress nullPointer
char* zp=NULL; *zp=0;
}
//######################################################################
// V3 Options utilities
@@ -643,7 +648,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
else if ( onoff (sw, "-covsp", flag/*ref*/) ) { } // TBD
else if ( !strcmp (sw, "-debug-abort") ) { abort(); } // Undocumented, see also --debug-sigsegv
else if ( onoff (sw, "-debug-check", flag/*ref*/) ){ m_debugCheck = flag; }
else if ( !strcmp (sw, "-debug-sigsegv") ) { char* zp=NULL; *zp=0; } // Undocumented, see also --debug-abort
else if ( !strcmp (sw, "-debug-sigsegv") ) { throwSigsegv(); } // Undocumented, see also --debug-abort
else if ( !strcmp (sw, "-debug-fatalsrc") ) { v3fatalSrc("--debug-fatal-src"); } // Undocumented, see also --debug-abort
else if ( onoff (sw, "-dump-tree", flag/*ref*/) ) { m_dumpTree = flag; }
else if ( onoff (sw, "-exe", flag/*ref*/) ) { m_exe = flag; }
@@ -973,6 +978,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
break; // Ignore to EOL
} else if (*pos=='/' && *(pos+1)=='*') {
inCmt = true;
// cppcheck-suppress StlMissingComparison
++pos;
} else {
oline += *pos;
+3
View File
@@ -347,6 +347,9 @@ class V3Options {
string filePath (FileLine* fl, const string& modname, const string& errmsg);
static bool fileStatDir (const string& filename);
static bool fileStatNormal (const string& filename);
// METHODS (other OS)
static void throwSigsegv();
};
//######################################################################
+6 -3
View File
@@ -148,7 +148,7 @@ private:
public:
OrderMoveDomScope(OrderLoopId inLoop, AstSenTree* domainp, AstScope* scopep)
: m_onReadyList(false), m_domainp(domainp), m_inLoop(inLoop) {}
: m_onReadyList(false), m_domainp(domainp), m_scopep(scopep), m_inLoop(inLoop) {}
OrderMoveDomScope* readyDomScopeNextp() const { return m_readyDomScopeE.nextp(); }
OrderLoopId inLoop() const { return m_inLoop; }
AstSenTree* domainp() const { return m_domainp; }
@@ -391,8 +391,8 @@ private:
void nodeMarkCircular(OrderVarVertex* vertexp, OrderEdge* edgep) {
AstVarScope* nodep = vertexp->varScp();
nodep->circular(true);
m_statCut[vertexp->type()]++;
if (edgep) m_statCut[edgep->type()]++;
++m_statCut[vertexp->type()];
if (edgep) ++m_statCut[edgep->type()];
if (vertexp->isClock()) {
// Seems obvious; no warning yet
//nodep->v3warn(GENCLK,"Signal unoptimizable: Generated clock: "<<nodep->prettyName());
@@ -715,6 +715,9 @@ public:
m_settleDomainp = NULL;
m_settleVxp = NULL;
m_inputsVxp = NULL;
m_activeSenVxp = NULL;
m_logicVxp = NULL;
m_pomNewFuncp = NULL;
m_loopIdMax = LOOPID_FIRST;
m_pomNewStmts = 0;
if (debug()) m_graph.debug(5); // 3 is default if global debug; we want acyc debugging
+1 -1
View File
@@ -105,7 +105,7 @@ struct OrderVEdgeType {
return names[m_e];
}
enum en m_e;
inline OrderVEdgeType () {}
inline OrderVEdgeType () : m_e(VERTEX_UNKNOWN) {}
inline OrderVEdgeType (en _e) : m_e(_e) {}
explicit inline OrderVEdgeType (int _e) : m_e(static_cast<en>(_e)) {}
operator en () const { return m_e; }
+9 -8
View File
@@ -257,7 +257,7 @@ public:
double parseDouble(const char* text, size_t length);
void pushBeginKeywords(int state) { m_inBeginKwd++; m_lastVerilogState=state; }
bool popBeginKeywords() { if (m_inBeginKwd) { m_inBeginKwd--; return true; } else return false; }
int lastVerilogState() { return m_lastVerilogState; }
int lastVerilogState() const { return m_lastVerilogState; }
static const char* tokenName(int tok);
void ppPushText(const string& text) { m_ppBuffers.push_back(text); }
@@ -291,12 +291,12 @@ public:
}
// Return next token, for bison, since bison isn't class based, use a global THIS
FileLine* fileline() { return m_fileline; }
AstNetlist* rootp() { return m_rootp; }
FileLine* fileline() const { return m_fileline; }
AstNetlist* rootp() const { return m_rootp; }
FileLine* copyOrSameFileLine() { return fileline()->copyOrSameFileLine(); }
bool inCellDefine() { return m_inCellDefine; }
bool inCellDefine() const { return m_inCellDefine; }
void inCellDefine(bool flag) { m_inCellDefine = flag; }
bool inLibrary() { return m_inLibrary; }
bool inLibrary() const { return m_inLibrary; }
// Interactions with parser
int bisonParse();
@@ -306,8 +306,8 @@ public:
void lexDestroy();
void stateExitPsl(); // Parser -> lexer communication
void statePushVlg(); // Parser -> lexer communication
void statePop(); // Parser -> lexer communication
int stateVerilogRecent(); // Parser -> lexer communication
void statePop(); // Parser -> lexer communication
static int stateVerilogRecent(); // Parser -> lexer communication
size_t flexPpInputToLex(char* buf, size_t max_size) { return ppInputToLex(buf,max_size); }
//==== Symbol tables
@@ -316,7 +316,8 @@ public:
public:
// CREATORS
V3ParseImp(AstNetlist* rootp, V3InFilter* filterp)
: m_sym(rootp), m_filterp(filterp) {
: m_filterp(filterp), m_sym(rootp) {
m_fileline = NULL;
m_rootp = rootp; m_lexerp = NULL;
m_inCellDefine = false;
m_inLibrary = false;
+1 -1
View File
@@ -62,7 +62,7 @@ public:
void V3ParseImp::stateExitPsl() { parsep()->m_lexerp->stateExitPsl(); }
void V3ParseImp::statePushVlg() { parsep()->m_lexerp->stateExitPsl(); }
void V3ParseImp::statePop() { parsep()->m_lexerp->statePop(); }
int V3ParseImp::yylexThis() { parsep()->m_lexerp->yylex(); }
int V3ParseImp::yylexThis() { return parsep()->m_lexerp->yylex(); }
//######################################################################
// Read class functions
+1 -1
View File
@@ -203,7 +203,7 @@ class V3PreLex {
/// Called by V3PreProc.cpp to get data from lexer
YY_BUFFER_STATE currentBuffer();
int lex();
int currentStartState();
int currentStartState() const;
void dumpSummary();
void dumpStack();
void unused();
+2 -1
View File
@@ -488,7 +488,7 @@ YY_BUFFER_STATE V3PreLex::currentBuffer() {
return YY_CURRENT_BUFFER;
}
int V3PreLex::currentStartState() {
int V3PreLex::currentStartState() const {
return YY_START;
}
@@ -538,6 +538,7 @@ void V3PreLex::unused() {
if (0) {
// Prevent unused warnings
yy_top_state();
yyerror((char*)"");
}
}
+5 -1
View File
@@ -127,7 +127,7 @@ struct V3PreProcImp : public V3PreProc {
ps_DEFNAME_IFDEF, ps_DEFNAME_IFNDEF, ps_DEFNAME_ELSIF,
ps_DEFFORM, ps_DEFVALUE, ps_DEFPAREN, ps_DEFARG,
ps_INCNAME, ps_ERRORNAME, ps_JOIN, ps_STRIFY };
const char* procStateName(ProcState s) {
static const char* procStateName(ProcState s) {
static const char* states[]
= {"ps_TOP",
"ps_DEFNAME_UNDEF", "ps_DEFNAME_DEFINE",
@@ -251,6 +251,10 @@ public:
m_finAtBol = true;
m_defDepth = 0;
m_defPutJoin = false;
m_finToken = 0;
m_finFilelinep = NULL;
m_lexp = NULL;
m_preprocp = NULL;
}
void configure(FileLine* filelinep) {
// configure() separate from constructor to avoid calling abstract functions
+4 -4
View File
@@ -67,10 +67,10 @@ public:
// CONTROL METHODS
// These options control how the parsing proceeds
int keepComments() { return 2; } // Return comments, 0=no, 1=yes, 2=callback
bool keepWhitespace() { return false; }
bool lineDirectives() { return true; } // Insert `line directives
bool pedantic() { return false; } // Obey standard; Don't substitute `error
static int keepComments() { return 2; } // Return comments, 0=no, 1=yes, 2=callback
static bool keepWhitespace() { return false; }
static bool lineDirectives() { return true; } // Insert `line directives
static bool pedantic() { return false; } // Obey standard; Don't substitute `error
static bool optPsl();
// CALLBACK METHODS
+1 -1
View File
@@ -413,7 +413,7 @@ private:
newListp = newListp->addNext(nextp);
}
if (splitAlwaysp) {
m_statSplits++;
++m_statSplits;
AstAlways* alwaysp = new AstAlways(newListp->fileline(), NULL, NULL);
addAfterp->addNextHere(alwaysp); addAfterp=alwaysp;
alwaysp->addStmtp(newListp);
+1 -1
View File
@@ -185,7 +185,7 @@ private:
// Now isolate the always
if (m_splitVscp) {
splitAlways(nodep);
m_statSplits++;
++m_statSplits;
} else {
nodep->user1(true);
}
+1 -1
View File
@@ -309,7 +309,7 @@ private:
if (debug()>5) newp->dumpTree(cout," w_new: ");
nodep->replaceWith(newp);
pushDeletep(nodep); nodep=NULL;
m_statSubsts++;
++m_statSubsts;
}
virtual void visit(AstWordSel* nodep, AstNUser*) {
nodep->rhsp()->accept(*this);
+2 -2
View File
@@ -176,8 +176,8 @@ public:
private:
void createTable(AstAlways* nodep) {
// We've determined this table of nodes is optimizable, do it.
m_modTables++;
m_statTablesCre++;
++m_modTables;
++m_statTablesCre;
// Index into our table
AstVar* indexVarp = new AstVar (nodep->fileline(), AstVarType::BLOCKTEMP,
+8 -8
View File
@@ -71,19 +71,19 @@ class TraceActivityVertex : public V3GraphVertex {
bool m_activityCodeValid;
bool m_slow; // If always slow, we can use the same code
public:
enum { ACTIVITY_NEVER =((1UL<<31) - 1) };
enum { ACTIVITY_ALWAYS=((1UL<<31) - 2) };
enum { ACTIVITY_SLOW=0 };
TraceActivityVertex(V3Graph* graphp, AstNode* nodep, bool slow)
: V3GraphVertex(graphp), m_insertp(nodep) {
m_activityCode = 0;
m_activityCodeValid = false;
m_slow = slow;
}
enum { ACTIVITY_NEVER =((1UL<<31) - 1) };
enum { ACTIVITY_ALWAYS=((1UL<<31) - 2) };
enum { ACTIVITY_SLOW=0 };
class ActivityAlways {};
TraceActivityVertex(V3Graph* graphp, vlsint32_t code)
: V3GraphVertex(graphp) {
activityCode(code);
: V3GraphVertex(graphp), m_insertp(NULL) {
m_activityCode = code;
m_activityCodeValid = true;
m_slow = false;
}
virtual ~TraceActivityVertex() {}
@@ -484,7 +484,7 @@ private:
nodep->code(m_code);
m_code += nodep->codeInc();
m_statUniqCodes += nodep->codeInc();
m_statUniqSigs++;
++m_statUniqSigs;
}
return nodep->code();
}
@@ -517,7 +517,7 @@ private:
if (!codePreassigned) {
// Add to trace cfuncs
if (needChg) {
m_statChgSigs++;
++m_statChgSigs;
incAddp = nodep->cloneTree(true);
}
+3 -2
View File
@@ -103,6 +103,7 @@ private:
} else {
basep->v3fatalSrc("Strange base function type");
}
// cppcheck-suppress nullPointer // above fatal prevents it
AstCCall* callp = new AstCCall(funcp->fileline(), funcp);
callp->argTypes("vlSymsp, vcdp, code");
basep->addStmtsp(callp);
@@ -137,12 +138,12 @@ private:
if (showname.substr(0,4) == "TOP ") showname.replace(0,4,"");
if (!m_initSubFuncp) nodep->v3fatalSrc("NULL");
if (varIgnoreTrace(varp)) {
m_statIgnSigs++;
++m_statIgnSigs;
m_initSubFuncp->addStmtsp(
new AstComment(nodep->fileline(),
"Tracing: "+showname+" // Ignored: "+varIgnoreTrace(varp)));
} else {
m_statSigs++;
++m_statSigs;
AstNode* valuep = NULL;
if (nodep->valuep()) valuep=nodep->valuep()->cloneTree(true);
else valuep = new AstVarRef(nodep->fileline(), nodep, false);
+2 -2
View File
@@ -76,8 +76,8 @@ public:
private:
// METHODS
inline bool bitNumOk(int bit) const { return (bit*FLAGS_PER_BIT < (int)m_flags.size()); }
inline bool usedFlag(int bit) { return m_usedWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_USED]; }
inline bool drivenFlag(int bit) { return m_drivenWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_DRIVEN]; }
inline bool usedFlag(int bit) const { return m_usedWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_USED]; }
inline bool drivenFlag(int bit) const { return m_drivenWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_DRIVEN]; }
enum BitNamesWhich { BN_UNUSED, BN_UNDRIVEN, BN_BOTH };
string bitNames(BitNamesWhich which) {
string bits="";
+1 -1
View File
@@ -289,7 +289,7 @@ private:
AstVar* newvarp
= new AstVar (nodep->fileline(), AstVarType::XTEMP, newvarname,
AstLogicPacked(), nodep->width());
m_statUnkVars++;
++m_statUnkVars;
AstNRelinker replaceHandle;
nodep->unlinkFrBack(&replaceHandle);
AstNodeVarRef* newref1p = new AstVarRef(nodep->fileline(), newvarp, false);
+5 -2
View File
@@ -241,14 +241,17 @@ private:
}
if (precondsp) {
precondsp->unlinkFrBackWithNext();
// cppcheck-suppress nullPointer // addNextNull deals with it
stmtsp = stmtsp->addNextNull(precondsp);
}
if (bodysp) {
bodysp->unlinkFrBackWithNext();
// cppcheck-suppress nullPointer // addNextNull deals with it
stmtsp = stmtsp->addNextNull(bodysp); // Maybe null if no body
}
if (incp && !nodep->castGenFor()) { // Generates don't need to increment loop index
incp->unlinkFrBackWithNext();
// cppcheck-suppress nullPointer // addNextNull deals with it
stmtsp = stmtsp->addNextNull(incp); // Maybe null if no body
}
// Mark variable to disable some later warnings
@@ -259,7 +262,7 @@ private:
loopValue.opAssign(numInit);
AstNode* newbodysp = NULL;
m_statLoops++;
++m_statLoops;
if (stmtsp) {
int times = 0;
while (1) {
@@ -287,7 +290,7 @@ private:
if (newbodysp) newbodysp->addNext(oneloopp);
else newbodysp = oneloopp;
m_statIters++;
++m_statIters;
if (++times > unrollCount()*3) {
nodep->v3error("Loop unrolling took too long; probably this is an infinite loop, or set --unroll-count above "<<unrollCount());
break;
+6 -6
View File
@@ -642,10 +642,11 @@ private:
V3Width::widthParamsEdit(nodep->dtypep()); // MAY CHANGE dtypep()
AstBasicDType* basicp = nodep->dtypep()->basicp(); if (!basicp) nodep->v3fatalSrc("Unimplemented: Casting non-simple data type");
nodep->widthSignedFrom(basicp);
AstNode* newp = nodep->lhsp()->unlinkFrBack();
if (!basicp->isDouble() && !newp->isDouble()) {
widthCheck(nodep,"Cast",newp,nodep->width(),nodep->width(),true);
if (!basicp->isDouble() && !nodep->lhsp()->isDouble()) {
// Note widthCheck might modify nodep->lhsp()
widthCheck(nodep,"Cast",nodep->lhsp(),nodep->width(),nodep->width(),true);
}
AstNode* newp = nodep->lhsp()->unlinkFrBack();
if (basicp->numeric() == newp->numeric()) {
newp = newp; // Can just remove cast
} else if (basicp->isDouble() && !newp->isDouble()) {
@@ -687,7 +688,7 @@ private:
bool implicitParam = nodep->isParam() && bdtypep && bdtypep->implicit();
if (implicitParam) {
AstNumeric rs = AstNumeric::UNSIGNED;
int width=0; int mwidth=0;
int width=0;
if (nodep->valuep()) {
nodep->valuep()->iterateAndNext(*this,WidthVP(width,0,PRELIM).p());
// Although nodep will get a different width for parameters just below,
@@ -697,11 +698,10 @@ private:
rs = nodep->numeric();
if (!rs.isDouble()) {
if (nodep->valuep()->widthSized()) {
width = mwidth = nodep->valuep()->width();
width = nodep->valuep()->width();
} else {
if (nodep->valuep()->width()>32) nodep->valuep()->v3warn(WIDTH,"Assigning >32 bit to unranged parameter (defaults to 32 bits)");
width = 32;
mwidth = nodep->valuep()->widthMin();
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@
//**********************************************************************
//**** Version and host name
#define DTVERSION "Verilator 3.820 2011/07/28"
#define DTVERSION "Verilator 3.821 2011/08/21"
//**********************************************************************
//**** Functions
+2 -1
View File
@@ -963,7 +963,8 @@ double V3ParseImp::parseDouble(const char* textp, size_t length) {
*dp++ = '\0';
char* endp = strgp;
double d = strtod(strgp, &endp);
if ((endp-strgp) != length) { yyerrorf("Syntax error parsing real: %s",strgp); }
size_t parsed_len = endp-strgp;
if (parsed_len != length) { yyerrorf("Syntax error parsing real: %s",strgp); }
delete strgp;
return d;
}
+1 -1
View File
@@ -71,7 +71,7 @@ public:
m_varIO = AstVarType::UNKNOWN;
m_varDTypep = NULL;
m_pinNum = -1;
m_instModule;
m_instModule = "";
m_instParamp = NULL;
m_modp = NULL;
m_modTypeImpNum = 0;
+10 -1
View File
@@ -19,6 +19,8 @@ module t (/*AUTOARG*/
realtime uninit;
initial if (uninit != 0.0) $stop;
sub_cast_bug374 sub (.cyc5(cyc[4:0]), .*);
initial begin
// rtoi truncates
if ($rtoi(36.7) != 36) $stop;
@@ -132,5 +134,12 @@ module t (/*AUTOARG*/
$finish;
end
end
endmodule
module sub_cast_bug374(input clk, input [4:0] cyc5);
integer i;
always @(posedge clk) begin
i <= integer'(cyc5);
end
endmodule