diff --git a/CMakeLists.txt b/CMakeLists.txt
index 537caf740..6c5c282ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
project(Verilator
- VERSION 5.003
+ VERSION 5.008
HOMEPAGE_URL https://verilator.org
LANGUAGES CXX
)
@@ -118,6 +118,7 @@ install(DIRECTORY include TYPE DATA FILES_MATCHING
PATTERN "include/verilated.mk"
PATTERN "include/*.[chv]"
PATTERN "include/*.cpp"
+ PATTERN "include/*.sv"
PATTERN "include/gtkwave/*.[chv]*"
PATTERN "include/vltstd/*.[chv]*"
)
diff --git a/Changes b/Changes
index 57790292d..583a85abc 100644
--- a/Changes
+++ b/Changes
@@ -8,7 +8,66 @@ The changes in each Verilator version are described below. The
contributors that suggested a given feature are shown in []. Thanks!
-Verilator 5.006 2022-01-22
+Verilator 5.008 2023-03-04
+==========================
+
+**Minor:**
+
+* Add --annotate-points option, change multipoint on line reporting (#3876). [Nassim Corteggiani]
+* Add --verilate-jobs option (#3889). [Kamil Rakoczy, Antmicro Ltd]
+* Add WIDTHEXPAND and WIDTHTRUNC warnings to replace WIDTH (#3900). [Andrew Nolte]
+* Add SOURCE_DATE_EPOCH for docs/guide/conf.py (#3918). [Larry Doolittle]
+* Add /*verilator public[flat|flat_rd|flat_rw| ]*/ metacomments (#3894). [Joseph Nwabueze]
+* Add lint warning on always_comb multidriven (#3888) (#3939). [Adam Bagley]
+* Add warning on ++/-- over expressions with potential side effects (#3976). [Krzysztof Boroński]
+* Add error on mixing .name and by-port instantiations.
+* Removed deprecated --cdc option.
+* Support unpacked unions.
+* Support interface classes and class implements.
+* Support global clocking and $global_clock.
+* Support class parameters without initial values.
+* Support cast to numbers from strings.
+* Support struct I/O in --lib-create (#3378) (#3892). [Varun Koyyalagunta]
+* Support function calls without parenthesis (#3903) (#3902). [Ryszard Rozak, Antmicro Ltd]
+* Support class extending its parameter (#3904). [Ryszard Rozak, Antmicro Ltd]
+* Support static function variables (#3830). [Ryszard Rozak, Antmicro Ltd]
+* Support vpiDefName (#3906) (#3931). [Andrew Nolte]
+* Support recursive methods (#3987). [Ryszard Rozak, Antmicro Ltd]
+* Fix real parameters of infinity and NaN.
+* Fix pattern assignment to unpacked structs (#3510). [Mostafa Garnal]
+* Fix single-element replication to dynarray/unpacked/queue (#3548). [Gustav Svensk]
+* Fix constant enum methods (#3621). [Todd Strader]
+* Fix inconsistent naming of generate scope arrays (#3840). [Andrew Nolte]
+* Fix namespace fallback resolution (#3863) (#3942). [Aleksander Kiryk, Antmicro Ltd]
+* Fix std:: to be parsed first (#3864) (#3928). [Aleksander Kiryk, Antmicro Ltd]
+* Fix cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927). [Yoda Lee]
+* Fix paramaterized class function linkage (#3917). [Ryszard Rozak]
+* Fix static members of type aliases of a parametrized class (#3922). [Ryszard Rozak, Antmicro Ltd]
+* Fix class extend parameter dot case (#3926). [Ryszard Rozak, Antmicro Ltd]
+* Fix MsWin missing directory exception, and ::std (#3928) (#3933) (#3935). [Kritik Bhimani]
+* Fix very long VPI signal names (#3929). [Marlon James]
+* Fix VPI upper interface scopes not found (#3937). [David Stanford]
+* Fix virus detection false positive (#3944). [Stuart Morris]
+* Fix constant string function assignment (#3945). [Todd Strader]
+* Fix constant format field widths (#3946). [Todd Strader]
+* Fix class field linking when a super classes is a param (#3949). [Ryszard Rozak, Antmicro Ltd]
+* Fix CMake bad C identifiers (#3948) (#3951). [Zixi Li]
+* Fix build on HP PA architecture (#3954). [John David Anglin]
+* Fix date on the front page of verilator.pdf (#3956) (#3957). [Larry Doolittle]
+* Fix dicts declared with ref type (#3960). [Ryszard Rozak, Antmicro Ltd]
+* Fix missing error on negative replicate (#3963). [Benjamin Menküc]
+* Fix self references to parameterized classes (#3962). [Ryszard Rozak, Antmicro Ltd]
+* Fix LITENDIAN warning is backwards (#3966) (#3967). [Cameron Kirk]
+* Fix subsequent parameter declarations (#3969). [Ryszard Rozak, Antmicro Ltd]
+* Fix timing delays to not truncate below 64 bits (#3973) (#3982). [Felix Neumärker]
+* Fix cmake on macOS to mark weak symbols with -U linker flag (#3978) (#3979). [Peter Debacker]
+* Fix UNDRIVEN warning seg fault (#3989). [Felix Neumärker]
+* Fix coverage of class methods (#3998). [Tim Paine]
+* Fix packed array structure replication.
+* Fix enum.next(0) and enum.prev(0).
+
+
+Verilator 5.006 2023-01-22
==========================
**Minor:**
@@ -20,6 +79,7 @@ Verilator 5.006 2022-01-22
* Support property calls without parenthesis (#3879) (#3893). [Ryszard Rozak, Antmicro Ltd]
* Support import/export lists in modport (#3886). [Gökçe Aydos]
* Support class queue equality (#3895). [Ilya Barkov]
+* Support type case and type equality comparisons.
* Add IMPLICITSTATIC warning when a ftask/function is implicitly static (#3839). [Ryszard Rozak, Antmicro Ltd]
* Add VL_VALUE_STRING_MAX_WORDS override (#3869). [Andrew Nolte]
* Optimize expansion of extend operators.
@@ -44,6 +104,8 @@ Verilator 5.006 2022-01-22
* Fix foreach unnamedblk duplicate error (#3885). [Ilya Barkov]
* Fix elaboration of member selected classes (#3890). [Ilya Barkov]
* Fix mismatched widths in DFG (#3872). [Geza Lore, Yike Zhou]
+* Fix lint for non-integral types in packed structs.
+* Fix generate case with empty body statements.
Verilator 5.004 2022-12-14
diff --git a/Makefile.in b/Makefile.in
index ba14a84d7..c845f5e76 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,13 +15,13 @@
#
#****************************************************************************/
#
-# make all to compile and build Verilator.
-# make install to install it.
-# make TAGS to update tags tables.
+# make all to compile and build Verilator.
+# make install to install it.
+# make TAGS to update tags tables.
#
# make clean or make mostlyclean
# Delete all files from the current directory that are normally
-# created by building the program. Don't delete the files that
+# created by building the program. Don't delete the files that
# record the configuration. Also preserve files that could be made
# by building, but normally aren't because the distribution comes
# with them.
@@ -153,7 +153,7 @@ msg_test: all_nomsg
@echo
.PHONY: test
-ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
+ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
test: smoke-test test_regress
# examples is part of test_regress's test_regress/t/t_a2_examples.pl
# (because that allows it to run in parallel with other test_regress's)
@@ -462,7 +462,7 @@ config.status: configure
./config.status --recheck
configure: configure.ac
-ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
+ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
autoconf --warnings=all
else
autoconf
@@ -501,7 +501,7 @@ distclean maintainer-clean::
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
${srcdir}/*.in ${srcdir}/*.pod
-TAGS: $(TAGFILES)
+TAGS: $(TAGFILES)
etags $(TAGFILES)
.PHONY: doxygen
diff --git a/bin/verilator b/bin/verilator
index 7d4c84bd4..587a9b85f 100755
--- a/bin/verilator
+++ b/bin/verilator
@@ -362,7 +362,7 @@ detailed descriptions of these arguments.
+incdir+
Directory to search for includes
--inline-mult Tune module inlining
--instr-count-dpi Assumed dynamic instruction count of DPI imports
- -j Parallelism for --build (alias to --build-jobs)
+ -j Parallelism for --build-jobs/--verilate-jobs
--l2-name Verilog scope name of the top module
--language Default language standard to parse
-LDFLAGS Linker pre-object arguments for makefile
@@ -416,6 +416,7 @@ detailed descriptions of these arguments.
--no-skip-identical Disable skipping identical output
--stats Create statistics file
--stats-vars Provide statistics on variables
+ --no-std Prevent parsing standard library
--structs-packed Convert all unpacked structures to packed structures
-sv Enable SystemVerilog parsing
+systemverilogext+ Synonym for +1800-2017ext+
@@ -445,6 +446,7 @@ detailed descriptions of these arguments.
--unused-regexp Tune UNUSED lint signals
-V Verbose version and config
-v Verilog library
+ --verilate-jobs Job threads for Verilation stage
--no-verilate Skip Verilation and just compile previously Verilated code
+verilog1995ext+ Synonym for +1364-1995ext+
+verilog2001ext+ Synonym for +1364-2001ext+
diff --git a/bin/verilator_coverage b/bin/verilator_coverage
index 92f1a7c20..19493d44b 100755
--- a/bin/verilator_coverage
+++ b/bin/verilator_coverage
@@ -169,6 +169,7 @@ L.
--annotate Directory name for source annotation.
--annotate-all All files should be shown.
--annotate-min Minimum occurrence count for uncovered.
+ --annotate-points Annotates info from each coverage point.
--help Displays this message and version and exits.
--rank Compute relative importance of tests.
--unlink With --write, unlink all inputs
diff --git a/bin/verilator_difftree b/bin/verilator_difftree
index f298bcf07..63112a592 100755
--- a/bin/verilator_difftree
+++ b/bin/verilator_difftree
@@ -42,8 +42,8 @@ def diff_dir(a, b):
continue
a = files[base]['a']
b = files[base]['b']
- print("=" * 70)
- print("= %s <-> %s" % (a, b))
+ print("=" * 70, flush=True)
+ print("= %s <-> %s" % (a, b), flush=True)
diff_file(a, b)
anyfile = True
if not anyfile:
diff --git a/ci/ci-win-compile.ps1 b/ci/ci-win-compile.ps1
index 20a744539..e4146b033 100644
--- a/ci/ci-win-compile.ps1
+++ b/ci/ci-win-compile.ps1
@@ -4,12 +4,12 @@ if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
mkdir build
cd build
cmake .. --install-prefix $PWD/../../../.ccache
- cmake --build . --config Release
+ cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../../../.ccache
cd ../..
}
mkdir build
cd build
cmake .. --install-prefix $PWD/../install
-cmake --build . --config Release
+cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../install
diff --git a/ci/ci-win-test.ps1 b/ci/ci-win-test.ps1
index 1900bd4a5..1406126d6 100644
--- a/ci/ci-win-test.ps1
+++ b/ci/ci-win-test.ps1
@@ -4,7 +4,7 @@ cd examples/cmake_tracing_c
mkdir build
cd build
cmake ..
-cmake --build . --config Release
+cmake --build . --config Release -j 3
Release/example.exe
cd ..
Remove-Item -path build -recurse
diff --git a/configure.ac b/configure.ac
index d3be24f47..74d1beb5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,12 +5,12 @@
# General Public License Version 3 or the Perl Artistic License Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
-# When releasing, also update header of Changes file
+# When releasing, also update header of Changes file,
# and commit using "devel release" or "Version bump" message
# Then 'make maintainer-dist'
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel])
-AC_INIT([Verilator],[5.006 2023-01-22],
+AC_INIT([Verilator],[5.008 2023-03-04],
[https://verilator.org],
[verilator],[https://verilator.org])
diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS
index ed105e78f..aad4beb04 100644
--- a/docs/CONTRIBUTORS
+++ b/docs/CONTRIBUTORS
@@ -3,6 +3,7 @@ under the Developer Certificate of Origin (https://developercertificate.org/).
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
+Adam Bagley
Adrien Le Masle
Ahmed El-Mahmoudy
Aleksander Kiryk
@@ -13,6 +14,7 @@ Ameya Vikram Singh
Andreas Kuster
Andrew Nolte
Arkadiusz Kozdra
+Cameron Kirk
Chris Randall
Chuxuan Wang
Conor McCullough
@@ -28,6 +30,7 @@ Driss Hafdi
Edgar E. Iglesias
Eric Rippey
Fan Shupei
+Felix Neumärker
Felix Yan
Garrett Smith
Geza Lore
@@ -65,6 +68,7 @@ Joey Liu
John Coiner
John Demme
Jonathan Drolet
+Joseph Nwabueze
Josh Redford
Julie Schwartz
Julien Margetts
@@ -75,6 +79,7 @@ Keith Colbert
Kevin Kiningham
Kritik Bhimani
Krzysztof Bieganski
+Krzysztof Boroński
Kuba Ober
Larry Doolittle
Ludwig Rogiers
@@ -103,6 +108,7 @@ Nathan Myers
Patrick Stewart
Paul Wright
Pawel Sagan
+Peter Debacker
Peter Horvath
Peter Monsson
Philipp Wagner
@@ -148,3 +154,4 @@ Yutetsu TAKATSUKASA
Yu-Sheng Lin
Yves Mathieu
Zhanglei Wang
+Zixi Li
diff --git a/docs/gen/ex_WIDTH_1_faulty.rst b/docs/gen/ex_WIDTHEXPAND_1_faulty.rst
similarity index 75%
rename from docs/gen/ex_WIDTH_1_faulty.rst
rename to docs/gen/ex_WIDTHEXPAND_1_faulty.rst
index 0121e66ac..08c1f0ba2 100644
--- a/docs/gen/ex_WIDTH_1_faulty.rst
+++ b/docs/gen/ex_WIDTHEXPAND_1_faulty.rst
@@ -1,4 +1,4 @@
-.. comment: generated by t_lint_width_docs_bad
+.. comment: generated by t_lint_widthexpand_docs_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 3
diff --git a/docs/gen/ex_WIDTH_1_fixed.rst b/docs/gen/ex_WIDTHEXPAND_1_fixed.rst
similarity index 66%
rename from docs/gen/ex_WIDTH_1_fixed.rst
rename to docs/gen/ex_WIDTHEXPAND_1_fixed.rst
index 11a33b7d0..b40b8b2a6 100644
--- a/docs/gen/ex_WIDTH_1_fixed.rst
+++ b/docs/gen/ex_WIDTHEXPAND_1_fixed.rst
@@ -1,4 +1,4 @@
-.. comment: generated by t_lint_width_docs_bad
+.. comment: generated by t_lint_widthexpand_docs_bad
.. code-block:: sv
:emphasize-lines: 1
diff --git a/docs/gen/ex_WIDTHEXPAND_1_msg.rst b/docs/gen/ex_WIDTHEXPAND_1_msg.rst
new file mode 100644
index 000000000..927476284
--- /dev/null
+++ b/docs/gen/ex_WIDTHEXPAND_1_msg.rst
@@ -0,0 +1,4 @@
+.. comment: generated by t_lint_widthexpand_docs_bad
+.. code-block::
+
+ %Warning-WIDTHEXPAND: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
diff --git a/docs/gen/ex_WIDTH_1_msg.rst b/docs/gen/ex_WIDTH_1_msg.rst
deleted file mode 100644
index 276a8ffc6..000000000
--- a/docs/gen/ex_WIDTH_1_msg.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-.. comment: generated by t_lint_width_docs_bad
-.. code-block::
-
- %Warning-WIDTH: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
diff --git a/docs/guide/conf.py b/docs/guide/conf.py
index bcf574cc7..8755706ed 100644
--- a/docs/guide/conf.py
+++ b/docs/guide/conf.py
@@ -10,7 +10,6 @@
# ----------------------------------------------------------------------
# -- Path setup
-from datetime import datetime
import os
import re
import sys
@@ -24,10 +23,18 @@ def get_vlt_version():
filename = "../../Makefile"
with open(filename, "r", encoding="utf8") as fh:
for line in fh:
- match = re.search(r"PACKAGE_VERSION_NUMBER *= *([a-z0-9.]+)", line)
+ match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +([-0-9]+)",
+ line)
if match:
- return match.group(1)
- return "unknown"
+ return match.group(1), match.group(2)
+ match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +devel", line)
+ if match:
+ try:
+ data = os.popen('git log -n 1 --pretty=%cs').read()
+ except Exception:
+ data = "" # fallback, and Sphinx will fill in today's date
+ return "Devel " + match.group(1), data
+ return "unknown", "unknown"
def setup(app):
@@ -44,8 +51,8 @@ author = 'Wilson Snyder'
# The master toctree document.
master_doc = "index"
-version = get_vlt_version()
-release = get_vlt_version()
+version, today_fmt = get_vlt_version()
+release = version
rst_prolog = """
.. role:: vlopt(option)
@@ -89,9 +96,6 @@ source_suffix = [".rst"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
-# Date format to ISO
-today_fmt = datetime.now().strftime("%F")
-
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
diff --git a/docs/guide/connecting.rst b/docs/guide/connecting.rst
index 35c1c6aec..9762e264a 100644
--- a/docs/guide/connecting.rst
+++ b/docs/guide/connecting.rst
@@ -374,9 +374,11 @@ changed on the specified clock edge.
.. code-block:: bash
cat >our.v <<'EOF'
- module our (input clk);
- reg readme /*verilator public_flat_rd*/;
- reg writeme /*verilator public_flat_rw @(posedge clk) */;
+ module our #(
+ parameter WIDTH /*verilator public_flat_rd*/ = 32
+ ) (input clk);
+ reg [WIDTH-1:0] readme /*verilator public_flat_rd*/;
+ reg [WIDTH-1:0] writeme /*verilator public_flat_rw @(posedge clk) */;
initial $finish;
endmodule
EOF
@@ -398,12 +400,14 @@ accesses the above signal "readme" would be:
vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
const char* name = vpi_get_str(vpiName, vh1);
- printf("Module name: %s\n", name); // Prints "readme"
+ const char* type = vpi_get_str(vpiType, vh1);
+ const int size = vpi_get(vpiSize, vh1);
+ printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32"
s_vpi_value v;
v.format = vpiIntVal;
vpi_get_value(vh1, &v);
- printf("Value of v: %d\n", v.value.integer); // Prints "readme"
+ printf("Value of %s: %d\n", name, v.value.integer); // Prints "Value of readme: 0"
}
int main(int argc, char** argv) {
@@ -479,11 +483,12 @@ distribution.
Verilated and VerilatedContext
==============================
-Multiple Verilated models may be part of the same simulation context, that
-is share a VPI interface, sense of time, and common settings. This common
-simulation context information is stored in a ``VerilatedContext``
+Multiple C++ Verilated models may be part of the same simulation context,
+that is share a VPI interface, sense of time, and common settings. This
+common simulation context information is stored in a ``VerilatedContext``
structure. If a ``VerilatedContext`` is not created prior to creating a
-model, a default global one is created automatically.
+model, a default global one is created automatically. SystemC requires
+using only the single, default VerilatedContext.
The ``Verilated::`` methods, including the ``Verilated::commandArgs`` call
shown above, call VerilatedContext methods using the default global
diff --git a/docs/guide/deprecations.rst b/docs/guide/deprecations.rst
index eb3f05f2c..1fd8252fd 100644
--- a/docs/guide/deprecations.rst
+++ b/docs/guide/deprecations.rst
@@ -22,10 +22,6 @@ Verilated_heavy.h
"verilated.h". Verilated_heavy.h is planned for removal no sooner than
July 2022.
-Option `--cdc`
- The experimental `--cdc` option is believed to be generally unused and is
- planned for removal no sooner than January 2023.
-
Option `-O`
The debug `-O` options have been replaced with
`-fno-` debug options to match GCC. The old options are
diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst
index e610fa926..0a4b90249 100644
--- a/docs/guide/exe_verilator.rst
+++ b/docs/guide/exe_verilator.rst
@@ -155,18 +155,6 @@ Summary:
Specify C++ without SystemC output mode; see also the :vlopt:`--sc`
option.
-.. option:: --cdc
-
- Permanently experimental. Perform some clock domain crossing checks and
- issue related warnings (CDCRSTLOGIC) and then exit; if warnings other
- than CDC warnings are needed, make a second run with
- :vlopt:`--lint-only`. Additional warning information is also written to
- the file :file:`__cdc.txt`.
-
- Currently only checks some items that other CDC tools missed; if you are
- interested in adding more traditional CDC checks, please contact the
- authors.
-
.. option:: -CFLAGS
Add specified C compiler argument to the generated makefiles. For
@@ -434,7 +422,7 @@ Summary:
Preprocess the source code, but do not compile, similar to C++
preprocessing using :command:`gcc -E`. Output is written to standard
out. Beware of enabling debugging messages, as they will also go to
- standard out.
+ standard out. See :vlopt:`--no-std`, which is implied by this.
See also :vlopt:`--dump-defines`, :vlopt:`-P`, and
:vlopt:`--pp-comments` options.
@@ -707,9 +695,10 @@ Summary:
.. option:: -j []
Specify the level of parallelism for :vlopt:`--build` if
- :vlopt:`--build-jobs` isn't provided. If zero, uses the number of threads
- in the current hardware. Otherwise, the must be a positive
- integer specifying the maximum number of parallel build jobs.
+ :vlopt:`--build-jobs` isn't provided, and the internal compilation steps
+ of Verilator if :vlopt:`--verilate-jobs` isn't provided. If zero, uses
+ the number of threads in the current hardware. Otherwise, must be a
+ positive integer specifying the maximum number of parallel build jobs.
.. option:: --l2-name
@@ -1201,6 +1190,10 @@ Summary:
by size (plain :vlopt:`--stats` just gives a count). See
:vlopt:`--stats`, which is implied by this.
+.. option:: --no-std
+
+ Prevents parsing standard library.
+
.. option:: --structs-packed
Converts all unpacked structures to packed structures, and issues an
@@ -1429,6 +1422,15 @@ Summary:
execute only the build. This can be useful for rebuilding the Verilated code
produced by a previous invocation of Verilator.
+.. option:: --verilate-jobs []
+
+ Specify the level of parallelism for the internal compilation steps of
+ Verilator. If zero, uses the number of threads in the current hardware.
+ Otherwise, must be a positive integer specifying the maximum number of
+ parallel build jobs.
+
+ See also :vlopt:`-j`.
+
.. option:: +verilog1995ext+
Synonym for :vlopt:`+1364-1995ext+\`.
@@ -1528,6 +1530,8 @@ Summary:
:command:`gcc -Wpedantic`. Rarely used, and intended only for strict
compliance tests.
+ This option changes :option:`ASSIGNIN` from an error to a warning.
+
.. option:: -Wwarn-
Enables the specified warning message.
diff --git a/docs/guide/exe_verilator_coverage.rst b/docs/guide/exe_verilator_coverage.rst
index 57eb02808..2c78cf7de 100644
--- a/docs/guide/exe_verilator_coverage.rst
+++ b/docs/guide/exe_verilator_coverage.rst
@@ -6,10 +6,10 @@ verilator_coverage
Verilator_coverage processes Verilated model-generated coverage reports.
-With --annotate, it reads the specified coverage data file and generates
-annotated source code with coverage metrics annotated. If multiple
-coverage points exist on the same source code line, additional lines will
-be inserted to report the additional points.
+With `--annotate`, it reads the specified coverage data file and generates
+annotated source code with coverage metrics annotated. With
+`--annotate-points` the coverage points corresponding to each line are also
+shown.
Additional Verilog-XL-style standard arguments specify the search paths
necessary to find the source code on which the coverage analysis was
@@ -58,6 +58,18 @@ to read multiple inputs. If no data file is specified, by default,
Specifies the directory name to which source files with annotated coverage
data should be written.
+Converting from the Verilator coverage data format to the info format is
+lossy; the info will have all forms of coverage merged line coverage, and
+if there are multiple coverage points on a single line they will merge.
+The minimum coverage across all merged points will be used to report
+coverage of the line.
+
+The first character of the line shows a summary of the coverage; this
+allows use of grep to filter the report. `%` indicates at least one point
+on the line was below the coverage limit. `+` indicates an
+:option:`--annotate-points` point was at or above the limit, and `-` that
+the point was below the limit.
+
.. option:: --annotate-all
Specifies all files should be shown. By default, only those source files
@@ -70,6 +82,13 @@ coverage hits, then the coverage point will be considered above the
threshold, and the coverage report will put a "%" to indicate the coverage
is insufficient. Defaults to 10.
+.. option:: --annotate-points
+
+Specifies all coverage points should be shown after each line of text. By
+default, only source lines are shown.
+
+with low coverage are written to the output directory.
+
.. option:: --help
Displays a help summary, the program version, and exits.
diff --git a/docs/guide/extensions.rst b/docs/guide/extensions.rst
index 6f71cf947..5994fb770 100644
--- a/docs/guide/extensions.rst
+++ b/docs/guide/extensions.rst
@@ -446,6 +446,33 @@ or "`ifdef`"'s may break other tools.
Same as :option:`public_flat_rw` configuration file option.
+.. option:: /*verilator&32;public_[|flat|flat_rd|flat_rw]_on [@()]*/ (as scope)
+
+ Used to wrap multiple signals and parameters with the respective public attribute.
+ See attribute above for their respective behavior. Cannot be nested. e.g:
+
+ .. code-block:: sv
+
+ /*verilator public_flat_rw_on*/
+ logic clk;
+ logic rst;
+ parameter width = 8;
+ /* verilator public_off*/
+ logic data;
+
+ Is equivalent to:
+
+ .. code-block:: sv
+
+ logic clk /*verilator public_flat_rw*/;
+ logic rst /*verilator public_flat_rw*/;
+ parameter width /*verilator public_flat_rw*/ = 8;
+ logic data;
+
+.. option:: /*verilator&32;public_off*/
+
+ Terminates the previous `/*verilator public*_on*/` directive; see above.
+
.. option:: /*verilator&32;public_module*/
Used after a module statement to indicate the module should not be
diff --git a/docs/guide/languages.rst b/docs/guide/languages.rst
index 4865f5375..6eeb84fb1 100644
--- a/docs/guide/languages.rst
+++ b/docs/guide/languages.rst
@@ -461,6 +461,10 @@ chandle
Treated as a "longint"; does not yet warn about operations specified as
illegal on chandles.
+checker
+ Treated as a "module"; does not yet warn about many constructs illegal
+ inside a checker.
+
disable
Disable statements may be used only if the block being disabled is a
block the disable statement itself is inside. This was commonly used to
diff --git a/docs/guide/warnings.rst b/docs/guide/warnings.rst
index 7f0011153..ccfb0e763 100644
--- a/docs/guide/warnings.rst
+++ b/docs/guide/warnings.rst
@@ -74,7 +74,8 @@ List Of Warnings
.. option:: Unsupported: ....
This error indicates that the code uses a Verilog language construct
- that is not yet supported in Verilator. See the Limitations chapter.
+ that is not yet supported in Verilator. See also :ref:`Language
+ Limitations`.
.. option:: ALWCOMBORDER
@@ -317,9 +318,11 @@ List Of Warnings
.. option:: CDCRSTLOGIC
- With :vlopt:`--cdc` only, it warns that asynchronous flop reset terms come
- from other than primary inputs or flopped outputs, creating the
- potential for reset glitches.
+ Historical, never issued since version 5.008.
+
+ Warned with a no longer supported clock domain crossing option that
+ asynchronous flop reset terms came from other than primary inputs or
+ flopped outputs, creating the potential for reset glitches.
.. option:: CLKDATA
@@ -847,14 +850,14 @@ List Of Warnings
.. TODO better example
- Warns that a packed vector is declared with little endian bit numbering
- (i.e. [0:7]). Big endian bit numbering is now the overwhelming
- standard, and little numbering is now thus often due to simple oversight
+ Warns that a packed vector is declared with big endian bit numbering
+ (i.e. [0:7]). Little endian bit numbering is now the overwhelming
+ standard, and big numbering is now thus often due to simple oversight
instead of intent.
- It also warns that an instance is declared with little endian range
- (i.e. [0:7] or [7]) and is connected to an N-wide signal. Based on IEEE
- the bits will likely be backward from what people may expect
+ It also warns that an instance is declared with big endian range
+ (i.e. [0:7] or [7]) and is connected to an N-wide signal.
+ The bits will likely be backward from what people may expect
(i.e., instance [0] will connect to signal bit [N-1] not bit [0]).
Ignoring this warning will only suppress the lint check; it will
@@ -1790,16 +1793,27 @@ List Of Warnings
For example, this is a missized index:
- .. include:: ../../docs/gen/ex_WIDTH_1_faulty.rst
+ .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_faulty.rst
- Results in:
+ Results in a WIDTHEXPAND warning:
- .. include:: ../../docs/gen/ex_WIDTH_1_msg.rst
+ .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_msg.rst
One possible fix:
- .. include:: ../../docs/gen/ex_WIDTH_1_fixed.rst
+ .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
+.. option:: WIDTHTRUNC
+
+ A more granular WIDTH warning, for when a value is truncated
+
+.. option:: WIDTHEXPAND
+
+ A more granular WIDTH warning, for when a value is zero expanded
+
+.. option:: WIDTHXZEXPAND
+
+ A more granular WIDTH warning, for when a value is xz expanded
.. option:: WIDTHCONCAT
diff --git a/examples/cmake_hello_c/CMakeLists.txt b/examples/cmake_hello_c/CMakeLists.txt
index 09abc8016..679abcc33 100644
--- a/examples/cmake_hello_c/CMakeLists.txt
+++ b/examples/cmake_hello_c/CMakeLists.txt
@@ -19,7 +19,8 @@
# cmake ..
# cmake --build .
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(SET CMP0074 NEW)
project(cmake_hello_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
diff --git a/examples/cmake_hello_sc/CMakeLists.txt b/examples/cmake_hello_sc/CMakeLists.txt
index f85d05c6d..16978bc80 100644
--- a/examples/cmake_hello_sc/CMakeLists.txt
+++ b/examples/cmake_hello_sc/CMakeLists.txt
@@ -19,7 +19,8 @@
# cmake ..
# cmake --build .
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(SET CMP0074 NEW)
project(cmake_hello_sc CXX)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
diff --git a/examples/cmake_protect_lib/CMakeLists.txt b/examples/cmake_protect_lib/CMakeLists.txt
index de2de27c2..1e09cb5fd 100644
--- a/examples/cmake_protect_lib/CMakeLists.txt
+++ b/examples/cmake_protect_lib/CMakeLists.txt
@@ -19,7 +19,8 @@
# cmake ..
# cmake --build .
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(SET CMP0074 NEW)
project(cmake_protect_lib)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
diff --git a/examples/cmake_tracing_c/CMakeLists.txt b/examples/cmake_tracing_c/CMakeLists.txt
index 95fb3dfb2..3f69fc3c9 100644
--- a/examples/cmake_tracing_c/CMakeLists.txt
+++ b/examples/cmake_tracing_c/CMakeLists.txt
@@ -19,7 +19,8 @@
# cmake ..
# cmake --build .
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(SET CMP0074 NEW)
project(cmake_tracing_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
diff --git a/examples/cmake_tracing_sc/CMakeLists.txt b/examples/cmake_tracing_sc/CMakeLists.txt
index 0d67a8cf5..58d0aaceb 100644
--- a/examples/cmake_tracing_sc/CMakeLists.txt
+++ b/examples/cmake_tracing_sc/CMakeLists.txt
@@ -19,7 +19,9 @@
# cmake ..
# cmake --build .
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(SET CMP0074 NEW)
+
project(cmake_tracing_sc_example CXX)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
diff --git a/examples/make_tracing_c/Makefile_obj b/examples/make_tracing_c/Makefile_obj
index 56db2ee15..d91039d21 100644
--- a/examples/make_tracing_c/Makefile_obj
+++ b/examples/make_tracing_c/Makefile_obj
@@ -31,7 +31,7 @@ CPPFLAGS += -DVL_DEBUG=1
# Turn on some more compiler lint flags (when configured appropriately)
# For testing inside Verilator, "configure --enable-ccwarn" will do this
# automatically; otherwise you may want this unconditionally enabled
-ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
+ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
USER_CPPFLAGS_WALL += -W -Werror -Wall
endif
diff --git a/examples/make_tracing_sc/Makefile_obj b/examples/make_tracing_sc/Makefile_obj
index a2d175a27..be55d066c 100644
--- a/examples/make_tracing_sc/Makefile_obj
+++ b/examples/make_tracing_sc/Makefile_obj
@@ -30,7 +30,7 @@ CPPFLAGS += -Wno-deprecated
# Turn on some more flags (when configured appropriately)
# For testing inside Verilator, "configure --enable-ccwarn" will do this
# automatically; otherwise you may want this unconditionally enabled
-ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
+ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
USER_CPPFLAGS_WALL += -W -Werror -Wall
endif
diff --git a/include/verilated.cpp b/include/verilated.cpp
index 2b1c6f997..995656840 100644
--- a/include/verilated.cpp
+++ b/include/verilated.cpp
@@ -1411,6 +1411,12 @@ IData VL_FERROR_IN(IData, std::string& outputr) VL_MT_SAFE {
outputr = std::string{::std::strerror(ret)};
return ret;
}
+IData VL_FERROR_IW(IData fpi, int obits, WDataOutP outwp) VL_MT_SAFE {
+ std::string output;
+ const IData ret = VL_FERROR_IN(fpi, output /*ref*/);
+ _vl_string_to_vint(obits, outwp, output.length(), output.c_str());
+ return ret;
+}
IData VL_FOPEN_NN(const std::string& filename, const std::string& mode) {
return Verilated::threadContextp()->impp()->fdNew(filename.c_str(), mode.c_str());
@@ -1793,6 +1799,7 @@ std::string VL_TO_STRING(CData lhs) { return VL_SFORMATF_NX("'h%0x", 8, lhs); }
std::string VL_TO_STRING(SData lhs) { return VL_SFORMATF_NX("'h%0x", 16, lhs); }
std::string VL_TO_STRING(IData lhs) { return VL_SFORMATF_NX("'h%0x", 32, lhs); }
std::string VL_TO_STRING(QData lhs) { return VL_SFORMATF_NX("'h%0x", 64, lhs); }
+std::string VL_TO_STRING(double lhs) { return VL_SFORMATF_NX("%d", 64, lhs); }
std::string VL_TO_STRING_W(int words, const WDataInP obj) {
return VL_SFORMATF_NX("'h%0x", words * VL_EDATASIZE, obj);
}
@@ -1861,6 +1868,33 @@ IData VL_ATOI_N(const std::string& str, int base) VL_PURE {
if (errno != 0) v = 0;
return static_cast(v);
}
+IData VL_NTOI_I(int obits, const std::string& str) VL_PURE { return VL_NTOI_Q(obits, str); }
+QData VL_NTOI_Q(int obits, const std::string& str) VL_PURE {
+ QData out = 0;
+ const size_t procLen = std::min(str.length(), static_cast(8));
+ const char* const datap = str.data();
+ int pos = static_cast(str.length()) - 1;
+ int bit = 0;
+ while (bit < obits && pos >= 0) {
+ out |= static_cast(datap[pos]) << VL_BITBIT_Q(bit);
+ bit += 8;
+ --pos;
+ }
+ return out & VL_MASK_Q(obits);
+}
+void VL_NTOI_W(int obits, WDataOutP owp, const std::string& str) VL_PURE {
+ const int words = VL_WORDS_I(obits);
+ for (int i = 0; i < words; ++i) owp[i] = 0;
+ const char* const datap = str.data();
+ int pos = static_cast(str.length()) - 1;
+ int bit = 0;
+ while (bit < obits && pos >= 0) {
+ owp[VL_BITWORD_I(bit)] |= static_cast(datap[pos]) << VL_BITBIT_I(bit);
+ bit += 8;
+ --pos;
+ }
+ owp[words - 1] &= VL_MASK_E(obits);
+}
//===========================================================================
// Readmem/writemem
@@ -2948,7 +2982,7 @@ VerilatedModule::~VerilatedModule() {
// VerilatedVar:: Methods
// cppcheck-suppress unusedFunction // Used by applications
-uint32_t VerilatedVarProps::entSize() const {
+uint32_t VerilatedVarProps::entSize() const VL_MT_SAFE {
uint32_t size = 1;
switch (vltype()) {
case VLVT_PTR: size = sizeof(void*); break;
@@ -2968,7 +3002,7 @@ size_t VerilatedVarProps::totalSize() const {
return size;
}
-void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const {
+void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const VL_MT_SAFE {
if (VL_UNLIKELY(dim <= 0 || dim > udims())) return nullptr;
if (VL_UNLIKELY(indx < low(dim) || indx > high(dim))) return nullptr;
const int indxAdj = indx - low(dim);
@@ -3087,7 +3121,7 @@ void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
return nullptr;
}
-void* VerilatedScope::exportFindError(int funcnum) const {
+void* VerilatedScope::exportFindError(int funcnum) const VL_MT_SAFE {
// Slowpath - Called only when find has failed
const std::string msg
= (std::string{"Testbench C called '"} + VerilatedImp::exportName(funcnum)
diff --git a/include/verilated.h b/include/verilated.h
index 0b4592b27..822fc89fa 100644
--- a/include/verilated.h
+++ b/include/verilated.h
@@ -47,6 +47,7 @@
#include
#include
#include
+#include
#include