[Pkg-electronics-commits] [verilator] 01/04: Imported Upstream version 3.870
أحمد المحمودي (Ahmed El-Mahmoudy)
aelmahmoudy at sabily.org
Sat Feb 14 07:39:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
aelmahmoudy-guest pushed a commit to branch experimental
in repository verilator.
commit 41606b7544700b3bf28f4b1278de559c6ba73d74
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at users.sourceforge.net>
Date: Sat Feb 14 09:07:33 2015 +0200
Imported Upstream version 3.870
---
Changes | 29 +-
Makefile.in | 5 +-
README | 2 +-
README.html | 2 +-
README.pdf | Bin 110434 -> 110705 bytes
TODO | 2 +-
bin/verilator | 4 +-
bin/verilator_coverage | 4 +-
bin/verilator_difftree | 2 +-
bin/verilator_includer | 2 +-
bin/verilator_profcfunc | 2 +-
configure | 312 ++++++++++++++++++++-
configure.ac | 47 +++-
include/verilated.cpp | 75 ++---
include/verilated.h | 6 +-
include/verilated.mk.in | 4 +-
include/verilated.v | 2 +-
include/verilated_config.h | 4 +-
include/verilated_config.h.in | 2 +-
include/verilated_cov.cpp | 7 +-
include/verilated_cov.h | 2 +-
include/verilated_cov_key.h | 2 +-
include/verilated_dpi.cpp | 4 +-
include/verilated_dpi.h | 2 +-
include/verilated_heavy.h | 7 +-
include/verilated_imp.h | 2 +-
include/verilated_save.cpp | 2 +-
include/verilated_save.h | 2 +-
include/verilated_sc.h | 2 +-
include/verilated_syms.h | 2 +-
include/verilated_vcd_c.cpp | 6 +-
include/verilated_vcd_c.h | 4 +-
include/verilated_vcd_sc.cpp | 2 +-
include/verilated_vcd_sc.h | 2 +-
include/verilated_vpi.cpp | 2 +-
include/verilated_vpi.h | 3 +-
include/verilatedos.h | 2 +-
include/vltstd/svdpi.h | 4 +-
internals.html | 2 +-
internals.pdf | Bin 195665 -> 195983 bytes
internals.pod | 2 +-
internals.txt | 2 +-
readme.pod | 2 +-
src/.gdbinit | 2 +-
src/Makefile.in | 2 +-
src/Makefile_obj.in | 19 +-
src/V3Active.cpp | 18 +-
src/V3Active.h | 2 +-
src/V3ActiveTop.cpp | 2 +-
src/V3ActiveTop.h | 2 +-
src/V3Assert.cpp | 17 +-
src/V3Assert.h | 2 +-
src/V3AssertPre.cpp | 2 +-
src/V3AssertPre.h | 2 +-
src/V3Ast.cpp | 2 +-
src/V3Ast.h | 2 +-
src/V3AstConstOnly.h | 2 +-
src/V3AstNodes.cpp | 5 +-
src/V3AstNodes.h | 21 +-
src/V3Begin.cpp | 2 +-
src/V3Begin.h | 2 +-
src/V3Branch.cpp | 2 +-
src/V3Branch.h | 2 +-
src/V3Broken.cpp | 2 +-
src/V3Broken.h | 2 +-
src/V3Case.cpp | 4 +-
src/V3Case.h | 2 +-
src/V3Cast.cpp | 2 +-
src/V3Cast.h | 2 +-
src/V3Cdc.cpp | 2 +-
src/V3Cdc.h | 2 +-
src/V3Changed.cpp | 213 +++++++++-----
src/V3Changed.h | 2 +-
src/V3Clean.cpp | 2 +-
src/V3Clean.h | 2 +-
src/V3ClkGater.cpp | 2 +-
src/V3ClkGater.h | 2 +-
src/V3Clock.cpp | 14 +-
src/V3Clock.h | 2 +-
src/V3Combine.cpp | 2 +-
src/V3Combine.h | 2 +-
src/V3Config.cpp | 2 +-
src/V3Config.h | 2 +-
src/V3Const.cpp | 2 +-
src/V3Const.h | 2 +-
src/V3Coverage.cpp | 2 +-
src/V3Coverage.h | 2 +-
src/V3CoverageJoin.cpp | 2 +-
src/V3CoverageJoin.h | 2 +-
src/V3Dead.cpp | 2 +-
src/V3Dead.h | 2 +-
src/V3Delayed.cpp | 2 +-
src/V3Delayed.h | 2 +-
src/V3Depth.cpp | 2 +-
src/V3Depth.h | 2 +-
src/V3DepthBlock.cpp | 2 +-
src/V3DepthBlock.h | 2 +-
src/V3Descope.cpp | 2 +-
src/V3Descope.h | 2 +-
src/V3EmitC.cpp | 13 +-
src/V3EmitC.h | 2 +-
src/V3EmitCBase.h | 2 +-
src/V3EmitCInlines.cpp | 2 +-
src/V3EmitCSyms.cpp | 3 +-
src/V3EmitMk.cpp | 2 +-
src/V3EmitMk.h | 2 +-
src/V3EmitV.cpp | 2 +-
src/V3EmitV.h | 2 +-
src/V3EmitXml.cpp | 2 +-
src/V3EmitXml.h | 2 +-
src/V3Error.cpp | 2 +-
src/V3Error.h | 2 +-
src/V3Expand.cpp | 2 +-
src/V3Expand.h | 2 +-
src/V3File.cpp | 2 +-
src/V3File.h | 2 +-
src/V3FileLine.cpp | 2 +-
src/V3FileLine.h | 2 +-
src/V3Gate.cpp | 97 +++++--
src/V3Gate.h | 2 +-
src/V3GenClk.cpp | 2 +-
src/V3GenClk.h | 2 +-
src/V3Global.h | 2 +-
src/V3Graph.cpp | 2 +-
src/V3Graph.h | 2 +-
src/V3GraphAcyc.cpp | 6 +-
src/V3GraphAlg.cpp | 2 +-
src/V3GraphAlg.h | 2 +-
src/V3GraphDfa.cpp | 4 +-
src/V3GraphDfa.h | 2 +-
src/V3GraphTest.cpp | 2 +-
src/V3Hashed.cpp | 2 +-
src/V3Hashed.h | 2 +-
src/V3Inline.cpp | 2 +-
src/V3Inline.h | 2 +-
src/V3Inst.cpp | 2 +-
src/V3Inst.h | 2 +-
src/V3LangCode.h | 2 +-
src/V3LanguageWords.h | 2 +-
src/V3Life.cpp | 6 +-
src/V3Life.h | 2 +-
src/V3LifePost.cpp | 2 +-
src/V3LifePost.h | 2 +-
src/V3LinkCells.cpp | 2 +-
src/V3LinkCells.h | 2 +-
src/V3LinkDot.cpp | 4 +-
src/V3LinkDot.h | 2 +-
src/V3LinkJump.cpp | 2 +-
src/V3LinkJump.h | 2 +-
src/V3LinkLValue.cpp | 2 +-
src/V3LinkLValue.h | 2 +-
src/V3LinkLevel.cpp | 2 +-
src/V3LinkLevel.h | 2 +-
src/V3LinkParse.cpp | 2 +-
src/V3LinkParse.h | 2 +-
src/V3LinkResolve.cpp | 2 +-
src/V3LinkResolve.h | 2 +-
src/V3List.h | 2 +-
src/V3Localize.cpp | 2 +-
src/V3Localize.h | 2 +-
src/V3Name.cpp | 2 +-
src/V3Name.h | 2 +-
src/V3Number.cpp | 2 +-
src/V3Number.h | 2 +-
src/V3Number_test.cpp | 2 +-
src/V3Options.cpp | 17 +-
src/V3Options.h | 2 +-
src/V3Order.cpp | 2 +-
src/V3Order.h | 2 +-
src/V3OrderGraph.h | 2 +-
src/V3Param.cpp | 3 +-
src/V3Param.h | 2 +-
src/V3Parse.h | 2 +-
src/V3ParseGrammar.cpp | 2 +-
src/V3ParseImp.cpp | 2 +-
src/V3ParseImp.h | 3 +-
src/V3ParseLex.cpp | 2 +-
src/V3ParseSym.h | 2 +-
src/V3PreLex.h | 2 +-
src/V3PreLex.l | 2 +-
src/V3PreProc.cpp | 3 +-
src/V3PreProc.h | 2 +-
src/V3PreShell.cpp | 2 +-
src/V3PreShell.h | 2 +-
src/V3Premit.cpp | 2 +-
src/V3Premit.h | 2 +-
src/V3Scope.cpp | 2 +-
src/V3Scope.h | 2 +-
src/V3SenTree.h | 2 +-
src/V3Simulate.h | 3 +-
src/V3Slice.cpp | 2 +-
src/V3Slice.h | 2 +-
src/V3Split.cpp | 4 +-
src/V3Split.h | 2 +-
src/V3SplitAs.cpp | 2 +-
src/V3SplitAs.h | 2 +-
src/V3Stats.cpp | 2 +-
src/V3Stats.h | 2 +-
src/V3StatsReport.cpp | 2 +-
src/V3String.cpp | 2 +-
src/V3String.h | 2 +-
src/V3Subst.cpp | 2 +-
src/V3Subst.h | 2 +-
src/V3SymTable.h | 2 +-
src/V3Table.cpp | 2 +-
src/V3Table.h | 2 +-
src/V3Task.cpp | 6 +-
src/V3Task.h | 2 +-
src/V3Trace.cpp | 2 +-
src/V3Trace.h | 2 +-
src/V3TraceDecl.cpp | 2 +-
src/V3TraceDecl.h | 2 +-
src/V3Tristate.cpp | 5 +-
src/V3Tristate.h | 2 +-
src/V3Undriven.cpp | 2 +-
src/V3Undriven.h | 2 +-
src/V3Unknown.cpp | 4 +-
src/V3Unknown.h | 2 +-
src/V3Unroll.cpp | 2 +-
src/V3Unroll.h | 2 +-
src/V3Width.cpp | 44 ++-
src/V3Width.h | 2 +-
src/V3WidthCommit.h | 4 +-
src/V3WidthSel.cpp | 2 +-
src/Verilator.cpp | 2 +-
src/VlcBucket.h | 2 +-
src/VlcMain.cpp | 4 +-
src/VlcOptions.h | 2 +-
src/VlcPoint.h | 2 +-
src/VlcSource.h | 2 +-
src/VlcTest.h | 2 +-
src/VlcTop.cpp | 2 +-
src/VlcTop.h | 2 +-
src/astgen | 2 +-
src/bisonpre | 2 +-
src/config_build.h | 4 +-
src/config_build.h.in | 2 +-
src/config_rev.h | 2 +-
src/config_rev.pl | 2 +-
src/cppcheck_filtered | 18 +-
src/flexfix | 2 +-
src/pod2latexfix | 2 +-
src/verilog.l | 2 +-
src/verilog.y | 23 +-
src/vlcovgen | 2 +-
test_c/Makefile | 2 +-
test_c/Makefile_obj | 2 +-
test_c/sim_main.cpp | 2 +-
test_regress/Makefile | 2 +-
test_regress/Makefile_obj | 2 +-
test_regress/driver.pl | 60 +++-
test_regress/t/t_EXAMPLE.v | 2 +-
.../t/{t_order_wireloop.pl => t_assign_inline.pl} | 13 +-
test_regress/t/t_assign_inline.v | 52 ++++
test_regress/t/t_bitsel_struct3.v | 30 +-
test_regress/t/t_cast.v | 6 +
test_regress/t/t_func.v | 2 +
test_regress/t/t_inst_misarray_bad.pl | 2 +-
test_regress/t/t_interface1_modport.v | 8 +
...r_wireloop.pl => t_interface1_modport_nansi.pl} | 15 +-
test_regress/t/t_lint_latch_bad.pl | 29 ++
test_regress/t/t_lint_latch_bad.v | 29 ++
test_regress/t/t_math_const.v | 26 +-
.../t/{t_order_wireloop.pl => t_math_signed6.pl} | 12 +-
test_regress/t/t_math_signed6.v | 36 +++
test_regress/t/t_mem_first.v | 3 +-
test_regress/t/t_mem_slice.v | 3 -
.../t/{t_order_wireloop.pl => t_order_2d.pl} | 12 +-
test_regress/t/{t_EXAMPLE.v => t_order_2d.v} | 55 ++--
test_regress/t/t_order_wireloop.pl | 6 +-
test_regress/t/t_order_wireloop.v | 7 +-
test_regress/t/t_param_array.v | 2 +-
...inst_misarray_bad.pl => t_select_bad_range3.pl} | 11 +-
test_regress/t/t_select_bad_range3.v | 19 ++
...wireloop.pl => t_slice_struct_array_modport.pl} | 13 +-
test_regress/t/t_slice_struct_array_modport.v | 17 ++
test_regress/t/t_sys_file_basic.v | 8 +
test_sc/Makefile | 2 +-
test_sc/Makefile_obj | 2 +-
test_sc/sc_main.cpp | 2 +-
test_verilated/sim_main.cpp | 2 +-
test_verilated/sim_main.v | 2 +-
test_verilated/vgen.pl | 2 +-
verilator.1 | 4 +-
verilator.html | 2 +-
verilator.pdf | Bin 386595 -> 386914 bytes
verilator.txt | 2 +-
verilator_coverage.1 | 2 +-
288 files changed, 1405 insertions(+), 611 deletions(-)
diff --git a/Changes b/Changes
index e549f08..9efe978 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,33 @@ 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.870 2015-02-12
+
+**** Suppress COMBDLY when inside always_latch, bug864. [Iztok Jeras]
+
+**** Support cast operator with expression size, bug865. [Iztok Jeras]
+
+**** Add warning on slice selection out of bounds, bug875. [Cong Van Nguyen].
+
+**** Fix member select error broke in 3.868, bug867. [Iztok Jeras]
+
+**** Fix $sccanf from string, bug866. [David Pierce]
+
+**** Fix VM_PARALLEL_BUILDS broke in 3.868, bug870. [Hiroki Honda]
+
+**** Fix non-ANSI modport instantiations, bug868. [Kevin Thompson]
+
+**** Fix UNOPTFLAT change detect on multidim arrays, bug872. [Andrew Bardsley]
+
+**** Fix slice connections of arrays to ports, bug880. [Varun Koyyalagunta]
+
+**** Fix mis-optimizing gate assignments in unopt blocks, bug881. [Mike Thyer]
+
+**** Fix sign extension of pattern members, bug882. [Iztok Jeras]
+
+**** Fix clang compile warnings.
+
+
* Verilator 3.868 2014-12-20
** New verilator_coverage program added to replace SystemPerl's vcoverage.
@@ -2503,7 +2530,7 @@ of input ports exists for tracing.
This uses outline mode in Emacs. See C-h m [M-x describe-mode].
-Copyright 2001-2014 by Wilson Snyder. This program is free software; you
+Copyright 2001-2015 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.
diff --git a/Makefile.in b/Makefile.in
index 166823d..890c683 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,7 +9,7 @@
#
#*****************************************************************************
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
@@ -406,7 +406,8 @@ endif
# Use --xml flag to see the cppcheck code to use for suppression
CPPCHECK = src/cppcheck_filtered
-CPPCHECK_FLAGS = --enable=all --inline-suppr --suppress=unusedScopedObject --suppress=cstyleCast
+CPPCHECK_FLAGS = --enable=all --inline-suppr \
+ --suppress=unusedScopedObject --suppress=cstyleCast --suppress=useInitializationList
CPPCHECK_FLAGS += --xml
CPPCHECK_CPP = $(wildcard $(srcdir)/include/*.cpp $(srcdir)/src/*.cpp)
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CPPCHECK_CPP))
diff --git a/README b/README
index 76e32ba..e6d15f0 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ NAME
DISTRIBUTION
- This package is Copyright 2003-2014 by Wilson Snyder. (Report bugs to
+ This package is Copyright 2003-2015 by Wilson Snyder. (Report bugs to
<http://www.veripool.org/>.)
Verilator is free software; you can redistribute it and/or modify it
diff --git a/README.html b/README.html
index 6cefc68..46d5753 100644
--- a/README.html
+++ b/README.html
@@ -39,7 +39,7 @@
</p>
<hr />
<h1><a name="distribution">DISTRIBUTION</a></h1>
-<p>This package is Copyright 2003-2014 by Wilson Snyder. (Report bugs to
+<p>This package is Copyright 2003-2015 by Wilson Snyder. (Report bugs to
<a href="http://www.veripool.org/">http://www.veripool.org/</a>.)</p>
<p>Verilator 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
diff --git a/README.pdf b/README.pdf
index 3c8acf5..c50b408 100644
Binary files a/README.pdf and b/README.pdf differ
diff --git a/TODO b/TODO
index 5c84ebe..688f642 100755
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
// DESCRIPTION: Verilator: List of To Do issues.
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/bin/verilator b/bin/verilator
index 04a8278..7d3891e 100755
--- a/bin/verilator
+++ b/bin/verilator
@@ -3,7 +3,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
######################################################################
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you
+# Copyright 2003-2015 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.
@@ -3793,7 +3793,7 @@ Thanks to them, and all those we've missed including above.
The latest version is available from L<http://www.veripool.org/>.
-Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
diff --git a/bin/verilator_coverage b/bin/verilator_coverage
index 33bce7c..0ac55f5 100755
--- a/bin/verilator_coverage
+++ b/bin/verilator_coverage
@@ -3,7 +3,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
######################################################################
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you
+# Copyright 2003-2015 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.
@@ -271,7 +271,7 @@ Specifies a module search directory.
The latest version is available from L<http://www.veripool.org/>.
-Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
diff --git a/bin/verilator_difftree b/bin/verilator_difftree
index 2b01169..c01d427 100755
--- a/bin/verilator_difftree
+++ b/bin/verilator_difftree
@@ -235,7 +235,7 @@ Do not show differences in line numbering.
The latest version is available from L<http://www.veripool.org/verilator>.
-Copyright 2005-2014 by Wilson Snyder. This package is free software; you can
+Copyright 2005-2015 by Wilson Snyder. This package 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.
diff --git a/bin/verilator_includer b/bin/verilator_includer
index 59bf66f..00fb166 100755
--- a/bin/verilator_includer
+++ b/bin/verilator_includer
@@ -3,7 +3,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
# DESCRIPTION: Print include statements for each ARGV
#
-# Copyright 2003-2014 by Wilson Snyder. This package is free software; you can
+# Copyright 2003-2015 by Wilson Snyder. This package 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.
######################################################################
diff --git a/bin/verilator_profcfunc b/bin/verilator_profcfunc
index ac1d163..933bfe1 100755
--- a/bin/verilator_profcfunc
+++ b/bin/verilator_profcfunc
@@ -222,7 +222,7 @@ Displays this message and program version and exits.
The latest version is available from L<http://www.veripool.org/>.
-Copyright 2007-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2007-2015 by Wilson Snyder. Verilator 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.
diff --git a/configure b/configure
index c72e84d..2aff170 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Verilator 3.868 2014-12-20.
+# Generated by GNU Autoconf 2.68 for Verilator 3.870 2015-02-12.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -557,8 +557,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Verilator'
PACKAGE_TARNAME='verilator'
-PACKAGE_VERSION='3.868 2014-12-20'
-PACKAGE_STRING='Verilator 3.868 2014-12-20'
+PACKAGE_VERSION='3.870 2015-02-12'
+PACKAGE_STRING='Verilator 3.870 2015-02-12'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -602,6 +602,8 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
pkgdatadir
CFG_CXXFLAGS_NO_UNUSED
+CFG_CXXFLAGS_PARSER
+CFG_CXXFLAGS_SRC
EGREP
GREP
CXXCPP
@@ -1223,7 +1225,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Verilator 3.868 2014-12-20 to adapt to many kinds of systems.
+\`configure' configures Verilator 3.870 2015-02-12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1284,7 +1286,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Verilator 3.868 2014-12-20:";;
+ short | recursive ) echo "Configuration of Verilator 3.870 2015-02-12:";;
esac
cat <<\_ACEOF
@@ -1376,7 +1378,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Verilator configure 3.868 2014-12-20
+Verilator configure 3.870 2015-02-12
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1633,7 +1635,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Verilator $as_me 3.868 2014-12-20, which was
+It was created by Verilator $as_me 3.870 2015-02-12, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3852,6 +3854,223 @@ esac
# _MY_CXX_CHECK_OPT
+# Flags for compiling Verilator internals including parser
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Wno-unused-parameter -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wno-unused-parameter" >&5
+$as_echo_n "checking whether $CXX accepts -Wno-unused-parameter... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-unused-parameter" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_SRC="$CFG_CXXFLAGS_SRC -Wno-unused-parameter"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Wno-char-subscripts -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wno-char-subscripts" >&5
+$as_echo_n "checking whether $CXX accepts -Wno-char-subscripts... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-char-subscripts" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_SRC="$CFG_CXXFLAGS_SRC -Wno-char-subscripts"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Qunused-arguments -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Qunused-arguments" >&5
+$as_echo_n "checking whether $CXX accepts -Qunused-arguments... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Qunused-arguments" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_SRC="$CFG_CXXFLAGS_SRC -Qunused-arguments"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+
+
+# Flags for compiling Verilator parser
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Wno-unused -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wno-unused" >&5
+$as_echo_n "checking whether $CXX accepts -Wno-unused... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-unused" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_PARSER="$CFG_CXXFLAGS_PARSER -Wno-unused"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Wno-parentheses-equality -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wno-parentheses-equality" >&5
+$as_echo_n "checking whether $CXX accepts -Wno-parentheses-equality... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-parentheses-equality" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_PARSER="$CFG_CXXFLAGS_PARSER -Wno-parentheses-equality"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Wno-null-conversion -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wno-null-conversion" >&5
+$as_echo_n "checking whether $CXX accepts -Wno-null-conversion... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-null-conversion" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_PARSER="$CFG_CXXFLAGS_PARSER -Wno-null-conversion"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
+
+
+# Flags for Verilated makefile
# For example, -Wno-div-by-zero isn't in 4.1.2
# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
@@ -3872,6 +4091,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-char-subscripts" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -3902,6 +4126,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-parentheses-equality" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -3936,6 +4165,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-sign-compare" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -3966,6 +4200,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-uninitialized" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -3996,6 +4235,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-unused-but-set-variable" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -4026,6 +4270,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-unused-parameter" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -4056,6 +4305,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Wno-unused-variable" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -4086,6 +4340,11 @@ main ()
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-fbracket-depth=4096" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
else
_my_result=no
fi
@@ -4097,6 +4356,41 @@ $as_echo "$_my_result" >&6; }
fi
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
+ ACO_SAVE_CXXFLAGS="$CXXFLAGS"
+ # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
+ CXXFLAGS="$CXXFLAGS -Qunused-arguments -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Qunused-arguments" >&5
+$as_echo_n "checking whether $CXX accepts -Qunused-arguments... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ _my_result=yes
+ if test -s conftest.err; then
+ if grep -e "-Qunused-arguments" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi
+else
+ _my_result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_my_result" >&5
+$as_echo "$_my_result" >&6; }
+ if test "$_my_result" = "yes" ; then
+ CFG_CXXFLAGS_NO_UNUSED="$CFG_CXXFLAGS_NO_UNUSED -Qunused-arguments"
+ fi
+ CXXFLAGS="$ACO_SAVE_CXXFLAGS"
+
# Checks for library functions.
@@ -4625,7 +4919,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Verilator $as_me 3.868 2014-12-20, which was
+This file was extended by Verilator $as_me 3.870 2015-02-12, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4687,7 +4981,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-Verilator config.status 3.868 2014-12-20
+Verilator config.status 3.870 2015-02-12
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 66111de..eba4325 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,12 +1,12 @@
# DESCRIPTION: Process this file with autoconf to produce a configure script.
#
-# Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+# Copyright 2003-2015 by Wilson Snyder. Verilator 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.
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel])
-AC_INIT([Verilator],[3.868 2014-12-20])
+AC_INIT([Verilator],[3.870 2015-02-12])
AC_CONFIG_HEADER(src/config_build.h)
AC_CONFIG_FILES(Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h)
@@ -107,32 +107,51 @@ AC_DEFUN([_MY_CXX_CHECK_OPT],
[# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
# -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
- CXXFLAGS="$CXXFLAGS $1 -Werror"
- AC_MSG_CHECKING([whether $CXX accepts $1])
+ CXXFLAGS="$CXXFLAGS $2 -Werror"
+ AC_MSG_CHECKING([whether $CXX accepts $2])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[])],
- [_my_result=yes],
+ [_my_result=yes
+ if test -s conftest.err; then
+ if grep -e "$2" conftest.err >/dev/null; then
+ _my_result=no
+ fi
+ fi],
[_my_result=no])
AC_MSG_RESULT($_my_result)
if test "$_my_result" = "yes" ; then
- CFG_CXXFLAGS_NO_UNUSED="$CFG_CXXFLAGS_NO_UNUSED $1"
+ $1="$$1 $2"
fi
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
])# _MY_CXX_CHECK_OPT
+# Flags for compiling Verilator internals including parser
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-unused-parameter)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-char-subscripts)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Qunused-arguments)
+AC_SUBST(CFG_CXXFLAGS_SRC)
+
+# Flags for compiling Verilator parser
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_PARSER,-Wno-unused)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_PARSER,-Wno-parentheses-equality)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_PARSER,-Wno-null-conversion)
+AC_SUBST(CFG_CXXFLAGS_PARSER)
+
+# Flags for Verilated makefile
# For example, -Wno-div-by-zero isn't in 4.1.2
-_MY_CXX_CHECK_OPT(-Wno-char-subscripts)
-_MY_CXX_CHECK_OPT(-Wno-parentheses-equality)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-char-subscripts)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-parentheses-equality)
# Random code often does / 0. Unfortunately VL_DIV_I(0,0) will warn
# without this flag, even though there's a conditional to prevent the divide.
# We still don't add no-div-by-zero as it throws message to stdout, though doesn't die.
#_MY_CXX_CHECK_OPT(-Wno-div-by-zero)
-_MY_CXX_CHECK_OPT(-Wno-sign-compare)
-_MY_CXX_CHECK_OPT(-Wno-uninitialized)
-_MY_CXX_CHECK_OPT(-Wno-unused-but-set-variable)
-_MY_CXX_CHECK_OPT(-Wno-unused-parameter)
-_MY_CXX_CHECK_OPT(-Wno-unused-variable)
-_MY_CXX_CHECK_OPT(-fbracket-depth=4096)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-sign-compare)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-uninitialized)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-but-set-variable)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-parameter)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-variable)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-fbracket-depth=4096)
+_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Qunused-arguments)
AC_SUBST(CFG_CXXFLAGS_NO_UNUSED)
# Checks for library functions.
diff --git a/include/verilated.cpp b/include/verilated.cpp
index af0c0a4..3769900 100644
--- a/include/verilated.cpp
+++ b/include/verilated.cpp
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -476,7 +476,7 @@ static inline void _vl_vsss_advance(FILE* fp, int& floc) {
if (fp) fgetc(fp);
else floc -= 8;
}
-static inline int _vl_vsss_peek(FILE* fp, int& floc, WDataInP fromp) {
+static inline int _vl_vsss_peek(FILE* fp, int& floc, WDataInP fromp, const string& fstr) {
// Get a character without advancing
if (fp) {
int data = fgetc(fp);
@@ -486,23 +486,26 @@ static inline int _vl_vsss_peek(FILE* fp, int& floc, WDataInP fromp) {
} else {
if (floc < 0) return EOF;
floc = floc & ~7; // Align to closest character
- int data = (fromp[VL_BITWORD_I(floc)] >> VL_BITBIT_I(floc)) & 0xff;
- return data;
+ if (fromp == NULL) {
+ return fstr[fstr.length()-1 - (floc>>3)];
+ } else {
+ return (fromp[VL_BITWORD_I(floc)] >> VL_BITBIT_I(floc)) & 0xff;
+ }
}
}
-static inline void _vl_vsss_skipspace(FILE* fp, int& floc, WDataInP fromp) {
+static inline void _vl_vsss_skipspace(FILE* fp, int& floc, WDataInP fromp, const string& fstr) {
while (1) {
- int c = _vl_vsss_peek(fp, floc, fromp);
+ int c = _vl_vsss_peek(fp, floc, fromp, fstr);
if (c==EOF || !isspace(c)) return;
_vl_vsss_advance(fp, floc);
}
}
-static inline void _vl_vsss_read(FILE* fp, int& floc, WDataInP fromp,
+static inline void _vl_vsss_read(FILE* fp, int& floc, WDataInP fromp, const string& fstr,
char* tmpp, const char* acceptp) {
// Read into tmp, consisting of characters from acceptp list
char* cp = tmpp;
while (1) {
- int c = _vl_vsss_peek(fp, floc, fromp);
+ int c = _vl_vsss_peek(fp, floc, fromp, fstr);
if (c==EOF || isspace(c)) break;
if (acceptp!=NULL // String - allow anything
&& NULL==strchr(acceptp, c)) break;
@@ -547,6 +550,7 @@ static inline void _vl_vsss_based(WDataOutP owp, int obits, int baseLog2, const
IData _vl_vsscanf(FILE* fp, // If a fscanf
int fbits, WDataInP fromp, // Else if a sscanf
+ const string& fstr, // if a sscanf to string
const char* formatp, va_list ap) {
// Read a Verilog $sscanf/$fscanf style format into the output list
// The format must be pre-processed (and lower cased) by Verilator
@@ -557,15 +561,15 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
bool inPct = false;
const char* pos = formatp;
for (; *pos && !_vl_vsss_eof(fp,floc); ++pos) {
- //VL_PRINTF("_vlscan fmt='%c' floc=%d file='%c'\n", pos[0], floc, _vl_vsss_peek(fp,floc,fromp));
+ //VL_PRINTF("_vlscan fmt='%c' floc=%d file='%c'\n", pos[0], floc, _vl_vsss_peek(fp,floc,fromp,fstr));
if (!inPct && pos[0]=='%') {
inPct = true;
} else if (!inPct && isspace(pos[0])) { // Format spaces
while (isspace(pos[1])) pos++;
- _vl_vsss_skipspace(fp,floc,fromp);
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
} else if (!inPct) { // Expected Format
- _vl_vsss_skipspace(fp,floc,fromp);
- int c = _vl_vsss_peek(fp,floc,fromp);
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ int c = _vl_vsss_peek(fp,floc,fromp,fstr);
if (c != pos[0]) goto done;
else _vl_vsss_advance(fp,floc);
} else { // Format character
@@ -574,7 +578,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
char fmt = pos[0];
switch (fmt) {
case '%': {
- int c = _vl_vsss_peek(fp,floc,fromp);
+ int c = _vl_vsss_peek(fp,floc,fromp,fstr);
if (c != '%') goto done;
else _vl_vsss_advance(fp,floc);
break;
@@ -591,15 +595,15 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
for (int i=0; i<VL_WORDS_I(obits); i++) owp[i] = 0;
switch (fmt) {
case 'c': {
- int c = _vl_vsss_peek(fp,floc,fromp);
+ int c = _vl_vsss_peek(fp,floc,fromp,fstr);
if (c==EOF) goto done;
else _vl_vsss_advance(fp,floc);
owp[0] = c;
break;
}
case 's': {
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, NULL);
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, NULL);
if (!tmp[0]) goto done;
int pos = ((int)strlen(tmp))-1;
int lsb = 0;
@@ -609,8 +613,8 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
break;
}
case 'd': { // Signed decimal
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "0123456789+-xXzZ?_");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "0123456789+-xXzZ?_");
if (!tmp[0]) goto done;
vlsint64_t ld;
sscanf(tmp,"%30" VL_PRI64 "d",&ld);
@@ -620,8 +624,8 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
case 'f':
case 'e':
case 'g': { // Real number
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "+-.0123456789eE");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "+-.0123456789eE");
if (!tmp[0]) goto done;
union { double r; vlsint64_t ld; } u;
u.r = strtod(tmp, NULL);
@@ -630,8 +634,8 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
}
case 't': // FALLTHRU // Time
case 'u': { // Unsigned decimal
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "0123456789+-xXzZ?_");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "0123456789+-xXzZ?_");
if (!tmp[0]) goto done;
QData ld;
sscanf(tmp,"%30" VL_PRI64 "u",&ld);
@@ -639,22 +643,22 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
break;
}
case 'b': {
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "01xXzZ?_");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "01xXzZ?_");
if (!tmp[0]) goto done;
_vl_vsss_based(owp,obits, 1, tmp, 0, (int)strlen(tmp));
break;
}
case 'o': {
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "01234567xXzZ?_");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "01234567xXzZ?_");
if (!tmp[0]) goto done;
_vl_vsss_based(owp,obits, 3, tmp, 0, (int)strlen(tmp));
break;
}
case 'x': {
- _vl_vsss_skipspace(fp,floc,fromp);
- _vl_vsss_read(fp,floc,fromp, tmp, "0123456789abcdefABCDEFxXzZ?_");
+ _vl_vsss_skipspace(fp,floc,fromp,fstr);
+ _vl_vsss_read(fp,floc,fromp,fstr, tmp, "0123456789abcdefABCDEFxXzZ?_");
if (!tmp[0]) goto done;
_vl_vsss_based(owp,obits, 4, tmp, 0, (int)strlen(tmp));
break;
@@ -875,7 +879,7 @@ IData VL_FSCANF_IX(IData fpi, const char* formatp, ...) {
va_list ap;
va_start(ap,formatp);
- IData got = _vl_vsscanf(fp, 0, NULL, formatp, ap);
+ IData got = _vl_vsscanf(fp, 0, NULL, "", formatp, ap);
va_end(ap);
return got;
}
@@ -885,7 +889,7 @@ IData VL_SSCANF_IIX(int lbits, IData ld, const char* formatp, ...) {
va_list ap;
va_start(ap,formatp);
- IData got = _vl_vsscanf(NULL, lbits, fnw, formatp, ap);
+ IData got = _vl_vsscanf(NULL, lbits, fnw, "", formatp, ap);
va_end(ap);
return got;
}
@@ -894,14 +898,21 @@ IData VL_SSCANF_IQX(int lbits, QData ld, const char* formatp, ...) {
va_list ap;
va_start(ap,formatp);
- IData got = _vl_vsscanf(NULL, lbits, fnw, formatp, ap);
+ IData got = _vl_vsscanf(NULL, lbits, fnw, "", formatp, ap);
va_end(ap);
return got;
}
IData VL_SSCANF_IWX(int lbits, WDataInP lwp, const char* formatp, ...) {
va_list ap;
va_start(ap,formatp);
- IData got = _vl_vsscanf(NULL, lbits, lwp, formatp, ap);
+ IData got = _vl_vsscanf(NULL, lbits, lwp, "", formatp, ap);
+ va_end(ap);
+ return got;
+}
+IData VL_SSCANF_INX(int, const string& ld, const char* formatp, ...) {
+ va_list ap;
+ va_start(ap,formatp);
+ IData got = _vl_vsscanf(NULL, ld.length()*8, NULL, ld, formatp, ap);
va_end(ap);
return got;
}
diff --git a/include/verilated.h b/include/verilated.h
index 7dbb10c..b531e7d 100644
--- a/include/verilated.h
+++ b/include/verilated.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -1132,7 +1132,9 @@ static inline WDataOutP VL_DIVS_WWW(int lbits, WDataOutP owp,WDataInP lwp,WDataI
int words = VL_WORDS_I(lbits);
IData lsign = VL_SIGN_I(lbits,lwp[words-1]);
IData rsign = VL_SIGN_I(lbits,rwp[words-1]);
+ // cppcheck-suppress variableScope
IData lwstore[VL_MULS_MAX_WORDS]; // Fixed size, as MSVC++ doesn't allow [words] here
+ // cppcheck-suppress variableScope
IData rwstore[VL_MULS_MAX_WORDS];
WDataInP ltup = lwp;
WDataInP rtup = rwp;
@@ -1151,7 +1153,9 @@ static inline WDataOutP VL_MODDIVS_WWW(int lbits, WDataOutP owp,WDataInP lwp,WDa
int words = VL_WORDS_I(lbits);
IData lsign = VL_SIGN_I(lbits,lwp[words-1]);
IData rsign = VL_SIGN_I(lbits,rwp[words-1]);
+ // cppcheck-suppress variableScope
IData lwstore[VL_MULS_MAX_WORDS]; // Fixed size, as MSVC++ doesn't allow [words] here
+ // cppcheck-suppress variableScope
IData rwstore[VL_MULS_MAX_WORDS];
WDataInP ltup = lwp;
WDataInP rtup = rwp;
diff --git a/include/verilated.mk.in b/include/verilated.mk.in
index 9412f9c..39a2804 100644
--- a/include/verilated.mk.in
+++ b/include/verilated.mk.in
@@ -2,7 +2,7 @@
######################################################################
# DESCRIPTION: Makefile commands for all verilated target files
#
-# Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+# Copyright 2003-2015 by Wilson Snyder. Verilator 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.
######################################################################
@@ -153,7 +153,7 @@ VK_USER_OBJS = $(addsuffix .o, $(VM_USER_CLASSES))
VK_GLOBAL_OBJS = $(addsuffix .o, $(VM_GLOBAL_FAST) $(VM_GLOBAL_SLOW))
-ifneq ($(VM_PARALLEL_BUILDS),0)
+ifneq ($(VM_PARALLEL_BUILDS),1)
# Fast building, all .cpp's in one fell swoop
# This saves about 5 sec per module, but can be slower if only a little changes
VK_OBJS += $(VM_PREFIX)__ALLcls.o $(VM_PREFIX)__ALLsup.o
diff --git a/include/verilated.v b/include/verilated.v
index 5f6cc26..55137cc 100644
--- a/include/verilated.v
+++ b/include/verilated.v
@@ -4,7 +4,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/include/verilated_config.h b/include/verilated_config.h
index 2f86a87..6b1192e 100644
--- a/include/verilated_config.h
+++ b/include/verilated_config.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -25,4 +25,4 @@
// Autoconf substitutes this with the strings from AC_INIT.
#define VERILATOR_PRODUCT "Verilator"
-#define VERILATOR_VERSION "3.868 2014-12-20"
+#define VERILATOR_VERSION "3.870 2015-02-12"
diff --git a/include/verilated_config.h.in b/include/verilated_config.h.in
index 0fa8a7f..2fcff51 100644
--- a/include/verilated_config.h.in
+++ b/include/verilated_config.h.in
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp
index 9091277..f9f11f7 100644
--- a/include/verilated_cov.cpp
+++ b/include/verilated_cov.cpp
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
@@ -52,7 +52,10 @@ public: // But only local to this file
// CONSTRUCTORS
// Derived classes should call zero() in their constructor
VerilatedCovImpItem() {
- for (int i=0; i<MAX_KEYS; i++) m_keys[i]=KEY_UNDEF;
+ for (int i=0; i<MAX_KEYS; i++) {
+ m_keys[i]=KEY_UNDEF;
+ m_vals[i]=0;
+ }
}
virtual ~VerilatedCovImpItem() {}
virtual vluint64_t count() const = 0;
diff --git a/include/verilated_cov.h b/include/verilated_cov.h
index dac339d..143944e 100644
--- a/include/verilated_cov.h
+++ b/include/verilated_cov.h
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
diff --git a/include/verilated_cov_key.h b/include/verilated_cov_key.h
index 3276a4a..50ec251 100644
--- a/include/verilated_cov_key.h
+++ b/include/verilated_cov_key.h
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
diff --git a/include/verilated_dpi.cpp b/include/verilated_dpi.cpp
index bbac159..04997fc 100644
--- a/include/verilated_dpi.cpp
+++ b/include/verilated_dpi.cpp
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
@@ -82,7 +82,7 @@ void svGetPartselLogic(svLogicVecVal* d, const svLogicVecVal* s, int i, int w) {
void svPutPartselBit(svBitVecVal* d, const svBitVecVal s, int i, int w) {
_VL_SVDPI_UNIMP();
}
-void svPutPartselLogic(svLogicVecVal* d, const svLogicVecVal s, int i, int w) {
+void svPutPartselLogic(svLogicVecVal* d, const svLogicVecVal* s, int i, int w) {
_VL_SVDPI_UNIMP();
}
diff --git a/include/verilated_dpi.h b/include/verilated_dpi.h
index 2fba964..f6005a0 100644
--- a/include/verilated_dpi.h
+++ b/include/verilated_dpi.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/include/verilated_heavy.h b/include/verilated_heavy.h
index 3da1b20..79558fc 100644
--- a/include/verilated_heavy.h
+++ b/include/verilated_heavy.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2010-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2010-2015 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.
@@ -41,7 +41,7 @@ inline string VL_CVT_PACK_STR_NQ(QData lhs) {
IData lw[2]; VL_SET_WQ(lw, lhs);
return VL_CVT_PACK_STR_NW(2, lw);
}
-inline string VL_CVT_PACK_STR_NQ(const string& lhs) {
+inline string VL_CVT_PACK_STR_NN(const string& lhs) {
return lhs;
}
inline string VL_CVT_PACK_STR_NI(IData lhs) {
@@ -51,7 +51,7 @@ inline string VL_CVT_PACK_STR_NI(IData lhs) {
inline string VL_CONCATN_NNN(const string& lhs, const string& rhs) {
return lhs+rhs;
}
-inline string VL_REPLICATEN_NNQ(int,int,int rbits, const string& lhs, IData rep) {
+inline string VL_REPLICATEN_NNQ(int,int,int, const string& lhs, IData rep) {
string out; out.reserve(lhs.length() * rep);
for (unsigned times=0; times<rep; times++) out += lhs;
return out;
@@ -60,6 +60,7 @@ inline string VL_REPLICATEN_NNI(int obits,int lbits,int rbits, const string& lhs
return VL_REPLICATEN_NNQ(obits,lbits,rbits,lhs,rep);
}
+extern IData VL_SSCANF_INX(int lbits, const string& ld, const char* formatp, ...);
extern void VL_SFORMAT_X(int obits_ignored, string &output, const char* formatp, ...);
extern string VL_SFORMATF_NX(const char* formatp, ...);
diff --git a/include/verilated_imp.h b/include/verilated_imp.h
index ed3f46e..4e2e799 100644
--- a/include/verilated_imp.h
+++ b/include/verilated_imp.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
diff --git a/include/verilated_save.cpp b/include/verilated_save.cpp
index 14ad598..7ce7751 100644
--- a/include/verilated_save.cpp
+++ b/include/verilated_save.cpp
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
diff --git a/include/verilated_save.h b/include/verilated_save.h
index 26c8e18..8282d9e 100644
--- a/include/verilated_save.h
+++ b/include/verilated_save.h
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2012-2014 by Wilson Snyder. This program is free software;
+// Copyright 2012-2015 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.
//
diff --git a/include/verilated_sc.h b/include/verilated_sc.h
index f27d29a..8eeb0ba 100644
--- a/include/verilated_sc.h
+++ b/include/verilated_sc.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
diff --git a/include/verilated_syms.h b/include/verilated_syms.h
index 7284205..5246cbc 100644
--- a/include/verilated_syms.h
+++ b/include/verilated_syms.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp
index 202e9cd..04c6cf3 100644
--- a/include/verilated_vcd_c.cpp
+++ b/include/verilated_vcd_c.cpp
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
@@ -308,13 +308,11 @@ void VerilatedVcd::bufferFlush () {
// Simple methods
void VerilatedVcd::set_time_unit (const char* unitp) {
- string unitstr (unitp);
//cout<<" set_time_unit ("<<unitp<<") == "<<timescaleToDouble(unitp)<<" == "<<doubleToTimescale(timescaleToDouble(unitp))<<endl;
m_timeUnit = timescaleToDouble(unitp);
}
void VerilatedVcd::set_time_resolution (const char* unitp) {
- string unitstr (unitp);
//cout<<"set_time_resolution ("<<unitp<<") == "<<timescaleToDouble(unitp)<<" == "<<doubleToTimescale(timescaleToDouble(unitp))<<endl;
m_timeRes = timescaleToDouble(unitp);
}
@@ -440,7 +438,7 @@ void VerilatedVcd::dumpHeader () {
deleteNameMap();
}
-void VerilatedVcd::module (string name) {
+void VerilatedVcd::module (const string& name) {
m_modName = name;
}
diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h
index 228c7b2..a2d9ca8 100644
--- a/include/verilated_vcd_c.h
+++ b/include/verilated_vcd_c.h
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
@@ -191,7 +191,7 @@ public:
void* userthis);
/// Inside dumping routines, declare a module
- void module (const string name);
+ void module (const string& name);
/// Inside dumping routines, declare a signal
void declBit (vluint32_t code, const char* name, int arraynum);
void declBus (vluint32_t code, const char* name, int arraynum, int msb, int lsb);
diff --git a/include/verilated_vcd_sc.cpp b/include/verilated_vcd_sc.cpp
index 14ea6a6..dbab140 100644
--- a/include/verilated_vcd_sc.cpp
+++ b/include/verilated_vcd_sc.cpp
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
diff --git a/include/verilated_vcd_sc.h b/include/verilated_vcd_sc.h
index 08a6567..29828d3 100644
--- a/include/verilated_vcd_sc.h
+++ b/include/verilated_vcd_sc.h
@@ -3,7 +3,7 @@
//
// THIS MODULE IS PUBLICLY LICENSED
//
-// Copyright 2001-2014 by Wilson Snyder. This program is free software;
+// Copyright 2001-2015 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.
//
diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp
index b35c0f8..2b7b2d0 100644
--- a/include/verilated_vpi.cpp
+++ b/include/verilated_vpi.cpp
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
diff --git a/include/verilated_vpi.h b/include/verilated_vpi.h
index 74fdaf6..01ea91b 100644
--- a/include/verilated_vpi.h
+++ b/include/verilated_vpi.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
@@ -787,6 +787,7 @@ void vpi_put_delays(vpiHandle object, p_vpi_delay delay_p) {
void vpi_get_value(vpiHandle object, p_vpi_value value_p) {
static VL_THREAD char outStr[1+VL_MULS_MAX_WORDS*32]; // Maximum required size is for binary string, one byte per bit plus null termination
+ // cppcheck-suppress variableScope
static VL_THREAD int outStrSz = sizeof(outStr)-1;
VL_DEBUG_IF_PLI(VL_PRINTF("-vltVpi: vpi_get_value %p\n",object););
_VL_VPI_ERROR_RESET(); // reset vpi error status
diff --git a/include/verilatedos.h b/include/verilatedos.h
index a82eb59..fafc05d 100644
--- a/include/verilatedos.h
+++ b/include/verilatedos.h
@@ -1,7 +1,7 @@
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/include/vltstd/svdpi.h b/include/vltstd/svdpi.h
index 4aca317..dbfc9db 100644
--- a/include/vltstd/svdpi.h
+++ b/include/vltstd/svdpi.h
@@ -155,7 +155,7 @@ XXTERN void svGetPartselBit(svBitVecVal* d, const svBitVecVal* s, int i, int w);
XXTERN void svGetPartselLogic(svLogicVecVal* d, const svLogicVecVal* s, int i, int w);
XXTERN void svPutPartselBit(svBitVecVal* d, const svBitVecVal s, int i, int w);
-XXTERN void svPutPartselLogic(svLogicVecVal* d, const svLogicVecVal s, int i, int w);
+XXTERN void svPutPartselLogic(svLogicVecVal* d, const svLogicVecVal* s, int i, int w);
/*
* Open array querying functions
@@ -427,7 +427,7 @@ XXTERN void svGetPartSelectLogic(svLogicVec32* d, const svLogicPackedArrRef s,
/* actual <-- canonical */
XXTERN void svPutPartSelectBit(svBitPackedArrRef d, const svBitVec32 s,
int i, int w);
-XXTERN void svPutPartSelectLogic(svLogicPackedArrRef d, const svLogicVec32 s,
+XXTERN void svPutPartSelectLogic(svLogicPackedArrRef d, const svLogicVec32* s,
int i, int w);
/*
diff --git a/internals.html b/internals.html
index e6e1c40..a3fdf16 100644
--- a/internals.html
+++ b/internals.html
@@ -759,7 +759,7 @@ in <code>src/Makefile_obj.in</code> and reconfigure.</p>
<hr />
<h1><a name="distribution">DISTRIBUTION</a></h1>
<p>The latest version is available from <a href="http://www.veripool.org/">http://www.veripool.org/</a>.</p>
-<p>Copyright 2008-2014 by Wilson Snyder. Verilator is free software; you can
+<p>Copyright 2008-2015 by Wilson Snyder. Verilator 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.</p>
diff --git a/internals.pdf b/internals.pdf
index c5d025d..f42d29a 100644
Binary files a/internals.pdf and b/internals.pdf differ
diff --git a/internals.pod b/internals.pod
index 83ae109..ddc8b4b 100644
--- a/internals.pod
+++ b/internals.pod
@@ -773,7 +773,7 @@ in C<src/Makefile_obj.in> and reconfigure.
The latest version is available from L<http://www.veripool.org/>.
-Copyright 2008-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2008-2015 by Wilson Snyder. Verilator 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.
diff --git a/internals.txt b/internals.txt
index b47730b..9e45825 100644
--- a/internals.txt
+++ b/internals.txt
@@ -710,7 +710,7 @@ DISTRIBUTION
The latest version is available from <http://www.veripool.org/>.
- Copyright 2008-2014 by Wilson Snyder. Verilator is free software; you
+ Copyright 2008-2015 by Wilson Snyder. Verilator 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.
diff --git a/readme.pod b/readme.pod
index 42b87db..e984862 100644
--- a/readme.pod
+++ b/readme.pod
@@ -9,7 +9,7 @@ This is the Verilator Package README file.
=head1 DISTRIBUTION
-This package is Copyright 2003-2014 by Wilson Snyder. (Report bugs to
+This package is Copyright 2003-2015 by Wilson Snyder. (Report bugs to
L<http://www.veripool.org/>.)
Verilator is free software; you can redistribute it and/or modify it under
diff --git a/src/.gdbinit b/src/.gdbinit
index b866d98..430b5b6 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -1,6 +1,6 @@
# DESCRIPTION: Verilator: GDB startup file with useful defines
#
-# Copyright 2012-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2012-2015 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.
diff --git a/src/Makefile.in b/src/Makefile.in
index 4fdd7ee..9108fb1 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -7,7 +7,7 @@
#
#*****************************************************************************
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in
index 786030e..8641397 100644
--- a/src/Makefile_obj.in
+++ b/src/Makefile_obj.in
@@ -7,7 +7,7 @@
#
#*****************************************************************************
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
@@ -62,6 +62,8 @@ CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CPPFLAGS += @CPPFLAGS@
LDFLAGS += @LDFLAGS@
EXEEXT = @EXEEXT@
+CFG_CXXFLAGS_SRC = @CFG_CXXFLAGS_SRC@
+CFG_CXXFLAGS_PARSER = @CFG_CXXFLAGS_PARSER@
#### End of system configuration section. ####
@@ -85,7 +87,8 @@ endif
#CCMALLOC = /usr/local/lib/ccmalloc-gcc.o -lccmalloc -ldl
# -lfl not needed as Flex invoked with %nowrap option
-LIBS = -lm
+# -lstdc++ needed for clang, believed harmless with gcc
+LIBS = -lm -lstdc++
CPPFLAGS += -MMD
CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
@@ -94,11 +97,11 @@ CPPFLAGS += -DYYDEBUG # Required to get nice error messages
CPPFLAGS += $(COPT)
CPPFLAGS += -MP # Only works on recent GCC versions
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
-CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror
+CPPFLAGS += -W -Wall $(CFG_CXXFLAGS_SRC) -Werror
#CPPFLAGS += -pedantic-errors
endif
CPPFLAGSWALL = $(CPPFLAGS)
-CPPFLAGSNOWALL = $(CPPFLAGS) -Wno-unused
+CPPFLAGSPARSER = $(CPPFLAGS) $(CFG_CXXFLAGS_PARSER)
ifneq ($(SYSTEMPERL),) # Intuit SYSTEMPERL_INCLUDE as it's new
SYSTEMPERL_INCLUDE ?= $(SYSTEMPERL)/src
@@ -277,16 +280,16 @@ V3Number_test: V3Number_test.o
$(OBJCACHE) ${CC} ${CPPFLAGSWALL} -c $<
V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c
- $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
+ $(OBJCACHE) ${CXX} ${CPPFLAGSPARSER} -c $<
V3ParseGrammar.o: V3ParseGrammar.cpp V3ParseBison.c
- $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
+ $(OBJCACHE) ${CXX} ${CPPFLAGSPARSER} -c $<
V3ParseImp.o: V3ParseImp.cpp V3ParseBison.c
- $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
+ $(OBJCACHE) ${CXX} ${CPPFLAGSPARSER} -c $<
V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp
- $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<
+ $(OBJCACHE) ${CXX} ${CPPFLAGSPARSER} -c $<
#### Generated files
diff --git a/src/V3Active.cpp b/src/V3Active.cpp
index 48d8dc1..220375d 100644
--- a/src/V3Active.cpp
+++ b/src/V3Active.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -163,7 +163,7 @@ public:
class ActiveDlyVisitor : public ActiveBaseVisitor {
public:
- enum CheckType { CT_SEQ, CT_COMBO, CT_INITIAL };
+ enum CheckType { CT_SEQ, CT_COMBO, CT_INITIAL, CT_LATCH };
private:
CheckType m_check; // Combo logic or other
AstNode* m_alwaysp; // Always we're under
@@ -175,6 +175,8 @@ private:
UINFO(5," ASSIGNDLY "<<nodep<<endl);
if (m_check == CT_INITIAL) {
nodep->v3warn(INITIALDLY,"Delayed assignments (<=) in initial or final block; suggest blocking assignments (=).");
+ } else if (m_check == CT_LATCH) {
+ // Suppress. Shouldn't matter that the interior of the latch races
} else {
nodep->v3warn(COMBDLY,"Delayed assignments (<=) in non-clocked (non flop or latch) block; suggest blocking assignments (=).");
}
@@ -306,7 +308,7 @@ private:
}
// METHODS
- void visitAlways(AstNode* nodep, AstSenTree* oldsensesp) {
+ void visitAlways(AstNode* nodep, AstSenTree* oldsensesp, VAlwaysKwd kwd) {
// Move always to appropriate ACTIVE based on its sense list
if (oldsensesp
&& oldsensesp->sensesp()
@@ -358,7 +360,11 @@ private:
// Warn and/or convert any delayed assignments
if (combo && !sequent) {
- ActiveDlyVisitor dlyvisitor (nodep, ActiveDlyVisitor::CT_COMBO);
+ if (kwd == VAlwaysKwd::ALWAYS_LATCH) {
+ ActiveDlyVisitor dlyvisitor (nodep, ActiveDlyVisitor::CT_LATCH);
+ } else {
+ ActiveDlyVisitor dlyvisitor (nodep, ActiveDlyVisitor::CT_COMBO);
+ }
}
else if (!combo && sequent) {
ActiveDlyVisitor dlyvisitor (nodep, ActiveDlyVisitor::CT_SEQ);
@@ -374,13 +380,13 @@ private:
nodep->unlinkFrBack()->deleteTree(); nodep=NULL;
return;
}
- visitAlways(nodep, nodep->sensesp());
+ visitAlways(nodep, nodep->sensesp(), nodep->keyword());
}
virtual void visit(AstAlwaysPublic* nodep, AstNUser*) {
// Move always to appropriate ACTIVE based on its sense list
UINFO(4," ALWPub "<<nodep<<endl);
//if (debug()>=9) nodep->dumpTree(cout," Alw: ");
- visitAlways(nodep, nodep->sensesp());
+ visitAlways(nodep, nodep->sensesp(), VAlwaysKwd::ALWAYS);
}
virtual void visit(AstSenGate* nodep, AstNUser*) {
AstSenItem* subitemp = nodep->sensesp();
diff --git a/src/V3Active.h b/src/V3Active.h
index 6104fde..0fc647d 100644
--- a/src/V3Active.h
+++ b/src/V3Active.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ActiveTop.cpp b/src/V3ActiveTop.cpp
index 9509875..c01ea74 100644
--- a/src/V3ActiveTop.cpp
+++ b/src/V3ActiveTop.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ActiveTop.h b/src/V3ActiveTop.h
index 2382aa9..cf7e280 100644
--- a/src/V3ActiveTop.h
+++ b/src/V3ActiveTop.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp
index c2b3dc4..baa846e 100644
--- a/src/V3Assert.cpp
+++ b/src/V3Assert.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
@@ -88,21 +88,6 @@ private:
return newp;
}
- AstNode* newIfCoverageOn(AstNode* nodep) {
- // Add a internal if to check coverage is on
- // Don't make this a AND term, as it's unlikely to need to test this.
- AstNode* newp
- = new AstIf (nodep->fileline(),
- // If assertions are off, have constant propagation rip them out later
- // This allows syntax errors and such to be detected normally.
- (v3Global.opt.coverage()
- ? (AstNode*)(new AstConst(nodep->fileline(), AstConst::LogicTrue()))
- : (AstNode*)(new AstConst(nodep->fileline(), AstConst::LogicFalse()))),
- nodep, NULL);
- newp->user1(true); // Don't assert/cover this if
- return newp;
- }
-
AstNode* newFireAssert(AstNode* nodep, const string& message) {
AstDisplay* dispp = new AstDisplay (nodep->fileline(), AstDisplayType::DT_ERROR, message, NULL, NULL);
AstNode* bodysp = dispp;
diff --git a/src/V3Assert.h b/src/V3Assert.h
index 5dfab72..687ec4b 100644
--- a/src/V3Assert.h
+++ b/src/V3Assert.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp
index 2523891..ee4a56b 100644
--- a/src/V3AssertPre.cpp
+++ b/src/V3AssertPre.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3AssertPre.h b/src/V3AssertPre.h
index f9cd0d4..6742b34 100644
--- a/src/V3AssertPre.h
+++ b/src/V3AssertPre.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp
index 1fa1cb4..8e10ba1 100644
--- a/src/V3Ast.cpp
+++ b/src/V3Ast.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Ast.h b/src/V3Ast.h
index 4099d28..f06f8b2 100644
--- a/src/V3Ast.h
+++ b/src/V3Ast.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3AstConstOnly.h b/src/V3AstConstOnly.h
index 67731f2..24f3cfc 100644
--- a/src/V3AstConstOnly.h
+++ b/src/V3AstConstOnly.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp
index fd3aa70..7515408 100644
--- a/src/V3AstNodes.cpp
+++ b/src/V3AstNodes.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -863,7 +863,7 @@ void AstNodeDType::dumpSmall(ostream& str) {
void AstNodeArrayDType::dumpSmall(ostream& str) {
this->AstNodeDType::dumpSmall(str);
if (castPackArrayDType()) str<<"p"; else str<<"u";
- str<<" "<<declRange();
+ str<<declRange();
}
void AstNodeArrayDType::dump(ostream& str) {
this->AstNodeDType::dump(str);
@@ -918,7 +918,6 @@ void AstTypeTable::dump(ostream& str) {
for (DetailedMap::const_iterator it = mapr.begin(); it != mapr.end(); ++it) {
AstBasicDType* dtypep = it->second;
str<<endl; // Newline from caller, so newline first
- stringstream nsstr;
str<<"\t\tdetailed -> ";
dtypep->dump(str);
}
diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h
index a33d7ae..d88790c 100644
--- a/src/V3AstNodes.h
+++ b/src/V3AstNodes.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -434,7 +434,7 @@ public:
virtual AstBasicDType* basicp() const { return subDTypep()->basicp(); } // (Slow) recurse down to find basic data type
virtual AstNodeDType* skipRefp() const { return subDTypep()->skipRefp(); }
virtual AstNodeDType* skipRefToConstp() const { return (AstNodeDType*)this; }
- virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; }
+ virtual AstNodeDType* skipRefToEnump() const { return subDTypep()->skipRefToEnump(); }
virtual int widthAlignBytes() const { return subDTypep()->widthAlignBytes(); }
virtual int widthTotalBytes() const { return subDTypep()->widthTotalBytes(); }
};
@@ -594,7 +594,7 @@ public:
AstNodeDType* dtypeSkipRefp() const { return subDTypep()->skipRefp(); } // op1 = Range of variable (Note don't need virtual - AstVar isn't a NodeDType)
virtual AstNodeDType* skipRefp() const { return subDTypep()->skipRefp(); }
virtual AstNodeDType* skipRefToConstp() const { return subDTypep()->skipRefToConstp(); }
- virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; }
+ virtual AstNodeDType* skipRefToEnump() const { return subDTypep()->skipRefToEnump(); }
virtual int widthAlignBytes() const { return subDTypep()->widthAlignBytes(); } // (Slow) recurses - Structure alignment 1,2,4 or 8 bytes (arrays affect this)
virtual int widthTotalBytes() const { return subDTypep()->widthTotalBytes(); } // (Slow) recurses - Width in bytes rounding up 1,2,4,8,12,...
// METHODS
@@ -3485,6 +3485,21 @@ public:
AstNodeDType* childDTypep() const { return op2p()->castNodeDType(); }
};
+class AstCastParse : public AstNode {
+ // Cast to appropriate type, where we haven't determined yet what the data type is
+public:
+ AstCastParse(FileLine* fl, AstNode* lhsp, AstNode* dtp) : AstNode(fl) {
+ setOp1p(lhsp); setOp2p(dtp);
+ }
+ ASTNODE_NODE_FUNCS(CastParse, CASTPARSE)
+ virtual string emitVerilog() { return "((%d)'(%l))"; }
+ virtual string emitC() { V3ERROR_NA; return ""; }
+ virtual bool cleanOut() { V3ERROR_NA; return true;} virtual bool cleanLhs() {return true;}
+ virtual bool sizeMattersLhs() {return false;}
+ AstNode* lhsp() const { return op1p(); }
+ AstNode* dtp() const { return op2p(); }
+};
+
class AstCastSize : public AstNode {
// Cast to specific size; signed/twostate inherited from lower element per IEEE
public:
diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp
index ef87498..d9d9bf5 100644
--- a/src/V3Begin.cpp
+++ b/src/V3Begin.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Begin.h b/src/V3Begin.h
index 34bde9a..01ab6f6 100644
--- a/src/V3Begin.h
+++ b/src/V3Begin.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Branch.cpp b/src/V3Branch.cpp
index c887d75..df0ab76 100644
--- a/src/V3Branch.cpp
+++ b/src/V3Branch.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Branch.h b/src/V3Branch.h
index 65e97a8..86754d1 100644
--- a/src/V3Branch.h
+++ b/src/V3Branch.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp
index 954369f..e20d40e 100644
--- a/src/V3Broken.cpp
+++ b/src/V3Broken.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Broken.h b/src/V3Broken.h
index 9c557aa..81a5707 100644
--- a/src/V3Broken.h
+++ b/src/V3Broken.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Case.cpp b/src/V3Case.cpp
index 111dbe5..badf50b 100644
--- a/src/V3Case.cpp
+++ b/src/V3Case.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -411,6 +411,7 @@ private:
AstNode* itemexprp = ifexprp; ifexprp=NULL;
if (depth == (CASE_ENCODER_GROUP_DEPTH)) { // End of group - can skip the condition
itemexprp->deleteTree(); itemexprp=NULL;
+ // cppcheck-suppress redundantAssignment
itemexprp = new AstConst(itemp->fileline(), AstConst::LogicTrue());
}
AstIf* newp = new AstIf(itemp->fileline(), itemexprp, istmtsp, NULL);
@@ -462,6 +463,7 @@ private:
replaceCaseFast(nodep); nodep=NULL;
} else {
++m_statCaseSlow;
+ // cppcheck-supporess uselessAssignmentPtrArg
replaceCaseComplicated(nodep); nodep=NULL;
}
}
diff --git a/src/V3Case.h b/src/V3Case.h
index e28377c..8ddee07 100644
--- a/src/V3Case.h
+++ b/src/V3Case.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Cast.cpp b/src/V3Cast.cpp
index 700bbfd..75a4b2a 100644
--- a/src/V3Cast.cpp
+++ b/src/V3Cast.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Cast.h b/src/V3Cast.h
index 0fb90ec..9c3a5d3 100644
--- a/src/V3Cast.h
+++ b/src/V3Cast.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Cdc.cpp b/src/V3Cdc.cpp
index b476ffd..f704fd7 100644
--- a/src/V3Cdc.cpp
+++ b/src/V3Cdc.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Cdc.h b/src/V3Cdc.h
index d84a271..08b8c96 100644
--- a/src/V3Cdc.h
+++ b/src/V3Cdc.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Changed.cpp b/src/V3Changed.cpp
index 542b8ac..f2e637a 100644
--- a/src/V3Changed.cpp
+++ b/src/V3Changed.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -44,19 +44,34 @@
#include "V3EmitCBase.h"
//######################################################################
-// Changed state, as a visitor of each AstNode
-
-class ChangedVisitor : public AstNVisitor {
-private:
- // NODE STATE
- // Entire netlist:
- // AstVarScope::user1() -> bool. True indicates processed
- AstUser1InUse m_inuser1;
+class ChangedState {
+public:
// STATE
AstNodeModule* m_topModp; // Top module
AstScope* m_scopetopp; // Scope under TOPSCOPE
AstCFunc* m_chgFuncp; // Change function we're building
+ ChangedState() {
+ m_topModp = NULL;
+ m_chgFuncp = NULL;
+ m_scopetopp = NULL;
+ }
+ ~ChangedState() {}
+};
+
+//######################################################################
+// Utility visitor to find elements to be compared
+
+class ChangedInsertVisitor : public AstNVisitor {
+private:
+ // STATE
+ ChangedState* m_statep; // Shared state across visitors
+ AstVarScope* m_vscp; // Original (non-change) variable we're change-detecting
+ AstVarScope* m_newvscp; // New (change detect) variable we're change-detecting
+ AstNode* m_varEqnp; // Original var's equation to get var value
+ AstNode* m_newLvEqnp; // New var's equation to read value
+ AstNode* m_newRvEqnp; // New var's equation to set value
+ uint32_t m_detects; // # detects created
// CONSTANTS
enum MiscConsts {
@@ -64,76 +79,124 @@ private:
// Ok to increase this, but may result in much slower model
};
- // METHODS
- static int debug() {
- static int level = -1;
- if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
- return level;
+ void newChangeDet() {
+ if (++m_detects > DETECTARRAY_MAX_INDEXES) {
+ m_vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect more than "<<cvtToStr(DETECTARRAY_MAX_INDEXES)
+ <<" array indexes (probably with UNOPTFLAT warning suppressed): "<<m_vscp->prettyName()<<endl
+ <<m_vscp->warnMore()
+ <<"... Could recompile with DETECTARRAY_MAX_INDEXES increased"<<endl);
+ return;
+ }
+ AstChangeDet* changep = new AstChangeDet (m_vscp->fileline(),
+ m_varEqnp->cloneTree(true),
+ m_newRvEqnp->cloneTree(true), false);
+ m_statep->m_chgFuncp->addStmtsp(changep);
+ AstAssign* initp = new AstAssign (m_vscp->fileline(),
+ m_newLvEqnp->cloneTree(true),
+ m_varEqnp->cloneTree(true));
+ m_statep->m_chgFuncp->addFinalsp(initp);
}
- AstNode* aselIfNeeded(bool isArray, int index, AstNode* childp) {
- if (isArray) {
- return new AstArraySel(childp->fileline(), childp,
- new AstConst(childp->fileline(), index));
- } else {
- return childp;
- }
+ virtual void visit(AstBasicDType* nodep, AstNUser*) {
+ newChangeDet();
}
+ virtual void visit(AstPackArrayDType* nodep, AstNUser*) {
+ newChangeDet();
+ }
+ virtual void visit(AstUnpackArrayDType* nodep, AstNUser*) {
+ for (int index=0; index < nodep->elementsConst(); ++index) {
+ AstNode* origVEp = m_varEqnp;
+ AstNode* origNLEp = m_newLvEqnp;
+ AstNode* origNREp = m_newRvEqnp;
- void genChangeDet(AstVarScope* vscp) {
- AstVar* varp = vscp->varp();
- vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp);
- AstUnpackArrayDType* uarrayp = varp->dtypeSkipRefp()->castUnpackArrayDType();
- AstPackArrayDType* parrayp = varp->dtypeSkipRefp()->castPackArrayDType();
- AstNodeClassDType *classp = varp->dtypeSkipRefp()->castNodeClassDType();
- bool isUnpackArray = uarrayp;
- bool isPackArray = parrayp;
- bool isClass = classp && classp->packedUnsup();
- int elements = isUnpackArray ? uarrayp->elementsConst() : 1;
- if (isUnpackArray && (elements > DETECTARRAY_MAX_INDEXES)) {
- vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect more than "<<cvtToStr(DETECTARRAY_MAX_INDEXES)
- <<" array indexes (probably with UNOPTFLAT warning suppressed): "<<varp->prettyName()<<endl
- <<vscp->warnMore()
- <<"... Could recompile with DETECTARRAY_MAX_INDEXES increased to at least "<<cvtToStr(elements));
- } else if (!isUnpackArray && !isClass && !isPackArray
- && !varp->dtypeSkipRefp()->castBasicDType()) {
- if (debug()) varp->dumpTree(cout,"-DETECTARRAY-");
- vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect changes on complex variable (probably with UNOPTFLAT warning suppressed): "<<varp->prettyName());
+ m_varEqnp = new AstArraySel(nodep->fileline(), m_varEqnp->cloneTree(true), index);
+ m_newLvEqnp = new AstArraySel(nodep->fileline(), m_newLvEqnp->cloneTree(true), index);
+ m_newRvEqnp = new AstArraySel(nodep->fileline(), m_newRvEqnp->cloneTree(true), index);
+
+ nodep->subDTypep()->skipRefp()->accept(*this);
+
+ m_varEqnp->deleteTree();
+ m_newLvEqnp->deleteTree();
+ m_newRvEqnp->deleteTree();
+
+ m_varEqnp = origVEp;
+ m_newLvEqnp = origNLEp;
+ m_newRvEqnp = origNREp;
+ }
+ }
+ virtual void visit(AstNodeClassDType* nodep, AstNUser*) {
+ if (nodep->packedUnsup()) {
+ newChangeDet();
} else {
- string newvarname = "__Vchglast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName();
+ if (debug()) nodep->dumpTree(cout,"-DETECTARRAY-class-");
+ m_vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect changes on complex variable (probably with UNOPTFLAT warning suppressed): "<<m_vscp->varp()->prettyName());
+ }
+ }
+ virtual void visit(AstNode* nodep, AstNUser*) {
+ nodep->iterateChildren(*this);
+ if (debug()) nodep->dumpTree(cout,"-DETECTARRAY-general-");
+ m_vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect changes on complex variable (probably with UNOPTFLAT warning suppressed): "<<m_vscp->varp()->prettyName());
+ }
+public:
+ // CONSTUCTORS
+ ChangedInsertVisitor(AstVarScope* vscp, ChangedState* statep) {
+ m_statep = statep;
+ m_vscp = vscp;
+ m_detects = 0;
+ {
+ AstVar* varp = m_vscp->varp();
+ string newvarname = "__Vchglast__"+m_vscp->scopep()->nameDotless()+"__"+varp->shortName();
// Create: VARREF(_last)
// ASSIGN(VARREF(_last), VARREF(var))
// ...
// CHANGEDET(VARREF(_last), VARREF(var))
AstVar* newvarp = new AstVar (varp->fileline(), AstVarType::MODULETEMP, newvarname, varp);
- m_topModp->addStmtp(newvarp);
- AstVarScope* newvscp = new AstVarScope(vscp->fileline(), m_scopetopp, newvarp);
- m_scopetopp->addVarp(newvscp);
- for (int index=0; index<elements; ++index) {
- AstChangeDet* changep
- = new AstChangeDet (vscp->fileline(),
- aselIfNeeded(isUnpackArray, index,
- new AstVarRef(vscp->fileline(), vscp, false)),
- aselIfNeeded(isUnpackArray, index,
- new AstVarRef(vscp->fileline(), newvscp, false)),
- false);
- m_chgFuncp->addStmtsp(changep);
- AstAssign* initp
- = new AstAssign (vscp->fileline(),
- aselIfNeeded(isUnpackArray, index,
- new AstVarRef(vscp->fileline(), newvscp, true)),
- aselIfNeeded(isUnpackArray, index,
- new AstVarRef(vscp->fileline(), vscp, false)));
- m_chgFuncp->addFinalsp(initp);
- }
+ m_statep->m_topModp->addStmtp(newvarp);
+ m_newvscp = new AstVarScope(m_vscp->fileline(), m_statep->m_scopetopp, newvarp);
+ m_statep->m_scopetopp->addVarp(m_newvscp);
+
+ m_varEqnp = new AstVarRef(m_vscp->fileline(), m_vscp, false);
+ m_newLvEqnp = new AstVarRef(m_vscp->fileline(), m_newvscp, true);
+ m_newRvEqnp = new AstVarRef(m_vscp->fileline(), m_newvscp, false);
}
+ vscp->dtypep()->skipRefp()->accept(*this);
+ m_varEqnp->deleteTree();
+ m_newLvEqnp->deleteTree();
+ m_newRvEqnp->deleteTree();
+ }
+ virtual ~ChangedInsertVisitor() {}
+};
+
+//######################################################################
+// Changed state, as a visitor of each AstNode
+
+class ChangedVisitor : public AstNVisitor {
+private:
+ // NODE STATE
+ // Entire netlist:
+ // AstVarScope::user1() -> bool. True indicates processed
+ AstUser1InUse m_inuser1;
+
+ // STATE
+ ChangedState* m_statep; // Shared state across visitors
+
+ // METHODS
+ static int debug() {
+ static int level = -1;
+ if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__);
+ return level;
+ }
+
+ void genChangeDet(AstVarScope* vscp) {
+ vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp);
+ ChangedInsertVisitor visitor (vscp, m_statep);
}
// VISITORS
virtual void visit(AstNodeModule* nodep, AstNUser*) {
UINFO(4," MOD "<<nodep<<endl);
if (nodep->isTop()) {
- m_topModp = nodep;
+ m_statep->m_topModp = nodep;
}
nodep->iterateChildren(*this);
}
@@ -144,15 +207,15 @@ private:
// Create the change detection function
AstScope* scopep = nodep->scopep();
if (!scopep) nodep->v3fatalSrc("No scope found on top level, perhaps you have no statements?\n");
- m_scopetopp = scopep;
+ m_statep->m_scopetopp = scopep;
// Create change detection function
- m_chgFuncp = new AstCFunc(nodep->fileline(), "_change_request", scopep, "QData");
- m_chgFuncp->argTypes(EmitCBaseVisitor::symClassVar());
- m_chgFuncp->symProlog(true);
- m_chgFuncp->declPrivate(true);
- m_scopetopp->addActivep(m_chgFuncp);
+ m_statep->m_chgFuncp = new AstCFunc(nodep->fileline(), "_change_request", scopep, "QData");
+ m_statep->m_chgFuncp->argTypes(EmitCBaseVisitor::symClassVar());
+ m_statep->m_chgFuncp->symProlog(true);
+ m_statep->m_chgFuncp->declPrivate(true);
+ m_statep->m_scopetopp->addActivep(m_statep->m_chgFuncp);
// We need at least one change detect so we know to emit the correct code
- m_chgFuncp->addStmtsp(new AstChangeDet(nodep->fileline(), NULL, NULL, false));
+ m_statep->m_chgFuncp->addStmtsp(new AstChangeDet(nodep->fileline(), NULL, NULL, false));
//
nodep->iterateChildren(*this);
}
@@ -164,6 +227,9 @@ private:
}
}
}
+ virtual void visit(AstNodeMath* nodep, AstNUser*) {
+ // Short-circuit
+ }
//--------------------
// Default: Just iterate
virtual void visit(AstNode* nodep, AstNUser*) {
@@ -172,10 +238,8 @@ private:
public:
// CONSTUCTORS
- ChangedVisitor(AstNetlist* nodep) {
- m_topModp = NULL;
- m_chgFuncp = NULL;
- m_scopetopp = NULL;
+ ChangedVisitor(AstNetlist* nodep, ChangedState* statep) {
+ m_statep = statep;
nodep->accept(*this);
}
virtual ~ChangedVisitor() {}
@@ -186,5 +250,6 @@ public:
void V3Changed::changedAll(AstNetlist* nodep) {
UINFO(2,__FUNCTION__<<": "<<endl);
- ChangedVisitor visitor (nodep);
+ ChangedState state;
+ ChangedVisitor visitor (nodep, &state);
}
diff --git a/src/V3Changed.h b/src/V3Changed.h
index 7dd7f76..e5f58da 100644
--- a/src/V3Changed.h
+++ b/src/V3Changed.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Clean.cpp b/src/V3Clean.cpp
index 18dd12e..720f84f 100644
--- a/src/V3Clean.cpp
+++ b/src/V3Clean.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Clean.h b/src/V3Clean.h
index 2268422..063f04b 100644
--- a/src/V3Clean.h
+++ b/src/V3Clean.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ClkGater.cpp b/src/V3ClkGater.cpp
index 97a9d93..7773573 100644
--- a/src/V3ClkGater.cpp
+++ b/src/V3ClkGater.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2008-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2008-2015 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.
diff --git a/src/V3ClkGater.h b/src/V3ClkGater.h
index 4d55f3a..67db77d 100644
--- a/src/V3ClkGater.h
+++ b/src/V3ClkGater.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp
index b1ebdcd..c622671 100644
--- a/src/V3Clock.cpp
+++ b/src/V3Clock.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -99,18 +99,6 @@ private:
UINFO(4,"New Last: "<<newvscp<<endl);
return newvscp;
}
- AstVarScope* getCreateLocalVar(FileLine* fl, const string& name, AstVar* examplep, int width) {
- AstVar* newvarp;
- if (width) {
- newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, VFlagLogicPacked(), width);
- } else {
- newvarp = new AstVar (fl, AstVarType::BLOCKTEMP, name, examplep); // No range; 1 bit.
- }
- m_modp->addStmtp(newvarp);
- AstVarScope* newvscp = new AstVarScope(fl, m_scopep, newvarp);
- m_scopep->addVarp(newvscp);
- return newvscp;
- }
AstNode* createSenItemEquation(AstSenItem* nodep) {
// We know the var is clean, and one bit, so we use binary ops
// for speed instead of logical ops.
diff --git a/src/V3Clock.h b/src/V3Clock.h
index 6a43ba8..036c978 100644
--- a/src/V3Clock.h
+++ b/src/V3Clock.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp
index ec5c33d..6b7bd50 100644
--- a/src/V3Combine.cpp
+++ b/src/V3Combine.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Combine.h b/src/V3Combine.h
index b3e3c73..95cbcee 100644
--- a/src/V3Combine.h
+++ b/src/V3Combine.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Config.cpp b/src/V3Config.cpp
index a881515..bf90198 100644
--- a/src/V3Config.cpp
+++ b/src/V3Config.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2010-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2010-2015 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.
diff --git a/src/V3Config.h b/src/V3Config.h
index c129277..5575077 100644
--- a/src/V3Config.h
+++ b/src/V3Config.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2010-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2010-2015 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.
diff --git a/src/V3Const.cpp b/src/V3Const.cpp
index a0b7484..2629169 100644
--- a/src/V3Const.cpp
+++ b/src/V3Const.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Const.h b/src/V3Const.h
index f8dc7df..4e91068 100644
--- a/src/V3Const.h
+++ b/src/V3Const.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp
index 3582aa4..32b48a9 100644
--- a/src/V3Coverage.cpp
+++ b/src/V3Coverage.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Coverage.h b/src/V3Coverage.h
index 42921d3..007cc71 100644
--- a/src/V3Coverage.h
+++ b/src/V3Coverage.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3CoverageJoin.cpp b/src/V3CoverageJoin.cpp
index 67fc0cc..8dc17c0 100644
--- a/src/V3CoverageJoin.cpp
+++ b/src/V3CoverageJoin.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3CoverageJoin.h b/src/V3CoverageJoin.h
index 72d4cea..9d6ca61 100644
--- a/src/V3CoverageJoin.h
+++ b/src/V3CoverageJoin.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp
index 0e9d010..088e3f6 100644
--- a/src/V3Dead.cpp
+++ b/src/V3Dead.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Dead.h b/src/V3Dead.h
index fbab621..079f59c 100644
--- a/src/V3Dead.h
+++ b/src/V3Dead.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp
index 3fb8cf7..021575f 100644
--- a/src/V3Delayed.cpp
+++ b/src/V3Delayed.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Delayed.h b/src/V3Delayed.h
index 484a624..1120d3b 100644
--- a/src/V3Delayed.h
+++ b/src/V3Delayed.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp
index 44349c0..bcecd4e 100644
--- a/src/V3Depth.cpp
+++ b/src/V3Depth.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Depth.h b/src/V3Depth.h
index 0ef0f66..6ace6c6 100644
--- a/src/V3Depth.h
+++ b/src/V3Depth.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp
index f0d4630..e9e7d87 100644
--- a/src/V3DepthBlock.cpp
+++ b/src/V3DepthBlock.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3DepthBlock.h b/src/V3DepthBlock.h
index 4a94957..56a6854 100644
--- a/src/V3DepthBlock.h
+++ b/src/V3DepthBlock.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp
index 2723333..d710f33 100644
--- a/src/V3Descope.cpp
+++ b/src/V3Descope.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Descope.h b/src/V3Descope.h
index fb95b72..0fd5f66 100644
--- a/src/V3Descope.h
+++ b/src/V3Descope.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp
index a26f9c6..b307a47 100644
--- a/src/V3EmitC.cpp
+++ b/src/V3EmitC.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -78,7 +78,9 @@ public:
bool emitSimpleOk(AstNodeMath* nodep);
void emitIQW(AstNode* nodep) {
// Other abbrevs: "C"har, "S"hort, "F"loat, "D"ouble, stri"N"g
- puts (nodep->isWide()?"W":(nodep->isQuad()?"Q":"I"));
+ puts (nodep->isString() ? "N"
+ : nodep->isWide() ? "W"
+ : nodep->isQuad() ? "Q" : "I");
}
void emitScIQW(AstVar* nodep) {
puts (nodep->isScBigUint() ? "SB"
@@ -735,7 +737,6 @@ class EmitCImp : EmitCStmts {
// METHODS
void doubleOrDetect(AstChangeDet* changep, bool& gotOne) {
- static int addDoubleOr = 10; // Determined experimentally as best
if (!changep->rhsp()) {
if (!gotOne) gotOne = true;
else puts(" | ");
@@ -744,6 +745,7 @@ class EmitCImp : EmitCStmts {
else {
AstNode* lhsp = changep->lhsp();
AstNode* rhsp = changep->rhsp();
+ static int addDoubleOr = 10; // Determined experimentally as best
if (!lhsp->castVarRef() && !lhsp->castArraySel()) changep->v3fatalSrc("Not ref?");
if (!rhsp->castVarRef() && !rhsp->castArraySel()) changep->v3fatalSrc("Not ref?");
for (int word=0; word<changep->lhsp()->widthWords(); word++) {
@@ -1970,6 +1972,10 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
if (v3Global.opt.trace() && !optSystemPerl()) {
if (modp->isTop()) puts("/// Trace signals in the model; called by application code\n");
puts("void trace (VerilatedVcdC* tfp, int levels, int options=0);\n");
+ if (modp->isTop() && optSystemC()) {
+ puts("/// SC tracing; avoid overloaded virtual function lint warning\n");
+ puts("virtual void trace (sc_trace_file* tfp) const { ::sc_core::sc_module::trace(tfp); }\n");
+ }
}
puts("\n// USER METHODS\n");
@@ -2101,7 +2107,6 @@ void EmitCImp::main(AstNodeModule* modp, bool slow, bool fast) {
m_modp = modp;
m_slow = slow;
m_fast = fast;
- string filenameNoExt = v3Global.opt.makeDir()+"/"+ modClassName(modp)+(m_fast ? "" : "__Slow");
if (debug()>=5) {
UINFO(0," Emitting "<<modClassName(modp)<<endl);
diff --git a/src/V3EmitC.h b/src/V3EmitC.h
index ed8d6fa..392b3a0 100644
--- a/src/V3EmitC.h
+++ b/src/V3EmitC.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitCBase.h b/src/V3EmitCBase.h
index 354b844..df84d2e 100644
--- a/src/V3EmitCBase.h
+++ b/src/V3EmitCBase.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitCInlines.cpp b/src/V3EmitCInlines.cpp
index ce45bf1..93dab1f 100644
--- a/src/V3EmitCInlines.cpp
+++ b/src/V3EmitCInlines.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp
index 991cbca..152e965 100644
--- a/src/V3EmitCSyms.cpp
+++ b/src/V3EmitCSyms.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -70,6 +70,7 @@ class EmitCSyms : EmitCBaseVisitor {
struct CmpDpi {
inline bool operator () (const AstCFunc* lhsp, const AstCFunc* rhsp) const {
if (lhsp->dpiImport() != rhsp->dpiImport()) {
+ // cppcheck-suppress comparisonOfFuncReturningBoolError
return lhsp->dpiImport() < rhsp->dpiImport();
}
return lhsp->name() < rhsp->name();
diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp
index 1c7a827..b17686b 100644
--- a/src/V3EmitMk.cpp
+++ b/src/V3EmitMk.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3EmitMk.h b/src/V3EmitMk.h
index 131ec44..1d3dd8c 100644
--- a/src/V3EmitMk.h
+++ b/src/V3EmitMk.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitV.cpp b/src/V3EmitV.cpp
index 35d8cc6..23a30f6 100644
--- a/src/V3EmitV.cpp
+++ b/src/V3EmitV.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3EmitV.h b/src/V3EmitV.h
index d9a35d8..8aca1e7 100644
--- a/src/V3EmitV.h
+++ b/src/V3EmitV.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3EmitXml.cpp b/src/V3EmitXml.cpp
index 9e2dd8c..e9e5abe 100644
--- a/src/V3EmitXml.cpp
+++ b/src/V3EmitXml.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3EmitXml.h b/src/V3EmitXml.h
index 9401dab..c031211 100644
--- a/src/V3EmitXml.h
+++ b/src/V3EmitXml.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Error.cpp b/src/V3Error.cpp
index 514a40f..c53351b 100644
--- a/src/V3Error.cpp
+++ b/src/V3Error.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Error.h b/src/V3Error.h
index 2e810ec..7d563a8 100644
--- a/src/V3Error.h
+++ b/src/V3Error.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp
index 25c8297..12932ee 100644
--- a/src/V3Expand.cpp
+++ b/src/V3Expand.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Expand.h b/src/V3Expand.h
index 88d67bf..fe3a217 100644
--- a/src/V3Expand.h
+++ b/src/V3Expand.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3File.cpp b/src/V3File.cpp
index 0247b73..5885ba1 100644
--- a/src/V3File.cpp
+++ b/src/V3File.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3File.h b/src/V3File.h
index c64db80..9dbcb86 100644
--- a/src/V3File.h
+++ b/src/V3File.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp
index 7286a59..f540913 100644
--- a/src/V3FileLine.cpp
+++ b/src/V3FileLine.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3FileLine.h b/src/V3FileLine.h
index 93d1144..1c5e736 100644
--- a/src/V3FileLine.h
+++ b/src/V3FileLine.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp
index ebc7cb8..25bef49 100644
--- a/src/V3Gate.cpp
+++ b/src/V3Gate.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -34,6 +34,7 @@
#include <iomanip>
#include <vector>
#include <list>
+#include <map>
#include "V3Global.h"
#include "V3Gate.h"
@@ -346,6 +347,7 @@ private:
}
void optimizeSignals(bool allowMultiIn);
+ bool elimLogicOkOutputs(GateLogicVertex* consumeVertexp, const GateOkVisitor& okVisitor);
void optimizeElimVar(AstVarScope* varscp, AstNode* logicp, AstNode* consumerp);
void warnSignals();
void consumedMark();
@@ -591,40 +593,51 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
if (debug()>=5) logicp->dumpTree(cout,"\telimVar: ");
if (debug()>=5) substp->dumpTree(cout,"\t subst: ");
++m_statSigs;
- while (V3GraphEdge* edgep = vvertexp->outBeginp()) {
+ bool removedAllUsages = true;
+ for (V3GraphEdge* edgep = vvertexp->outBeginp();
+ edgep; ) {
GateLogicVertex* consumeVertexp = dynamic_cast<GateLogicVertex*>(edgep->top());
AstNode* consumerp = consumeVertexp->nodep();
- optimizeElimVar(vvertexp->varScp(), substp, consumerp);
- // If the new replacement referred to a signal,
- // Correct the graph to point to this new generating variable
- const GateVarRefList& rhsVarRefs = okVisitor.rhsVarRefs();
- for (GateVarRefList::const_iterator it = rhsVarRefs.begin();
- it != rhsVarRefs.end(); ++it) {
- AstVarScope* newvarscp = (*it)->varScopep();
- UINFO(9," Point-to-new vertex "<<newvarscp<<endl);
- GateVarVertex* varvertexp = makeVarVertex(newvarscp);
- new V3GraphEdge(&m_graph, varvertexp, consumeVertexp, 1);
- // Propagate clock attribute onto generating node
- varvertexp->propagateAttrClocksFrom(vvertexp);
+ if (!elimLogicOkOutputs(consumeVertexp, okVisitor/*ref*/)) {
+ // Cannot optimize this replacement
+ removedAllUsages = false;
+ edgep = edgep->outNextp();
+ } else {
+ optimizeElimVar(vvertexp->varScp(), substp, consumerp);
+ // If the new replacement referred to a signal,
+ // Correct the graph to point to this new generating variable
+ const GateVarRefList& rhsVarRefs = okVisitor.rhsVarRefs();
+ for (GateVarRefList::const_iterator it = rhsVarRefs.begin();
+ it != rhsVarRefs.end(); ++it) {
+ AstVarScope* newvarscp = (*it)->varScopep();
+ UINFO(9," Point-to-new vertex "<<newvarscp<<endl);
+ GateVarVertex* varvertexp = makeVarVertex(newvarscp);
+ new V3GraphEdge(&m_graph, varvertexp, consumeVertexp, 1);
+ // Propagate clock attribute onto generating node
+ varvertexp->propagateAttrClocksFrom(vvertexp);
+ }
+ // Remove the edge
+ edgep->unlinkDelete(); edgep=NULL;
+ ++m_statRefs;
+ edgep = vvertexp->outBeginp();
}
- // Remove the edge
- edgep->unlinkDelete(); edgep=NULL;
- ++m_statRefs;
}
- // Remove input links
- while (V3GraphEdge* edgep = vvertexp->inBeginp()) {
- edgep->unlinkDelete(); edgep=NULL;
+ if (removedAllUsages) {
+ // Remove input links
+ while (V3GraphEdge* edgep = vvertexp->inBeginp()) {
+ edgep->unlinkDelete(); edgep=NULL;
+ }
+ // Clone tree so we remember it for tracing, and keep the pointer
+ // to the "ALWAYS" part of the tree as part of this statement
+ // That way if a later signal optimization that retained a pointer to the always
+ // can optimize it further
+ logicp->unlinkFrBack();
+ vvertexp->varScp()->valuep(logicp);
+ logicp = NULL;
+ // Mark the vertex so we don't mark it as being unconsumed in the next step
+ vvertexp->user(true);
+ logicVertexp->user(true);
}
- // Clone tree so we remember it for tracing, and keep the pointer
- // to the "ALWAYS" part of the tree as part of this statement
- // That way if a later signal optimization that retained a pointer to the always
- // can optimize it further
- logicp->unlinkFrBack();
- vvertexp->varScp()->valuep(logicp);
- logicp = NULL;
- // Mark the vertex so we don't mark it as being unconsumed in the next step
- vvertexp->user(true);
- logicVertexp->user(true);
}
}
}
@@ -632,6 +645,30 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
}
}
+bool GateVisitor::elimLogicOkOutputs(GateLogicVertex* consumeVertexp, const GateOkVisitor& okVisitor) {
+ // Return true if can optimize
+ // Return false if the consuming logic has an output signal that the replacement logic has as an input
+ typedef set<AstVarScope*> VarScopeSet;
+ // Use map to find duplicates between two lists
+ VarScopeSet varscopes;
+ // Replacement logic usually has shorter input list, so faster to build list based on it
+ const GateVarRefList& rhsVarRefs = okVisitor.rhsVarRefs();
+ for (GateVarRefList::const_iterator it = rhsVarRefs.begin();
+ it != rhsVarRefs.end(); ++it) {
+ AstVarScope* vscp = (*it)->varScopep();
+ if (varscopes.find(vscp) == varscopes.end()) varscopes.insert(vscp);
+ }
+ for (V3GraphEdge* edgep = consumeVertexp->outBeginp(); edgep; edgep = edgep->outNextp()) {
+ GateVarVertex* consVVertexp = dynamic_cast<GateVarVertex*>(edgep->top());
+ AstVarScope* vscp = consVVertexp->varScp();
+ if (varscopes.find(vscp) != varscopes.end()) {
+ UINFO(9," Block-unopt, insertion generates input vscp "<<vscp<<endl);
+ return false;
+ }
+ }
+ return true;
+}
+
void GateVisitor::replaceAssigns() {
for (V3GraphVertex* itp = m_graph.verticesBeginp(); itp; itp=itp->verticesNextp()) {
if (GateVarVertex* vvertexp = dynamic_cast<GateVarVertex*>(itp)) {
diff --git a/src/V3Gate.h b/src/V3Gate.h
index 012ce0f..25d2b52 100644
--- a/src/V3Gate.h
+++ b/src/V3Gate.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GenClk.cpp b/src/V3GenClk.cpp
index 3fe5a48..711a11b 100644
--- a/src/V3GenClk.cpp
+++ b/src/V3GenClk.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GenClk.h b/src/V3GenClk.h
index 24ab296..d7649c5 100644
--- a/src/V3GenClk.h
+++ b/src/V3GenClk.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Global.h b/src/V3Global.h
index a4b4fac..8bd82ce 100644
--- a/src/V3Global.h
+++ b/src/V3Global.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Graph.cpp b/src/V3Graph.cpp
index d80969c..f219f1e 100644
--- a/src/V3Graph.cpp
+++ b/src/V3Graph.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Graph.h b/src/V3Graph.h
index 452f542..80f80a9 100644
--- a/src/V3Graph.h
+++ b/src/V3Graph.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GraphAcyc.cpp b/src/V3GraphAcyc.cpp
index 169f6d2..504f4f0 100644
--- a/src/V3GraphAcyc.cpp
+++ b/src/V3GraphAcyc.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -47,7 +47,8 @@ protected:
public:
GraphAcycVertex(V3Graph* graphp, V3GraphVertex* origVertexp)
- : V3GraphVertex(graphp), m_origVertexp(origVertexp), m_onWorkList(false), m_deleted(false) {
+ : V3GraphVertex(graphp), m_origVertexp(origVertexp)
+ , m_storedRank(0), m_onWorkList(false), m_deleted(false) {
}
virtual ~GraphAcycVertex() {}
V3GraphVertex* origVertexp() const { return m_origVertexp; }
@@ -185,6 +186,7 @@ public:
GraphAcyc(V3Graph* origGraphp, V3EdgeFuncP edgeFuncp) {
m_origGraphp = origGraphp;
m_origEdgeFuncp = edgeFuncp;
+ m_placeStep = 0;
}
~GraphAcyc() {
for (vector<OrigEdgeList*>::iterator it = m_origEdgeDelp.begin(); it != m_origEdgeDelp.end(); ++it) {
diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp
index f562d56..141a7f9 100644
--- a/src/V3GraphAlg.cpp
+++ b/src/V3GraphAlg.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GraphAlg.h b/src/V3GraphAlg.h
index 4b44c3b..66e74cd 100644
--- a/src/V3GraphAlg.h
+++ b/src/V3GraphAlg.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GraphDfa.cpp b/src/V3GraphDfa.cpp
index 1e99429..23c9671 100644
--- a/src/V3GraphDfa.cpp
+++ b/src/V3GraphDfa.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
@@ -74,7 +74,7 @@ private:
// METHODS
DfaGraph* graphp() { return static_cast<DfaGraph*>(m_graphp); }
bool nfaState(V3GraphVertex* vertexp) { return vertexp->color()==0; }
- bool dfaState(V3GraphVertex* vertexp) { return vertexp->color()==1; }
+ //bool dfaState(V3GraphVertex* vertexp) { return vertexp->color()==1; }
void nextStep() { m_step++; }
diff --git a/src/V3GraphDfa.h b/src/V3GraphDfa.h
index 7cd0afd..83b98c2 100644
--- a/src/V3GraphDfa.h
+++ b/src/V3GraphDfa.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3GraphTest.cpp b/src/V3GraphTest.cpp
index ae305c0..96018b2 100644
--- a/src/V3GraphTest.cpp
+++ b/src/V3GraphTest.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Hashed.cpp b/src/V3Hashed.cpp
index 9587a25..9f3449a 100644
--- a/src/V3Hashed.cpp
+++ b/src/V3Hashed.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Hashed.h b/src/V3Hashed.h
index c6195b7..acd0f75 100644
--- a/src/V3Hashed.h
+++ b/src/V3Hashed.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp
index b98897a..bb451c6 100644
--- a/src/V3Inline.cpp
+++ b/src/V3Inline.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Inline.h b/src/V3Inline.h
index 4cee17f..78c8763 100644
--- a/src/V3Inline.h
+++ b/src/V3Inline.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp
index 7982b73..63850a5 100644
--- a/src/V3Inst.cpp
+++ b/src/V3Inst.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Inst.h b/src/V3Inst.h
index 1438d20..d426ea3 100644
--- a/src/V3Inst.h
+++ b/src/V3Inst.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LangCode.h b/src/V3LangCode.h
index d3bf50b..a9209cf 100644
--- a/src/V3LangCode.h
+++ b/src/V3LangCode.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LanguageWords.h b/src/V3LanguageWords.h
index 1ea70af..0d53411 100644
--- a/src/V3LanguageWords.h
+++ b/src/V3LanguageWords.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3Life.cpp b/src/V3Life.cpp
index 2c50fa3..10c2afe 100644
--- a/src/V3Life.cpp
+++ b/src/V3Life.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -163,7 +163,7 @@ public:
if (debug()>4) oldassp->dumpTree(cout, " REMOVE/SAMEBLK ");
entp->complexAssign();
m_statep->pushUnlinkDeletep(oldassp); oldassp=NULL;
- m_statep->m_statAssnDel++;
+ ++m_statep->m_statAssnDel;
}
}
}
@@ -200,7 +200,7 @@ public:
UINFO(4," replaceconst: "<<varrefp<<endl);
varrefp->replaceWith(constp->cloneTree(false));
varrefp->deleteTree(); varrefp=NULL;
- m_statep->m_statAssnCon++;
+ ++m_statep->m_statAssnCon;
return; // **DONE, no longer a var reference**
}
}
diff --git a/src/V3Life.h b/src/V3Life.h
index 15c340f..c034639 100644
--- a/src/V3Life.h
+++ b/src/V3Life.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp
index e1f2ab4..7d0c231 100644
--- a/src/V3LifePost.cpp
+++ b/src/V3LifePost.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LifePost.h b/src/V3LifePost.h
index dc02642..d8baf7e 100644
--- a/src/V3LifePost.h
+++ b/src/V3LifePost.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp
index e58cdf3..4a75efb 100644
--- a/src/V3LinkCells.cpp
+++ b/src/V3LinkCells.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkCells.h b/src/V3LinkCells.h
index 60785be..338381b 100644
--- a/src/V3LinkCells.h
+++ b/src/V3LinkCells.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp
index 204d29b..9a5d973 100644
--- a/src/V3LinkDot.cpp
+++ b/src/V3LinkDot.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -1558,9 +1558,9 @@ private:
string expectWhat;
bool allowScope = false;
bool allowVar = false;
- AstPackage* packagep = NULL;
if (m_ds.m_dotPos == DP_PACKAGE) {
// {package}::{a}
+ AstPackage* packagep = NULL;
expectWhat = "scope/variable";
allowScope = true;
allowVar = true;
diff --git a/src/V3LinkDot.h b/src/V3LinkDot.h
index b8a2cab..a3e4019 100644
--- a/src/V3LinkDot.h
+++ b/src/V3LinkDot.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp
index f1a107e..5671bb9 100644
--- a/src/V3LinkJump.cpp
+++ b/src/V3LinkJump.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkJump.h b/src/V3LinkJump.h
index 4e7eb73..c7c4ad7 100644
--- a/src/V3LinkJump.h
+++ b/src/V3LinkJump.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkLValue.cpp b/src/V3LinkLValue.cpp
index 5565ff6..cf9c093 100644
--- a/src/V3LinkLValue.cpp
+++ b/src/V3LinkLValue.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkLValue.h b/src/V3LinkLValue.h
index 11a1df7..d3cc353 100644
--- a/src/V3LinkLValue.h
+++ b/src/V3LinkLValue.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp
index 9d9c393..a940a95 100644
--- a/src/V3LinkLevel.cpp
+++ b/src/V3LinkLevel.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkLevel.h b/src/V3LinkLevel.h
index f5081cb..0fe3ba0 100644
--- a/src/V3LinkLevel.h
+++ b/src/V3LinkLevel.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp
index 34667da..8a54094 100644
--- a/src/V3LinkParse.cpp
+++ b/src/V3LinkParse.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkParse.h b/src/V3LinkParse.h
index aa662d5..c62bdf1 100644
--- a/src/V3LinkParse.h
+++ b/src/V3LinkParse.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp
index c0fd365..26b8599 100644
--- a/src/V3LinkResolve.cpp
+++ b/src/V3LinkResolve.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3LinkResolve.h b/src/V3LinkResolve.h
index 7202f45..02ab03f 100644
--- a/src/V3LinkResolve.h
+++ b/src/V3LinkResolve.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3List.h b/src/V3List.h
index ed6b9e9..3462bf9 100644
--- a/src/V3List.h
+++ b/src/V3List.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp
index 065e33d..05626b3 100644
--- a/src/V3Localize.cpp
+++ b/src/V3Localize.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Localize.h b/src/V3Localize.h
index 7fa44b8..8e512f3 100644
--- a/src/V3Localize.h
+++ b/src/V3Localize.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Name.cpp b/src/V3Name.cpp
index ae6eb81..8689efb 100644
--- a/src/V3Name.cpp
+++ b/src/V3Name.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Name.h b/src/V3Name.h
index efae442..c694edf 100644
--- a/src/V3Name.h
+++ b/src/V3Name.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Number.cpp b/src/V3Number.cpp
index 73606a7..33aeaa9 100644
--- a/src/V3Number.cpp
+++ b/src/V3Number.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Number.h b/src/V3Number.h
index e002eaa..31cb00d 100644
--- a/src/V3Number.h
+++ b/src/V3Number.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Number_test.cpp b/src/V3Number_test.cpp
index 868ba32..81c33ac 100644
--- a/src/V3Number_test.cpp
+++ b/src/V3Number_test.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Options.cpp b/src/V3Options.cpp
index 3f81aeb..8e6be3c 100644
--- a/src/V3Options.cpp
+++ b/src/V3Options.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -587,7 +587,7 @@ string V3Options::getenvVERILATOR_ROOT() {
string var = getenvStr("VERILATOR_ROOT","");
if (var == "" && string(DEFENV_VERILATOR_ROOT) != "") {
var = DEFENV_VERILATOR_ROOT;
- setenvStr("VERILATOR_ROOT", var.c_str(), "Hardcoded at build time");
+ setenvStr("VERILATOR_ROOT", var, "Hardcoded at build time");
}
if (var == "") {
v3fatal("$VERILATOR_ROOT needs to be in environment\n");
@@ -1074,7 +1074,6 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
}
string whole_file;
- string::size_type pos;
bool inCmt = false;
while (!ifp->eof()) {
string line;
@@ -1107,7 +1106,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
// Split into argument list and process
// Note we don't respect quotes. It seems most simulators dont.
// Woez those that expect it; we'll at least complain.
- if ((pos=whole_file.find("\"")) != string::npos) {
+ if (whole_file.find("\"") != string::npos) {
fl->v3error("Double quotes in -f files cause unspecified behavior.");
}
@@ -1170,7 +1169,7 @@ void V3Options::showVersion(bool verbose) {
if (!verbose) return;
cout <<endl;
- cout << "Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can\n";
+ cout << "Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you can\n";
cout << "redistribute it and/or modify the Verilator internals under the terms of\n";
cout << "either the GNU Lesser General Public License Version 3 or the Perl Artistic\n";
cout << "License Version 2.0.\n";
@@ -1207,7 +1206,11 @@ void V3Options::showVersion(bool verbose) {
V3Options::V3Options() {
m_impp = new V3OptionsImp;
+ m_assert = false;
m_autoflush = false;
+ m_bboxSys = false;
+ m_bboxUnsup = false;
+ m_cdc = false;
m_coverageLine = false;
m_coverageToggle = false;
m_coverageUnderscore = false;
@@ -1215,6 +1218,7 @@ V3Options::V3Options() {
m_debugCheck = false;
m_exe = false;
m_ignc = false;
+ m_inhibitSim = false;
m_l2Name = true;
m_lintOnly = false;
m_makeDepend = true;
@@ -1222,6 +1226,9 @@ V3Options::V3Options() {
m_orderClockDly = true;
m_outFormatOk = false;
m_pinsBv = 65;
+ m_pinsScUint = false;
+ m_pinsScBigUint = false;
+ m_pinsUint8 = false;
m_profileCFuncs = false;
m_preprocOnly = false;
m_preprocNoLine = false;
diff --git a/src/V3Options.h b/src/V3Options.h
index 6eb2200..cebe372 100644
--- a/src/V3Options.h
+++ b/src/V3Options.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Order.cpp b/src/V3Order.cpp
index 3e2998c..9c3d9be 100644
--- a/src/V3Order.cpp
+++ b/src/V3Order.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Order.h b/src/V3Order.h
index 7b90d84..5191aae 100644
--- a/src/V3Order.h
+++ b/src/V3Order.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3OrderGraph.h b/src/V3OrderGraph.h
index 0bba82a..a4bc6cb 100644
--- a/src/V3OrderGraph.h
+++ b/src/V3OrderGraph.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Param.cpp b/src/V3Param.cpp
index 3d1b13e..925804e 100644
--- a/src/V3Param.cpp
+++ b/src/V3Param.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -340,6 +340,7 @@ private:
AstNode* nextp = ep->nextp(); //May edit list
ep->iterateAndNext(*this);
V3Const::constifyParamsEdit(ep); ep=NULL; // ep may change
+ // cppcheck-suppress redundantAssignment
ep = nextp;
}
}
diff --git a/src/V3Param.h b/src/V3Param.h
index b3d1df0..1e081bd 100644
--- a/src/V3Param.h
+++ b/src/V3Param.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Parse.h b/src/V3Parse.h
index a655f3f..14a0a5f 100644
--- a/src/V3Parse.h
+++ b/src/V3Parse.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ParseGrammar.cpp b/src/V3ParseGrammar.cpp
index f44d993..6cf71d2 100644
--- a/src/V3ParseGrammar.cpp
+++ b/src/V3ParseGrammar.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ParseImp.cpp b/src/V3ParseImp.cpp
index 819a743..e9d84b7 100644
--- a/src/V3ParseImp.cpp
+++ b/src/V3ParseImp.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h
index b439ca6..4d24c7a 100644
--- a/src/V3ParseImp.h
+++ b/src/V3ParseImp.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
@@ -211,6 +211,7 @@ public:
m_prevLexToken = 0;
m_ahead = false;
m_aheadToken = 0;
+ // m_aheadVal not used as m_ahead = false
}
~V3ParseImp();
void parserClear();
diff --git a/src/V3ParseLex.cpp b/src/V3ParseLex.cpp
index f412ae7..d32c6e6 100644
--- a/src/V3ParseLex.cpp
+++ b/src/V3ParseLex.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3ParseSym.h b/src/V3ParseSym.h
index da68ddd..adc840b 100644
--- a/src/V3ParseSym.h
+++ b/src/V3ParseSym.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2009-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2009-2015 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.
diff --git a/src/V3PreLex.h b/src/V3PreLex.h
index 589d8d2..a5582ba 100644
--- a/src/V3PreLex.h
+++ b/src/V3PreLex.h
@@ -8,7 +8,7 @@
//
//*************************************************************************
//
-// Copyright 2000-2014 by Wilson Snyder. This program is free software;
+// Copyright 2000-2015 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.
diff --git a/src/V3PreLex.l b/src/V3PreLex.l
index 2592a29..bd20b39 100644
--- a/src/V3PreLex.l
+++ b/src/V3PreLex.l
@@ -10,7 +10,7 @@
*
**************************************************************************
*
- * Copyright 2003-2014 by Wilson Snyder. This program is free software;
+ * Copyright 2003-2015 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.
diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp
index f83e1d4..880b2ee 100644
--- a/src/V3PreProc.cpp
+++ b/src/V3PreProc.cpp
@@ -8,7 +8,7 @@
//
//*************************************************************************
//
-// Copyright 2000-2014 by Wilson Snyder. This program is free software;
+// Copyright 2000-2015 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.
@@ -623,7 +623,6 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
string out = "";
{ // Parse substitution define using arguments
string argName;
- string prev;
bool quote = false;
bool backslashesc = false; // In \.....{space} block
// Note we go through the loop once more at the NULL end-of-string
diff --git a/src/V3PreProc.h b/src/V3PreProc.h
index ff2feed..bd723a0 100644
--- a/src/V3PreProc.h
+++ b/src/V3PreProc.h
@@ -8,7 +8,7 @@
//
//*************************************************************************
//
-// Copyright 2000-2014 by Wilson Snyder. This program is free software;
+// Copyright 2000-2015 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.
diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp
index 89cd720..5f9a3bb 100644
--- a/src/V3PreShell.cpp
+++ b/src/V3PreShell.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3PreShell.h b/src/V3PreShell.h
index b59e2a5..776670f 100644
--- a/src/V3PreShell.h
+++ b/src/V3PreShell.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Premit.cpp b/src/V3Premit.cpp
index 23e0c31..3a92aaf 100644
--- a/src/V3Premit.cpp
+++ b/src/V3Premit.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Premit.h b/src/V3Premit.h
index 799d496..e6ac9d5 100644
--- a/src/V3Premit.h
+++ b/src/V3Premit.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp
index d3f2d73..51fc5f8 100644
--- a/src/V3Scope.cpp
+++ b/src/V3Scope.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Scope.h b/src/V3Scope.h
index c433019..21cae28 100644
--- a/src/V3Scope.h
+++ b/src/V3Scope.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3SenTree.h b/src/V3SenTree.h
index c9298d6..f9782f7 100644
--- a/src/V3SenTree.h
+++ b/src/V3SenTree.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Simulate.h b/src/V3Simulate.h
index b3b3da6..8b700cb 100644
--- a/src/V3Simulate.h
+++ b/src/V3Simulate.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -600,6 +600,7 @@ private:
UINFO(5," FUNCREF "<<nodep<<endl);
if (!m_params) { badNodeType(nodep); return; }
AstNodeFTask* funcp = nodep->taskp()->castNodeFTask(); if (!funcp) nodep->v3fatalSrc("Not linked");
+ // cppcheck-suppress redundantAssignment
if (m_params) { V3Width::widthParamsEdit(funcp); } funcp=NULL; // Make sure we've sized the function
funcp = nodep->taskp()->castNodeFTask(); if (!funcp) nodep->v3fatalSrc("Not linked");
// Apply function call values to function
diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp
index b41fc25..f5de6b1 100644
--- a/src/V3Slice.cpp
+++ b/src/V3Slice.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Slice.h b/src/V3Slice.h
index af8045e..eec3140 100644
--- a/src/V3Slice.h
+++ b/src/V3Slice.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Split.cpp b/src/V3Split.cpp
index 2df3783..9719a93 100644
--- a/src/V3Split.cpp
+++ b/src/V3Split.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -98,7 +98,7 @@ class SplitLogicVertex : public SplitNodeVertex {
uint32_t m_splitColor; // Copied from color() when determined
public:
SplitLogicVertex(V3Graph* graphp, AstNode* nodep)
- : SplitNodeVertex(graphp,nodep) {}
+ : SplitNodeVertex(graphp,nodep), m_splitColor(0) {}
void splitColor(uint32_t flag) { m_splitColor=flag; }
uint32_t splitColor() const { return m_splitColor; }
virtual ~SplitLogicVertex() {}
diff --git a/src/V3Split.h b/src/V3Split.h
index 4d1262d..23d8eef 100644
--- a/src/V3Split.h
+++ b/src/V3Split.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3SplitAs.cpp b/src/V3SplitAs.cpp
index d495458..8a8860f 100644
--- a/src/V3SplitAs.cpp
+++ b/src/V3SplitAs.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3SplitAs.h b/src/V3SplitAs.h
index 0481369..8c51199 100644
--- a/src/V3SplitAs.h
+++ b/src/V3SplitAs.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp
index ab36974..8bc62f6 100644
--- a/src/V3Stats.cpp
+++ b/src/V3Stats.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3Stats.h b/src/V3Stats.h
index df49adf..0673162 100644
--- a/src/V3Stats.h
+++ b/src/V3Stats.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp
index afcb21f..34b7d39 100644
--- a/src/V3StatsReport.cpp
+++ b/src/V3StatsReport.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2005-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2005-2015 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.
diff --git a/src/V3String.cpp b/src/V3String.cpp
index 07c008d..46b73a9 100644
--- a/src/V3String.cpp
+++ b/src/V3String.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3String.h b/src/V3String.h
index f3c3920..207cab8 100644
--- a/src/V3String.h
+++ b/src/V3String.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp
index e44e2d6..b1a409a 100644
--- a/src/V3Subst.cpp
+++ b/src/V3Subst.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Subst.h b/src/V3Subst.h
index 247ef46..6a054f2 100644
--- a/src/V3Subst.h
+++ b/src/V3Subst.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3SymTable.h b/src/V3SymTable.h
index 50a2fe5..62f6b64 100644
--- a/src/V3SymTable.h
+++ b/src/V3SymTable.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Table.cpp b/src/V3Table.cpp
index 625b005..6f86a02 100644
--- a/src/V3Table.cpp
+++ b/src/V3Table.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Table.h b/src/V3Table.h
index d242aa9..296dc55 100644
--- a/src/V3Table.h
+++ b/src/V3Table.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Task.cpp b/src/V3Task.cpp
index 4ec6a6f..a44ef23 100644
--- a/src/V3Task.cpp
+++ b/src/V3Task.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -548,7 +548,7 @@ private:
return beginp;
}
- string dpiprotoName(AstNodeFTask* nodep, AstVar* rtnvarp) {
+ string dpiprotoName(AstNodeFTask* nodep, AstVar* rtnvarp) const {
// Return fancy export-ish name for DPI function
// Variable names are NOT included so differences in only IO names won't matter
string dpiproto;
@@ -645,8 +645,6 @@ private:
}
AstCFunc* makeDpiExportWrapper(AstNodeFTask* nodep, AstVar* rtnvarp) {
- string dpiproto = dpiprotoName(nodep,rtnvarp);
-
AstCFunc* dpip = new AstCFunc(nodep->fileline(),
nodep->cname(),
m_scopep,
diff --git a/src/V3Task.h b/src/V3Task.h
index 41d94a2..58857f2 100644
--- a/src/V3Task.h
+++ b/src/V3Task.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp
index c87890b..56c3020 100644
--- a/src/V3Trace.cpp
+++ b/src/V3Trace.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Trace.h b/src/V3Trace.h
index 609a818..03b6c77 100644
--- a/src/V3Trace.h
+++ b/src/V3Trace.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp
index 2bbfbb4..7a057be 100644
--- a/src/V3TraceDecl.cpp
+++ b/src/V3TraceDecl.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3TraceDecl.h b/src/V3TraceDecl.h
index d96a9f4..3a729dd 100644
--- a/src/V3TraceDecl.h
+++ b/src/V3TraceDecl.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp
index 96c1597..f374d31 100644
--- a/src/V3Tristate.cpp
+++ b/src/V3Tristate.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -545,7 +545,6 @@ class TristateVisitor : public TristateBaseVisitor {
}
AstNode* orp = NULL;
- AstNode* andp = NULL;
AstNode* enp = NULL;
AstNode* undrivenp = NULL;
@@ -581,7 +580,7 @@ class TristateVisitor : public TristateBaseVisitor {
// now append this driver to the driver logic.
AstNode* ref1p = new AstVarRef(refp->fileline(), newlhsp,false);
AstNode* ref2p = new AstVarRef(refp->fileline(), newenp, false);
- andp = new AstAnd(refp->fileline(), ref1p, ref2p);
+ AstNode* andp = new AstAnd(refp->fileline(), ref1p, ref2p);
// or this to the others
orp = (!orp) ? andp : new AstOr(refp->fileline(), orp, andp);
diff --git a/src/V3Tristate.h b/src/V3Tristate.h
index a033bff..b445042 100644
--- a/src/V3Tristate.h
+++ b/src/V3Tristate.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp
index 94435f5..8fd1051 100644
--- a/src/V3Undriven.cpp
+++ b/src/V3Undriven.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2004-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2004-2015 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.
diff --git a/src/V3Undriven.h b/src/V3Undriven.h
index 48c3713..2422e3d 100644
--- a/src/V3Undriven.h
+++ b/src/V3Undriven.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Unknown.cpp b/src/V3Unknown.cpp
index 79e39e7..f56d89e 100644
--- a/src/V3Unknown.cpp
+++ b/src/V3Unknown.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -92,7 +92,7 @@ private:
UINFO(5," IM_WireRep "<<m_assignwp<<endl);
m_assignwp->convertToAlways(); pushDeletep(m_assignwp); m_assignwp=NULL;
}
- bool needDly = m_assigndlyp;
+ bool needDly = (m_assigndlyp != NULL);
if (m_assigndlyp) {
// Delayed assignments become normal assignments,
// then the temp created becomes the delayed assignment
diff --git a/src/V3Unknown.h b/src/V3Unknown.h
index 7821b58..9d86a3f 100644
--- a/src/V3Unknown.h
+++ b/src/V3Unknown.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp
index 135560d..2e46b2c 100644
--- a/src/V3Unroll.cpp
+++ b/src/V3Unroll.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Unroll.h b/src/V3Unroll.h
index 62e28fe..1634f2d 100644
--- a/src/V3Unroll.h
+++ b/src/V3Unroll.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3Width.cpp b/src/V3Width.cpp
index bb77134..9d1e913 100644
--- a/src/V3Width.cpp
+++ b/src/V3Width.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -660,6 +660,15 @@ private:
}
}
if (!m_doGenerate) {
+ // Must check bounds before adding a select that truncates the bound
+ // Note we've already subtracted off LSB
+ if (nodep->bitp()->castConst() && (nodep->bitp()->castConst()->toSInt() > (frommsb-fromlsb)
+ || nodep->bitp()->castConst()->toSInt() < 0)) {
+ nodep->v3warn(SELRANGE,"Selection index out of range: "
+ <<(nodep->bitp()->castConst()->toSInt()+fromlsb)
+ <<" outside "<<frommsb<<":"<<fromlsb);
+ UINFO(1," Related node: "<<nodep<<endl);
+ }
widthCheckSized(nodep,"Extract Range",nodep->bitp(),selwidthDTypep,EXTEND_EXP,false/*NOWARN*/);
}
}
@@ -945,6 +954,21 @@ private:
nodep->iterateChildren(*this);
nodep->dtypep(iterateEditDTypep(nodep, nodep->subDTypep()));
}
+ virtual void visit(AstCastParse* nodep, AstNUser* vup) {
+ // nodep->dtp could be data type, or a primary_constant
+ // Don't iterate lhsp, will deal with that once convert the type
+ V3Const::constifyParamsEdit(nodep->dtp()); // itemp may change
+ if (AstConst* constp = nodep->dtp()->castConst()) {
+ constp->unlinkFrBack();
+ AstNode* newp = new AstCastSize(nodep->fileline(), nodep->lhsp()->unlinkFrBack(), constp);
+ nodep->replaceWith(newp);
+ pushDeletep(nodep); nodep=NULL;
+ newp->accept(*this,vup);
+ } else {
+ nodep->v3error("Unsupported: Cast to "<<nodep->dtp()->prettyTypeName());
+ nodep->replaceWith(nodep->lhsp()->unlinkFrBack());
+ }
+ }
virtual void visit(AstCast* nodep, AstNUser* vup) {
if (nodep->childDTypep()) nodep->dtypep(moveChildDTypeEdit(nodep));
nodep->dtypep(iterateEditDTypep(nodep, nodep->dtypep()));
@@ -1311,8 +1335,9 @@ private:
}
virtual void visit(AstMemberSel* nodep, AstNUser* vup) {
UINFO(5," MEMBERSEL "<<nodep<<endl);
- if (debug()>=9) nodep->dumpTree("-ms-in-");
+ if (debug()>=9) nodep->dumpTree("-mbs-in: ");
nodep->iterateChildren(*this,WidthVP(SELF,BOTH).p());
+ if (debug()>=9) nodep->dumpTree("-mbs-ic: ");
// Find the fromp dtype - should be a class
AstNodeDType* fromDtp = nodep->fromp()->dtypep()->skipRefToEnump();
UINFO(9," from dt "<<fromDtp<<endl);
@@ -1341,12 +1366,14 @@ private:
if (m_attrp) { // Looking for the base of the attribute
nodep->dtypep(memberp);
UINFO(9," MEMBERSEL(attr) -> "<<nodep<<endl);
+ UINFO(9," dt-> "<<nodep->dtypep()<<endl);
} else {
AstSel* newp = new AstSel(nodep->fileline(), nodep->fromp()->unlinkFrBack(),
memberp->lsb(), memberp->width());
newp->dtypep(memberp->skipRefp()); // Must skip over the member to find the union; as the member may disappear later
newp->didWidth(true); // Don't replace dtype with basic type
UINFO(9," MEMBERSEL -> "<<newp<<endl);
+ UINFO(9," dt-> "<<newp->dtypep()<<endl);
nodep->replaceWith(newp);
pushDeletep(nodep); nodep=NULL;
// Should be able to treat it as a normal-ish nodesel - maybe. The lhsp() will be strange until this stage; create the number here?
@@ -1360,7 +1387,7 @@ private:
virtual void visit(AstMethodSel* nodep, AstNUser* vup) {
UINFO(5," METHODSEL "<<nodep<<endl);
- if (debug()>=9) nodep->dumpTree("-ms-in-");
+ if (debug()>=9) nodep->dumpTree("-mts-in: ");
// Should check types the method requires, but at present we don't do much
nodep->fromp()->accept(*this,WidthVP(SELF,BOTH).p());
for (AstArg* argp = nodep->pinsp()->castArg(); argp; argp = argp->nextp()->castArg()) {
@@ -1714,7 +1741,7 @@ private:
if (nodep->lhssp()->nextp()) nodep->v3fatalSrc("PatMember value should be singular w/replicates removed");
// Need to propagate assignment type downwards, even on prelim
nodep->iterateChildren(*this,WidthVP(nodep->dtypep(),BOTH).p());
- iterateCheck(nodep,"Pattern value",nodep->lhssp(),CONTEXT,FINAL,vdtypep,EXTEND_EXP);
+ iterateCheck(nodep,"Pattern value",nodep->lhssp(),CONTEXT,FINAL,vdtypep,EXTEND_LHS);
}
int visitPatMemberRep(AstPatMember* nodep) {
uint32_t times = 1;
@@ -2045,7 +2072,7 @@ private:
// TODO Simple dtype checking, should be a more general check
bool hiArray = nodep->exprp()->dtypep()->skipRefp()->castUnpackArrayDType();
bool loArray = nodep->modVarp()->dtypep()->skipRefp()->castUnpackArrayDType();
- if (loArray != hiArray) {
+ if (loArray != hiArray && pinwidth != conwidth) {
nodep->v3error("Illegal "<<nodep->prettyOperatorName()<<","
<<" mismatch between port which is"<<(hiArray?"":" not")<<" an array,"
<<" and expression which is"<<(loArray?"":" not")<<" an array.");
@@ -2845,9 +2872,9 @@ private:
underp->replaceWith(new AstConst(nodep->fileline(), AstConst::LogicFalse()));
pushDeletep(underp); underp=NULL;
} else {
- bool warnOn = true; // Not used
bool bad = widthBad(underp,nodep->findLogicBoolDType());
if (bad) {
+ bool warnOn = true; // Not used
if (warnOn) {
if (debug()>4) nodep->backp()->dumpTree(cout," back: ");
nodep->v3warn(WIDTH,"Logical Operator "<<nodep->prettyTypeName()
@@ -3411,11 +3438,6 @@ private:
nodep->v3fatalSrc("No dtype expected at statement "<<nodep->prettyTypeName());
}
}
- bool backRequiresUnsigned(AstNode* nodep) {
- // The spec doesn't state this, but if you have an array select where the selection
- // index is NOT wide enough, you do not sign extend, but always zero extend.
- return (nodep->castArraySel() || nodep->castSel());
- }
void checkConstantOrReplace(AstNode* nodep, const string& message) {
// See also V3WidthSel::checkConstantOrReplace
// Note can't call V3Const::constifyParam(nodep) here, as constify may change nodep on us!
diff --git a/src/V3Width.h b/src/V3Width.h
index c535301..bcebddb 100644
--- a/src/V3Width.h
+++ b/src/V3Width.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/V3WidthCommit.h b/src/V3WidthCommit.h
index e2deb28..ed71a54 100644
--- a/src/V3WidthCommit.h
+++ b/src/V3WidthCommit.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -74,7 +74,7 @@ public:
static AstConst* newIfConstCommitSize (AstConst* nodep) {
if (((nodep->dtypep()->width() != nodep->num().width())
|| !nodep->num().sized())
- && !nodep->num().isString()) { // Need to force the number rrom unsized to sized
+ && !nodep->num().isString()) { // Need to force the number from unsized to sized
V3Number num (nodep->fileline(), nodep->dtypep()->width());
num.opAssign(nodep->num());
num.isSigned(nodep->isSigned());
diff --git a/src/V3WidthSel.cpp b/src/V3WidthSel.cpp
index ed649b2..1173671 100644
--- a/src/V3WidthSel.cpp
+++ b/src/V3WidthSel.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/Verilator.cpp b/src/Verilator.cpp
index a33eb76..64888e2 100644
--- a/src/Verilator.cpp
+++ b/src/Verilator.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcBucket.h b/src/VlcBucket.h
index 1dd9bf1..686ac59 100644
--- a/src/VlcBucket.h
+++ b/src/VlcBucket.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcMain.cpp b/src/VlcMain.cpp
index 3aaf6df..f5a904d 100644
--- a/src/VlcMain.cpp
+++ b/src/VlcMain.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -121,7 +121,7 @@ void VlcOptions::showVersion(bool verbose) {
if (!verbose) return;
cout <<endl;
- cout << "Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can\n";
+ cout << "Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you can\n";
cout << "redistribute it and/or modify the Verilator internals under the terms of\n";
cout << "either the GNU Lesser General Public License Version 3 or the Perl Artistic\n";
cout << "License Version 2.0.\n";
diff --git a/src/VlcOptions.h b/src/VlcOptions.h
index d644085..eb33384 100644
--- a/src/VlcOptions.h
+++ b/src/VlcOptions.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcPoint.h b/src/VlcPoint.h
index a2aabb3..7db4b5a 100644
--- a/src/VlcPoint.h
+++ b/src/VlcPoint.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcSource.h b/src/VlcSource.h
index fc7e344..6ff5429 100644
--- a/src/VlcSource.h
+++ b/src/VlcSource.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcTest.h b/src/VlcTest.h
index 63675de..e058157 100644
--- a/src/VlcTest.h
+++ b/src/VlcTest.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp
index b71be0d..5ce59c8 100644
--- a/src/VlcTop.cpp
+++ b/src/VlcTop.cpp
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/VlcTop.h b/src/VlcTop.h
index 5c34c18..91f740c 100644
--- a/src/VlcTop.h
+++ b/src/VlcTop.h
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/astgen b/src/astgen
index e0c7885..f79582c 100755
--- a/src/astgen
+++ b/src/astgen
@@ -649,7 +649,7 @@ Makes a report report.
=head1 DISTRIBUTION
-Copyright 2002-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2002-2015 by Wilson Snyder. Verilator 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.
diff --git a/src/bisonpre b/src/bisonpre
index d5f8e5b..e8e1c6e 100755
--- a/src/bisonpre
+++ b/src/bisonpre
@@ -572,7 +572,7 @@ This is part of the L<http://www.veripool.org/> free Verilog EDA software
tool suite. The latest version is available from CPAN and from
L<http://www.veripool.org/>.
-Copyright 2008-2014 by Wilson Snyder. This package is free software; you
+Copyright 2008-2015 by Wilson Snyder. This package 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.
diff --git a/src/config_build.h b/src/config_build.h
index 3e3b8c9..12cbf61 100644
--- a/src/config_build.h
+++ b/src/config_build.h
@@ -11,7 +11,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -27,7 +27,7 @@
//**** Version and host name
// Autoconf substitutes this with the strings from AC_INIT.
-#define PACKAGE_STRING "Verilator 3.868 2014-12-20"
+#define PACKAGE_STRING "Verilator 3.870 2015-02-12"
#define DTVERSION PACKAGE_STRING
diff --git a/src/config_build.h.in b/src/config_build.h.in
index 144932c..9c407d9 100644
--- a/src/config_build.h.in
+++ b/src/config_build.h.in
@@ -10,7 +10,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/src/config_rev.h b/src/config_rev.h
index af201f2..4309ea8 100644
--- a/src/config_rev.h
+++ b/src/config_rev.h
@@ -1 +1 @@
-static const char* DTVERSION_rev = "verilator_3_866-36-g1a3378e";
+static const char* DTVERSION_rev = "verilator_3_868-19-g052a7e3";
diff --git a/src/config_rev.pl b/src/config_rev.pl
index 34a0c84..c9d0f73 100755
--- a/src/config_rev.pl
+++ b/src/config_rev.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
######################################################################
#
-# Copyright 2005-2014 by Wilson Snyder. Verilator is free software; you
+# Copyright 2005-2015 by Wilson Snyder. Verilator 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.
diff --git a/src/cppcheck_filtered b/src/cppcheck_filtered
index 0a669da..6e1c6e2 100755
--- a/src/cppcheck_filtered
+++ b/src/cppcheck_filtered
@@ -47,6 +47,7 @@ sub process {
my %uniq;
my %errs;
while (defined(my $line = $fh->getline())) {
+ $line =~ s/^\s+//;
$line =~ s/Checking usage of global functions\.+//; # Sometimes tacked at end-of-line
# General gunk
next if $uniq{$line}++;
@@ -62,6 +63,8 @@ sub process {
# Specific suppressions
next if $line =~ m!id="missingInclude" .*systemc.h!;
next if $line =~ m!id="missingInclude" .*svdpi.h!;
+ next if $line =~ m!id="unusedFunction" .*sv! && $line =~ m!verilated_dpi.cpp!;
+ next if $line =~ m!id="unusedPrivateFunction" .*::debug!; # Doesn't know UINFO will use it
next if $line =~ m!file=".*obj_dbg/V3ParseBison.c".* id="unreachableCode"!;
# Output
if ($line =~ /^cppcheck --/) {
@@ -82,7 +85,8 @@ sub process {
if (scalar(keys %errs)) {
#my $all = join('',sort(keys %errs));
#$Self->error("Cppcheck errors:\n$all");
- die "%Error: cppcheck_filtered found errors";
+ #die "%Error: cppcheck_filtered found errors\n";
+ exit(1);
}
}
@@ -93,6 +97,9 @@ sub _suppress {
my $linenum = shift;
my $id = shift;
#print "-Suppression search $filename $linenum $id\n" if $Self->{verbose};
+
+ return undef if $filename eq "*";
+
my $fh = IO::File->new("<$filename");
if (!$fh) {
warn "%Warning: $! $filename,";
@@ -111,6 +118,13 @@ sub _suppress {
}
}
}
+ if ($l == $linenum) {
+ if ($id eq "uselessAssignmentPtrArg"
+ && $line =~ /(delete|Delete|Edit).*p *= *NULL;/) {
+ # delete(nodep); nodep=NULL; # This is ok, it's how we prevent later using nodep
+ return 1;
+ }
+ }
}
return undef;
}
@@ -158,7 +172,7 @@ This is part of the L<http://www.veripool.org/> free Verilog EDA software
tool suite. The latest version is available from CPAN and from
L<http://www.veripool.org/>.
-Copyright 2014-2014 by Wilson Snyder. This package is free software; you
+Copyright 2014-2015 by Wilson Snyder. This package 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.
diff --git a/src/flexfix b/src/flexfix
index d3b8cf8..72e6aca 100755
--- a/src/flexfix
+++ b/src/flexfix
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
######################################################################
#
-# Copyright 2002-2014 by Wilson Snyder. Verilator is free software; you
+# Copyright 2002-2015 by Wilson Snyder. Verilator 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.
diff --git a/src/pod2latexfix b/src/pod2latexfix
index a10a4db..9de7364 100755
--- a/src/pod2latexfix
+++ b/src/pod2latexfix
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
######################################################################
#
-# Copyright 2002-2014 by Wilson Snyder. Verilator is free software; you
+# Copyright 2002-2015 by Wilson Snyder. Verilator 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.
diff --git a/src/verilog.l b/src/verilog.l
index d73342c..9cab9fe 100644
--- a/src/verilog.l
+++ b/src/verilog.l
@@ -6,7 +6,7 @@
*
**************************************************************************
*
- * Copyright 2003-2014 by Wilson Snyder. Verilator is free software;
+ * Copyright 2003-2015 by Wilson Snyder. Verilator 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.
diff --git a/src/verilog.y b/src/verilog.y
index d77a53d..d0b5355 100644
--- a/src/verilog.y
+++ b/src/verilog.y
@@ -6,7 +6,7 @@
//
//*************************************************************************
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
@@ -1237,6 +1237,9 @@ port_declaration<nodep>: // ==IEEE: port_declaration
list_of_variable_decl_assignments { $$ = $5; }
| port_directionReset port_declNetE /*implicit*/ { VARDTYPE(NULL);/*default_nettype*/}
list_of_variable_decl_assignments { $$ = $4; }
+ // // IEEE: interface_declaration
+ // // Looks just like variable declaration unless has a period
+ // // See etcInst
;
tf_port_declaration<nodep>: // ==IEEE: tf_port_declaration
@@ -2011,9 +2014,24 @@ etcInst<nodep>: // IEEE: module_instantiation + gate_instantiation + udp_insta
instDecl<nodep>:
id parameter_value_assignmentE {INSTPREP(*$1,$2);} instnameList ';'
{ $$ = $4; GRAMMARP->m_impliedDecl=false;}
+ // // IEEE: interface_identifier' .' modport_identifier list_of_interface_identifiers
+ | id/*interface*/ '.' id/*modport*/
+ { VARRESET_NONLIST(AstVarType::IFACEREF);
+ VARDTYPE(new AstIfaceRefDType($<fl>1,"",*$1,*$3)); }
+ mpInstnameList ';'
+ { $$ = VARDONEP($5,NULL,NULL); }
//UNSUP: strengthSpecE for udp_instantiations
;
+mpInstnameList<nodep>: // Similar to instnameList, but for modport instantiations which have no parenthesis
+ mpInstnameParen { $$ = $1; }
+ | mpInstnameList ',' mpInstnameParen { $$ = $1->addNext($3); }
+ ;
+
+mpInstnameParen<nodep>: // Similar to instnameParen, but for modport instantiations which have no parenthesis
+ id instRangeE sigAttrListE { $$ = VARDONEA($<fl>1,*$1,$2,$3); }
+ ;
+
instnameList<nodep>:
instnameParen { $$ = $1; }
| instnameList ',' instnameParen { $$ = $1->addNext($3); }
@@ -2977,8 +2995,7 @@ expr<nodep>: // IEEE: part of expression/constant_expression/primary
| yUNSIGNED yP_TICK '(' expr ')' { $$ = new AstUnsigned($1,$4); }
// // Spec only allows primary with addition of a type reference
// // We'll be more general, and later assert LHS was a type.
- //UNSUP ~l~expr yP_TICK '(' expr ')' { UNSUP }
- | yaINTNUM yP_TICK '(' expr ')' { $$ = new AstCastSize($2,$4,new AstConst($1->fileline(),*$1)); }
+ | ~l~expr yP_TICK '(' expr ')' { $$ = new AstCastParse($2,$4,$1); }
//
// // IEEE: assignment_pattern_expression
// // IEEE: streaming_concatenation
diff --git a/src/vlcovgen b/src/vlcovgen
index 533505f..b6bfe05 100755
--- a/src/vlcovgen
+++ b/src/vlcovgen
@@ -150,7 +150,7 @@ Displays this message and program version and exits.
=head1 DISTRIBUTION
-Copyright 2002-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2002-2015 by Wilson Snyder. Verilator 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.
diff --git a/test_c/Makefile b/test_c/Makefile
index 65cfc0f..0461a9b 100644
--- a/test_c/Makefile
+++ b/test_c/Makefile
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_c/Makefile_obj b/test_c/Makefile_obj
index 1d544ef..5fdc596 100644
--- a/test_c/Makefile_obj
+++ b/test_c/Makefile_obj
@@ -5,7 +5,7 @@
#
# This is executed in the object directory, and called by ../Makefile
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_c/sim_main.cpp b/test_c/sim_main.cpp
index 263c97a..11200c3 100644
--- a/test_c/sim_main.cpp
+++ b/test_c/sim_main.cpp
@@ -1,6 +1,6 @@
// DESCRIPTION: Verilator Example: Top level main for invoking model
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/test_regress/Makefile b/test_regress/Makefile
index 6d87ca4..a339fbc 100644
--- a/test_regress/Makefile
+++ b/test_regress/Makefile
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_regress/Makefile_obj b/test_regress/Makefile_obj
index 2b68424..5b13e9c 100644
--- a/test_regress/Makefile_obj
+++ b/test_regress/Makefile_obj
@@ -5,7 +5,7 @@
#
# This is executed in the object directory, and called by ../Makefile
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_regress/driver.pl b/test_regress/driver.pl
index d13e33b..92f5dce 100755
--- a/test_regress/driver.pl
+++ b/test_regress/driver.pl
@@ -52,6 +52,7 @@ my $opt_gdbsim;
my $opt_ghdl;
my $opt_iv;
my $opt_jobs = 1;
+my $opt_ms;
my $opt_nc;
my $opt_optimize;
my $opt_site;
@@ -79,6 +80,7 @@ if (! GetOptions (
"help" => \&usage,
"iverilog!" => \$opt_iv,
"j=i" => \$opt_jobs,
+ "ms!" => \$opt_ms,
"nc!" => \$opt_nc,
"optimize:s" => \$opt_optimize,
"site!" => \$opt_site,
@@ -102,7 +104,7 @@ $opt_jobs = calc_jobs() if defined $opt_jobs && $opt_jobs==0;
$Fork->max_proc($opt_jobs);
-if (!$opt_atsim && !$opt_ghdl && !$opt_iv && !$opt_vcs && !$opt_nc && !$opt_vlt) {
+if (!$opt_atsim && !$opt_ghdl && !$opt_iv && !$opt_vcs && !$opt_ms && !$opt_nc && !$opt_vlt) {
$opt_vlt = 1;
}
@@ -135,6 +137,7 @@ foreach my $testpl (@opt_tests) {
one_test(pl_filename => $testpl, atsim=>1) if $opt_atsim;
one_test(pl_filename => $testpl, ghdl=>1) if $opt_ghdl;
one_test(pl_filename => $testpl, iv=>1) if $opt_iv;
+ one_test(pl_filename => $testpl, ms=>1) if $opt_ms;
one_test(pl_filename => $testpl, nc=>1) if $opt_nc;
one_test(pl_filename => $testpl, vcs=>1) if $opt_vcs;
one_test(pl_filename => $testpl, vlt=>1, 'v3'=>1) if $opt_vlt;
@@ -301,6 +304,7 @@ sub new {
$self->{mode} ||= "vcs" if $self->{vcs};
$self->{mode} ||= "vlt" if $self->{vlt};
$self->{mode} ||= "nc" if $self->{nc};
+ $self->{mode} ||= "ms" if $self->{ms};
$self->{mode} ||= "iv" if $self->{iv};
# For backward compatibility, the verilator tests have no prefix
@@ -376,6 +380,11 @@ sub new {
.($opt_trace ? " +access+r":"")))],
nc_flags2 => [], # Overridden in some sim files
nc_run_flags => [split(/\s+/,"+licqueue -q +assert +sv -R")],
+ # ModelSim
+ ms => 0,
+ ms_flags => [split(/\s+/,("-sv -work $self->{obj_dir}/work"))],
+ ms_flags2 => [], # Overridden in some sim files
+ ms_run_flags => [split(/\s+/,"-lib $self->{obj_dir}/work -c -do 'run -all;quit' ")],
# Verilator
vlt => 0,
'v3' => 0,
@@ -616,6 +625,21 @@ sub compile {
@more_args
]);
}
+ elsif ($param{ms}) {
+ $self->_make_top();
+ $self->_run(logfile=>"$self->{obj_dir}/ms_compile.log",
+ fails=>$param{fails},
+ cmd=>[("vlib $self->{obj_dir}/work && "),
+ ($ENV{VERILATOR_MODELSIM}||"vlog"),
+ @{$param{ms_flags}},
+ @{$param{ms_flags2}},
+ @{$param{v_flags}},
+ @{$param{v_flags2}},
+ $param{top_filename},
+ $param{top_shell_filename},
+ @{$param{v_other_filenames}}
+ ]);
+ }
elsif ($param{iv}) {
$self->_make_top();
my @cmd = (($ENV{VERILATOR_IVERILOG}||"iverilog"),
@@ -732,6 +756,18 @@ sub execute {
expect=>$param{iv_run_expect}, # non-verilator expect isn't the same
);
}
+ elsif ($param{ms}) {
+ $self->_run(logfile=>"$self->{obj_dir}/ms_sim.log",
+ fails=>$param{fails},
+ cmd=>["echo q | ".$run_env.($ENV{VERILATOR_MODELSIM}||"vsim"),
+ @{$param{ms_run_flags}},
+ @{$param{all_run_flags}},
+ (" top")
+ ],
+ %param,
+ expect=>$param{ms_run_expect}, # non-verilator expect isn't the same
+ );
+ }
elsif ($param{nc}) {
$self->_run(logfile=>"$self->{obj_dir}/nc_sim.log",
fails=>$param{fails},
@@ -1661,6 +1697,15 @@ Set to 0 to disable the automatic creation of a top level shell to run the
executable (for example when a hand-written test wrapper is provided using
C<--exe>).
+=item ms_flags
+
+=item ms_flags2
+
+=item ms_run_flags
+
+The equivalent of C<v_flags>, C<v_flags2> and C<all_run_flags>, but only
+for use with the ModelSim simulator.
+
=item nc_flags
=item nc_flags2
@@ -1691,7 +1736,8 @@ A list of standard Verilog simulator flags to be passed to the simulator
compiler (Verilator or one of the other simulators). Unlike v_flags, these
options may be overridden in some simulation files.
-Similar sets of flags exist for atsim, GHDL, Cadence NC and Synopsys VCS.
+Similar sets of flags exist for atsim, GHDL, Cadence NC, Modelsim and
+Synopsys VCS.
=item vcs_flags
@@ -1842,6 +1888,10 @@ Run using Icarus Verilog simulator.
Run number of parallel tests, or 0 to determine the count based on the
number of cores installed. Requires Perl's Parallel::Forker package.
+=item --ms
+
+Run using ModelSim simulator.
+
=item --nc
Run using Cadence NC-Verilog simulator.
@@ -1902,6 +1952,10 @@ Command to use to invoke GHDL.
Command to use to invoke Icarus Verilog.
+=item VERILATOR_MODELSIM
+
+Command to use to invoke ModelSim.
+
=item VERILATOR_NCVERILOG
Command to use to invoke ncverilog.
@@ -1920,7 +1974,7 @@ Command to use to invoke VCS.
The latest version is available from L<http://www.veripool.org/>.
-Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2003-2015 by Wilson Snyder. Verilator 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.
diff --git a/test_regress/t/t_EXAMPLE.v b/test_regress/t/t_EXAMPLE.v
index 2075946..8d4970e 100644
--- a/test_regress/t/t_EXAMPLE.v
+++ b/test_regress/t/t_EXAMPLE.v
@@ -13,7 +13,7 @@
// please note it here, otherwise:**
//
// This file ONLY is placed into the Public Domain, for any use,
-// without warranty, 2014 by ____YOUR_NAME_HERE____.
+// without warranty, 2015 by ____YOUR_NAME_HERE____.
module t (/*AUTOARG*/
// Inputs
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_assign_inline.pl
similarity index 63%
copy from test_regress/t/t_order_wireloop.pl
copy to test_regress/t/t_assign_inline.pl
index 285a330..a433bb0 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_assign_inline.pl
@@ -2,17 +2,18 @@
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
-# Copyright 2005 by Wilson Snyder. This program is free software; you can
+# 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.
compile (
- fails=>$Self->{v3},
- expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
-',
- );
+ verilator_flags2 => ["-O0 -OG"],
+ );
+
+execute (
+ check_finished=>1,
+ );
ok(1);
1;
diff --git a/test_regress/t/t_assign_inline.v b/test_regress/t/t_assign_inline.v
new file mode 100644
index 0000000..cc1f25c
--- /dev/null
+++ b/test_regress/t/t_assign_inline.v
@@ -0,0 +1,52 @@
+// DESCRIPTION: Verilator: Verilog Test module
+//
+// This file ONLY is placed into the Public Domain, for any use,
+// without warranty, 2015 by Mike Thyer.
+
+module t (/*AUTOARG*/
+ // Inputs
+ clk
+ );
+ input clk;
+
+ int cycle=0;
+
+ // verilator lint_off UNOPTFLAT
+ reg [7:0] a_r;
+ wire [7:0] a_w;
+ reg [7:0] b_r;
+ reg [7:0] c_d_r, c_q_r;
+
+ assign a_w = a_r;
+
+ always @(*) begin
+ a_r = 0;
+ b_r = a_w; // Substituting the a_w assignment to get b_r = 0 is wrong, as a_r is not "complete"
+ a_r = c_q_r;
+ c_d_r = c_q_r;
+ end
+
+ // stimulus + checks
+ always @(posedge clk) begin
+ cycle <= cycle+1;
+ if (cycle==0) begin
+ c_q_r <= 8'b0;
+ end
+ else begin
+ c_q_r <= c_d_r+1;
+`ifdef TEST_VERBOSE
+ $display("[%0t] a_r=%0d, b_r=%0d", $time, a_r, b_r); // a_r and b_r should always be the same
+`endif
+ end
+ if (cycle >= 10) begin
+ if (b_r==9) begin
+ $write("*-* All Finished *-*\n");
+ $finish;
+ end
+ else begin
+ $stop;
+ end
+ end
+ end
+
+endmodule
diff --git a/test_regress/t/t_bitsel_struct3.v b/test_regress/t/t_bitsel_struct3.v
index 1c10278..444b29d 100644
--- a/test_regress/t/t_bitsel_struct3.v
+++ b/test_regress/t/t_bitsel_struct3.v
@@ -8,6 +8,8 @@
// This file ONLY is placed into the Public Domain, for any use, without
// warranty, 2013 by Jie Xu.
+`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); $stop; end while(0);
+
module t(/*AUTOARG*/
// Inputs
clk
@@ -25,18 +27,32 @@ module t(/*AUTOARG*/
reg [7:0] c;
reg [7:0] d;
+ union packed {
+ logic [31:0] [7:0] idx;
+ struct packed {
+ logic [15:0] z, y, x;
+ logic [25:0] [7:0] r;
+ } nam;
+ } gpr;
+
+ reg [14:0] gpr_a;
+
initial begin
b = {16'h8765,16'h4321};
a = b[19:12]; // This works
c = b[8+:8]; // This fails
d = b[11-:8]; // This fails
- if ((a == 8'h54) && (c == 8'h43) && (d == 8'h32)) begin
- $write("*-* All Finished *-*\n");
- $finish;
- end
- else begin
- $stop;
- end
+ `checkh(a, 8'h54);
+ `checkh(c, 8'h43);
+ `checkh(d, 8'h32);
+
+ gpr = 256'h12346789_abcdef12_3456789a_bcdef123_456789ab_cdef1234_56789abc_def12345;
+ `checkh (gpr[255:255-14], 15'h091a);
+ gpr_a = gpr.nam.z[15:1];
+ `checkh (gpr_a, 15'h091a);
+
+ $write("*-* All Finished *-*\n");
+ $finish;
end
endmodule
diff --git a/test_regress/t/t_cast.v b/test_regress/t/t_cast.v
index cda5ed1..5f23ff4 100644
--- a/test_regress/t/t_cast.v
+++ b/test_regress/t/t_cast.v
@@ -11,6 +11,7 @@ module t;
mc_t o;
logic [15:0] allones = 16'hffff;
+ parameter FOUR = 4;
initial begin
if (4'shf > 4'sh0) $stop;
@@ -18,6 +19,11 @@ module t;
if (4'hf < 4'h0) $stop;
if (unsigned'(4'shf) < 4'h0) $stop;
if (4'(allones) !== 4'hf) $stop;
+ if (6'(allones) !== 6'h3f) $stop;
+ if ((4)'(allones) !== 4'hf) $stop;
+ if ((4+2)'(allones) !== 6'h3f) $stop;
+ if ((4-2)'(allones) !== 2'h3) $stop;
+ if ((FOUR+2)'(allones) !== 6'h3f) $stop;
o = tocast_t'(4'b1);
if (o != 4'b1) $stop;
diff --git a/test_regress/t/t_func.v b/test_regress/t/t_func.v
index af381d1..05bd300 100644
--- a/test_regress/t/t_func.v
+++ b/test_regress/t/t_func.v
@@ -41,7 +41,9 @@ module t;
if (vec[0] != 32'h333) $stop;
if (vec[1] != 32'hdef) $stop;
+ // verilator lint_off SELRANGE
incr(vec[2],vec[0],vec[2]); // Reading/Writing past end of vector!
+ // verilator lint_on SELRANGE
n=1;
nil();
diff --git a/test_regress/t/t_inst_misarray_bad.pl b/test_regress/t/t_inst_misarray_bad.pl
index 278edcd..7abc7af 100755
--- a/test_regress/t/t_inst_misarray_bad.pl
+++ b/test_regress/t/t_inst_misarray_bad.pl
@@ -11,7 +11,7 @@ compile (
verilator_flags2 => ["--lint-only"],
fails=>1,
expect=>
-q{%Error: t/t_inst_misarray_bad.v:\d+: Illegal input port connection 'foo', mismatch between port which is not an array, and expression which is an array.
+q{%Error: t/t_inst_misarray_bad.v:\d+: Illegal assignment of constant to unpacked array
%Error: Exiting due to.*},
);
diff --git a/test_regress/t/t_interface1_modport.v b/test_regress/t/t_interface1_modport.v
index 2d41333..bf69233 100644
--- a/test_regress/t/t_interface1_modport.v
+++ b/test_regress/t/t_interface1_modport.v
@@ -37,10 +37,18 @@ module t (/*AUTOARG*/
endmodule
module sub
+`ifdef NANSI // bug868
+ (
+ isub, i_value
+ );
+ ifc.out_modport isub; // Note parenthesis are not legal here
+ input integer i_value;
+`else
(
ifc.out_modport isub,
input integer i_value
);
+`endif
always @* begin
isub.value = i_value;
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_interface1_modport_nansi.pl
similarity index 61%
copy from test_regress/t/t_order_wireloop.pl
copy to test_regress/t/t_interface1_modport_nansi.pl
index 285a330..13c82af 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_interface1_modport_nansi.pl
@@ -2,17 +2,20 @@
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
-# Copyright 2005 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2009 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.
+top_filename("t/t_interface1_modport.v");
+
compile (
- fails=>$Self->{v3},
- expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
-',
- );
+ v_flags2 => ['+define+NANSI'],
+ );
+
+execute (
+ check_finished=>1,
+ );
ok(1);
1;
diff --git a/test_regress/t/t_lint_latch_bad.pl b/test_regress/t/t_lint_latch_bad.pl
new file mode 100755
index 0000000..7de1109
--- /dev/null
+++ b/test_regress/t/t_lint_latch_bad.pl
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
+# DESCRIPTION: Verilator: Verilog Test driver/expect definition
+#
+# Copyright 2008 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.
+
+$Self->{vlt} or $Self->skip("Verilator only test");
+
+compile (
+ v_flags2 => ["--lint-only -Wwarn-style -Wno-DECLFILENAME"],
+ fails=>1,
+ verilator_make_gcc => 0,
+ make_top_shell => 0,
+ make_main => 0,
+ expect=>
+quotemeta(
+'%Warning-COMBDLY: t/t_lint_latch_bad.v:24: Delayed assignments (<=) in non-clocked (non flop or latch) block; suggest blocking assignments (=).
+%Warning-COMBDLY: Use "/* verilator lint_off COMBDLY */" and lint_on around source to disable this message.
+%Warning-COMBDLY: *** See the manual before disabling this,
+%Warning-COMBDLY: else you may end up with different sim results.
+%Error: Exiting due to 1 warning').'.*',
+ );
+
+ok(1);
+1;
+
diff --git a/test_regress/t/t_lint_latch_bad.v b/test_regress/t/t_lint_latch_bad.v
new file mode 100644
index 0000000..8112943
--- /dev/null
+++ b/test_regress/t/t_lint_latch_bad.v
@@ -0,0 +1,29 @@
+// DESCRIPTION: Verilator: Verilog Test module
+//
+// This file ONLY is placed into the Public Domain, for any use,
+// without warranty, 2010 by Wilson Snyder.
+
+module t (/*AUTOARG*/
+ // Outputs
+ bl, cl, bc, cc,
+ // Inputs
+ a
+ );
+
+ input logic a;
+ output logic bl;
+ output logic cl;
+ always_latch begin
+ bl <= a; // No warning
+ cl = a;
+ end
+
+ output logic bc;
+ output logic cc;
+ always_comb begin
+ bc <= a; // Warning
+ cc = a;
+ end
+
+
+endmodule
diff --git a/test_regress/t/t_math_const.v b/test_regress/t/t_math_const.v
index 217bb8c..abd6478 100644
--- a/test_regress/t/t_math_const.v
+++ b/test_regress/t/t_math_const.v
@@ -108,19 +108,19 @@ module t (/*AUTOARG*/
w32 = 12; w32 <<= 1; if (w32 != 24) $stop;
// Increments
- v32[2] = 12; v32[2]++; if (v32[2] != 13) $stop;
- v32[2] = 12; ++v32[2]; if (v32[2] != 13) $stop;
- v32[2] = 12; v32[2]--; if (v32[2] != 11) $stop;
- v32[2] = 12; --v32[2]; if (v32[2] != 11) $stop;
- v32[2] = 12; v32[2] += 2; if (v32[2] != 14) $stop;
- v32[2] = 12; v32[2] -= 2; if (v32[2] != 10) $stop;
- v32[2] = 12; v32[2] *= 2; if (v32[2] != 24) $stop;
- v32[2] = 12; v32[2] /= 2; if (v32[2] != 6) $stop;
- v32[2] = 12; v32[2] &= 6; if (v32[2] != 4) $stop;
- v32[2] = 12; v32[2] |= 15; if (v32[2] != 15) $stop;
- v32[2] = 12; v32[2] ^= 15; if (v32[2] != 3) $stop;
- v32[2] = 12; v32[2] >>= 1; if (v32[2] != 6) $stop;
- v32[2] = 12; v32[2] <<= 1; if (v32[2] != 24) $stop;
+ v32[1] = 12; v32[1]++; if (v32[1] != 13) $stop;
+ v32[1] = 12; ++v32[1]; if (v32[1] != 13) $stop;
+ v32[1] = 12; v32[1]--; if (v32[1] != 11) $stop;
+ v32[1] = 12; --v32[1]; if (v32[1] != 11) $stop;
+ v32[1] = 12; v32[1] += 2; if (v32[1] != 14) $stop;
+ v32[1] = 12; v32[1] -= 2; if (v32[1] != 10) $stop;
+ v32[1] = 12; v32[1] *= 2; if (v32[1] != 24) $stop;
+ v32[1] = 12; v32[1] /= 2; if (v32[1] != 6) $stop;
+ v32[1] = 12; v32[1] &= 6; if (v32[1] != 4) $stop;
+ v32[1] = 12; v32[1] |= 15; if (v32[1] != 15) $stop;
+ v32[1] = 12; v32[1] ^= 15; if (v32[1] != 3) $stop;
+ v32[1] = 12; v32[1] >>= 1; if (v32[1] != 6) $stop;
+ v32[1] = 12; v32[1] <<= 1; if (v32[1] != 24) $stop;
end
if (cyc==2) begin
win <= 32'h123123;
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_math_signed6.pl
similarity index 63%
copy from test_regress/t/t_order_wireloop.pl
copy to test_regress/t/t_math_signed6.pl
index 285a330..f912897 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_math_signed6.pl
@@ -2,17 +2,17 @@
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
-# Copyright 2005 by Wilson Snyder. This program is free software; you can
+# 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.
compile (
- fails=>$Self->{v3},
- expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
-',
- );
+ );
+
+execute (
+ check_finished=>1,
+ );
ok(1);
1;
diff --git a/test_regress/t/t_math_signed6.v b/test_regress/t/t_math_signed6.v
new file mode 100644
index 0000000..6652225
--- /dev/null
+++ b/test_regress/t/t_math_signed6.v
@@ -0,0 +1,36 @@
+// DESCRIPTION: Verilator: Verilog Test module
+//
+// This file ONLY is placed into the Public Domain, for any use,
+// without warranty, 2015 by Iztok Jeras.
+
+`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); $stop; end while(0)
+
+ module t (/*AUTOARG*/);
+
+ // signed source
+ logic signed [8-1:0] src;
+
+ // destination structure
+ struct packed {
+ logic signed [16-1:0] s;
+ logic unsigned [16-1:0] u;
+ } dst;
+
+ initial begin
+ // bug882
+ // verilator lint_off WIDTH
+ src = 8'sh05;
+ dst = '{s: src, u: src};
+ `checkh (dst.s, 16'h0005);
+ `checkh (dst.u, 16'h0005);
+
+ src = 8'shf5;
+ dst = '{s: src, u: src};
+ `checkh (dst.s, 16'hfff5);
+ `checkh (dst.u, 16'hfff5);
+ // verilator lint_on WIDTH
+
+ $write("*-* All Finished *-*\n");
+ $finish;
+ end
+endmodule
diff --git a/test_regress/t/t_mem_first.v b/test_regress/t/t_mem_first.v
index 7c4ec34..f994375 100644
--- a/test_regress/t/t_mem_first.v
+++ b/test_regress/t/t_mem_first.v
@@ -74,11 +74,12 @@ module t (/*AUTOARG*/
// verilator lint_on width
if (np2_guard[6]!=0 || np2_guard[7]!=0) $stop;
end
- // lint_checking BNDMEM OFF
+ // verilator lint_off SELRANGE
if (np2_mem[6] !== np2_mem[7]) begin
$write("Mem[6]!=Mem[7] during randomize...\n");
//$stop; // Random value, so this can happen
end
+ // verilator lint_on SELRANGE
//if (np2_mem[8] !== np2_mem[9]) $stop; // Enhancement: Illegal indexes, make sure map to X's
//
vec_wide[32:31] <= 2'b11;
diff --git a/test_regress/t/t_mem_slice.v b/test_regress/t/t_mem_slice.v
index 511d388..8181517 100644
--- a/test_regress/t/t_mem_slice.v
+++ b/test_regress/t/t_mem_slice.v
@@ -98,9 +98,6 @@ module t (/*AUTOARG*/
if (active_command2[3] != 2'b11) begin
$stop;
end
- if (active_command3[3][1][2] != 2'b11) begin
- $stop;
- end
end
end
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_order_2d.pl
similarity index 63%
copy from test_regress/t/t_order_wireloop.pl
copy to test_regress/t/t_order_2d.pl
index 285a330..f912897 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_order_2d.pl
@@ -2,17 +2,17 @@
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
-# Copyright 2005 by Wilson Snyder. This program is free software; you can
+# 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.
compile (
- fails=>$Self->{v3},
- expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
-',
- );
+ );
+
+execute (
+ check_finished=>1,
+ );
ok(1);
1;
diff --git a/test_regress/t/t_EXAMPLE.v b/test_regress/t/t_order_2d.v
similarity index 54%
copy from test_regress/t/t_EXAMPLE.v
copy to test_regress/t/t_order_2d.v
index 2075946..35f0c35 100644
--- a/test_regress/t/t_EXAMPLE.v
+++ b/test_regress/t/t_order_2d.v
@@ -1,19 +1,7 @@
// DESCRIPTION: Verilator: Verilog Test module
//
-// Use this file as a template for submitting bugs, etc.
-// This module takes a single clock input, and should either
-// $write("*-* All Finished *-*\n");
-// $finish;
-// on success, or $stop.
-//
-// The code as shown applies a random vector to the Test
-// module, then calculates a CRC on the Test module's outputs.
-//
-// **If you do not wish for your code to be released to the public
-// please note it here, otherwise:**
-//
// This file ONLY is placed into the Public Domain, for any use,
-// without warranty, 2014 by ____YOUR_NAME_HERE____.
+// without warranty, 2015 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
@@ -26,22 +14,21 @@ module t (/*AUTOARG*/
reg [63:0] sum;
// Take CRC data and apply to testblock inputs
- wire [31:0] in = crc[31:0];
+ wire input_signal = crc[0];
/*AUTOWIRE*/
// Beginning of automatic wires (for undeclared instantiated-module outputs)
- wire [31:0] out; // From test of Test.v
+ wire output_signal; // From test of Test.v
// End of automatics
Test test (/*AUTOINST*/
// Outputs
- .out (out[31:0]),
+ .output_signal (output_signal),
// Inputs
- .clk (clk),
- .in (in[31:0]));
+ .input_signal (input_signal));
// Aggregate outputs into a single result vector
- wire [63:0] result = {32'h0, out};
+ wire [63:0] result = {63'h0, output_signal};
// Test loop
always @ (posedge clk) begin
@@ -65,7 +52,7 @@ module t (/*AUTOARG*/
$write("[%0t] cyc==%0d crc=%x sum=%x\n",$time, cyc, crc, sum);
if (crc !== 64'hc77bb9b3784ea091) $stop;
// What checksum will we end up with (above print should match)
-`define EXPECTED_SUM 64'h4afe43fb79d7b71e
+`define EXPECTED_SUM 64'h765b2e12b25ec97b
if (sum !== `EXPECTED_SUM) $stop;
$write("*-* All Finished *-*\n");
$finish;
@@ -74,23 +61,19 @@ module t (/*AUTOARG*/
endmodule
-module Test (/*AUTOARG*/
- // Outputs
- out,
- // Inputs
- clk, in
- );
+module Test (
+ input input_signal,
+ output output_signal
+ );
- // Replace this module with the device under test.
- //
- // Change the code in the t module to apply values to the inputs and
- // merge the output values into the result vector.
+ // bug872
- input clk;
- input [31:0] in;
- output reg [31:0] out;
+ // verilator lint_off UNOPTFLAT
+ wire some_signal[1:0][1:0];
+ assign some_signal[0][0] = input_signal;
+ assign some_signal[0][1] = some_signal[0][0];
+ assign some_signal[1][0] = some_signal[0][1];
+ assign some_signal[1][1] = some_signal[1][0];
+ assign output_signal = some_signal[1][1];
- always @(posedge clk) begin
- out <= in;
- end
endmodule
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_order_wireloop.pl
index 285a330..7a3675a 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_order_wireloop.pl
@@ -8,9 +8,11 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
compile (
- fails=>$Self->{v3},
+ fails=>$Self->{v3},
+ # Used to be %Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
+ # However we no longer gate optimize this
expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
+'%Warning-UNOPT: t/t_order_wireloop.v:\d+: Signal unoptimizable: Feedback to public clock or circular logic: bar
',
);
diff --git a/test_regress/t/t_order_wireloop.v b/test_regress/t/t_order_wireloop.v
index 1f4363c..b1156cf 100644
--- a/test_regress/t/t_order_wireloop.v
+++ b/test_regress/t/t_order_wireloop.v
@@ -3,10 +3,13 @@
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2005 by Wilson Snyder.
-module t (/*AUTOARG*/);
+module t (/*AUTOARG*/
+ // Outputs
+ bar
+ );
wire foo;
- wire bar;
+ output bar;
// Oh dear.
assign foo = bar;
diff --git a/test_regress/t/t_param_array.v b/test_regress/t/t_param_array.v
index 2ae1d34..7084c65 100644
--- a/test_regress/t/t_param_array.v
+++ b/test_regress/t/t_param_array.v
@@ -68,7 +68,7 @@ module t (/*AUTOARG*/);
$display("PINID8 %s", STR_PINID[8]);
if (STR_PINID[1] != "ERR") $stop;
if (STR_PINID[8] != "PA0") $stop;
- if (pinout_static_const[0][0] != 0) $stop;
+ if (pinout_static_const[1][0] != 0) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
diff --git a/test_regress/t/t_inst_misarray_bad.pl b/test_regress/t/t_select_bad_range3.pl
similarity index 65%
copy from test_regress/t/t_inst_misarray_bad.pl
copy to test_regress/t/t_select_bad_range3.pl
index 278edcd..c7f200d 100755
--- a/test_regress/t/t_inst_misarray_bad.pl
+++ b/test_regress/t/t_select_bad_range3.pl
@@ -8,13 +8,14 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
compile (
- verilator_flags2 => ["--lint-only"],
- fails=>1,
+ v_flags2 => ["--lint-only"],
+ fails=>$Self->{v3},
expect=>
-q{%Error: t/t_inst_misarray_bad.v:\d+: Illegal input port connection 'foo', mismatch between port which is not an array, and expression which is an array.
-%Error: Exiting due to.*},
+'%Warning-SELRANGE: t/t_select_bad_range3.v:\d+: Selection index out of range: 13 outside 12:10
+%Warning-SELRANGE: Use .*
+%Error: Exiting due to.*',
);
-
ok(1);
1;
+
diff --git a/test_regress/t/t_select_bad_range3.v b/test_regress/t/t_select_bad_range3.v
new file mode 100644
index 0000000..ac8dfd4
--- /dev/null
+++ b/test_regress/t/t_select_bad_range3.v
@@ -0,0 +1,19 @@
+// DESCRIPTION: Verilator: Verilog Test module
+//
+// This file ONLY is placed into the Public Domain, for any use,
+// without warranty, 2015 by Wilson Snyder.
+
+module t (/*AUTOARG*/
+ // Outputs
+ outwires,
+ // Inputs
+ inwires
+ );
+ input [7:0] inwires [12:10];
+ output wire [7:0] outwires [12:10];
+
+ assign outwires[10] = inwires[11];
+ assign outwires[11] = inwires[12];
+ assign outwires[12] = inwires[13]; // must be an error here
+
+endmodule
diff --git a/test_regress/t/t_order_wireloop.pl b/test_regress/t/t_slice_struct_array_modport.pl
similarity index 63%
copy from test_regress/t/t_order_wireloop.pl
copy to test_regress/t/t_slice_struct_array_modport.pl
index 285a330..10dc9a1 100755
--- a/test_regress/t/t_order_wireloop.pl
+++ b/test_regress/t/t_slice_struct_array_modport.pl
@@ -2,17 +2,18 @@
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
-# Copyright 2005 by Wilson Snyder. This program is free software; you can
+# 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.
compile (
- fails=>$Self->{v3},
- expect=>
-'%Error: t/t_order_wireloop.v:\d+: Wire inputs its own output, creating circular logic .wire x=x.
-',
- );
+ v_flags2 => ["--lint-only"],
+ fails=>0,
+ verilator_make_gcc => 0,
+ make_top_shell => 0,
+ make_main => 0,
+ );
ok(1);
1;
diff --git a/test_regress/t/t_slice_struct_array_modport.v b/test_regress/t/t_slice_struct_array_modport.v
new file mode 100644
index 0000000..18c90a8
--- /dev/null
+++ b/test_regress/t/t_slice_struct_array_modport.v
@@ -0,0 +1,17 @@
+// DESCRIPTION: Verilator: Verilog Test module
+//
+// This file ONLY is placed into the Public Domain, for any use,
+// without warranty, 2015 by Varun Koyyalagunta.
+
+typedef struct packed {
+ logic p;
+} s_data;
+
+module m1 (output s_data data[1:0]);
+ assign data[0].p = 0;
+ assign data[1].p = 0;
+endmodule
+
+module top (output s_data data[2:0]);
+ m1 m1_inst (.data(data[1:0]));
+endmodule
diff --git a/test_regress/t/t_sys_file_basic.v b/test_regress/t/t_sys_file_basic.v
index df8fcda..f3631f4 100644
--- a/test_regress/t/t_sys_file_basic.v
+++ b/test_regress/t/t_sys_file_basic.v
@@ -14,6 +14,7 @@ module t;
reg [16*8:1] letterw;
reg [16*8:1] letterz;
real r;
+ string s;
reg [7:0] v_a,v_b,v_c,v_d;
reg [31:0] v_worda;
@@ -131,6 +132,13 @@ module t;
if (r != 0.1) $stop;
if (letterq != 64'hfffffffffffc65a5) $stop;
+ s = "r=0.2 d=-236124";
+ chars = $sscanf(s, "r=%g d=%d", r, letterq);
+ if (`verbose) $write("c=%0d d=%d\n", chars, letterq);
+ if (chars != 2) $stop;
+ if (r != 0.2) $stop;
+ if (letterq != 64'hfffffffffffc65a4) $stop;
+
// $fscanf
if ($fscanf(file,"")!=0) $stop;
diff --git a/test_sc/Makefile b/test_sc/Makefile
index e97196c..27bd384 100644
--- a/test_sc/Makefile
+++ b/test_sc/Makefile
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_sc/Makefile_obj b/test_sc/Makefile_obj
index 492d917..7710bb1 100644
--- a/test_sc/Makefile_obj
+++ b/test_sc/Makefile_obj
@@ -5,7 +5,7 @@
#
# This is executed in the object directory, and called by ../Makefile
#
-# Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+# Copyright 2003-2015 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.
diff --git a/test_sc/sc_main.cpp b/test_sc/sc_main.cpp
index d878152..57c5324 100644
--- a/test_sc/sc_main.cpp
+++ b/test_sc/sc_main.cpp
@@ -1,7 +1,7 @@
// -*- SystemC -*-
// DESCRIPTION: Verilator Example: Top level main for invoking SystemC model
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/test_verilated/sim_main.cpp b/test_verilated/sim_main.cpp
index e2a86a9..50d30c6 100644
--- a/test_verilated/sim_main.cpp
+++ b/test_verilated/sim_main.cpp
@@ -1,6 +1,6 @@
// DESCRIPTION: Verilator Test: Top level main for invoking model
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/test_verilated/sim_main.v b/test_verilated/sim_main.v
index 6871af5..c577615 100644
--- a/test_verilated/sim_main.v
+++ b/test_verilated/sim_main.v
@@ -1,6 +1,6 @@
// DESCRIPTION: Verilator Test: Top level main for invoking model
//
-// Copyright 2003-2014 by Wilson Snyder. This program is free software; you can
+// Copyright 2003-2015 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.
diff --git a/test_verilated/vgen.pl b/test_verilated/vgen.pl
index 421fbaa..278637f 100755
--- a/test_verilated/vgen.pl
+++ b/test_verilated/vgen.pl
@@ -1136,7 +1136,7 @@ Include some signed arithmetic in the generated code. Experimental.
=head1 DISTRIBUTION
-Copyright 2001-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2001-2015 by Wilson Snyder. Verilator 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.
diff --git a/verilator.1 b/verilator.1
index feabb43..a2ea025 100644
--- a/verilator.1
+++ b/verilator.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "VERILATOR 1"
-.TH VERILATOR 1 "2014-12-20" "perl v5.14.2" "User Contributed Perl Documentation"
+.TH VERILATOR 1 "2014-12-23" "perl v5.14.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -3560,7 +3560,7 @@ Thanks to them, and all those we've missed including above.
.IX Header "DISTRIBUTION"
The latest version is available from <http://www.veripool.org/>.
.PP
-Copyright 2003\-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2003\-2015 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the \s-1GNU\s0 Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
diff --git a/verilator.html b/verilator.html
index 551b3d7..5e486da 100644
--- a/verilator.html
+++ b/verilator.html
@@ -3690,7 +3690,7 @@ Williams, Jeff Winston, Joshua Wise, Johan Wouters, and Ding Xiaoliang.</p>
<hr />
<h1><a name="distribution">DISTRIBUTION</a></h1>
<p>The latest version is available from <a href="http://www.veripool.org/">http://www.veripool.org/</a>.</p>
-<p>Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you can
+<p>Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.</p>
diff --git a/verilator.pdf b/verilator.pdf
index 48b2a4a..8f45e45 100644
Binary files a/verilator.pdf and b/verilator.pdf differ
diff --git a/verilator.txt b/verilator.txt
index 6b3c258..5e5a65c 100644
--- a/verilator.txt
+++ b/verilator.txt
@@ -3351,7 +3351,7 @@ CONTRIBUTORS
DISTRIBUTION
The latest version is available from <http://www.veripool.org/>.
- Copyright 2003-2014 by Wilson Snyder. Verilator is free software; you
+ Copyright 2003-2015 by Wilson Snyder. Verilator is free software; you
can redistribute it and/or modify the Verilator internals under the
terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0.
diff --git a/verilator_coverage.1 b/verilator_coverage.1
index f3ece0f..7532bc0 100644
--- a/verilator_coverage.1
+++ b/verilator_coverage.1
@@ -224,7 +224,7 @@ Specifies a module search directory.
.IX Header "DISTRIBUTION"
The latest version is available from <http://www.veripool.org/>.
.PP
-Copyright 2003\-2014 by Wilson Snyder. Verilator is free software; you can
+Copyright 2003\-2015 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the \s-1GNU\s0 Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/verilator.git
More information about the Pkg-electronics-commits
mailing list