Commit Graph

1843 Commits

Author SHA1 Message Date
Wilson Snyder 3c8953fec2 Fix $sformat with non-constant string first argument 2020-06-09 19:40:49 -04:00
Wilson Snyder 6de78d58fa Add new UNSUPPORTED error code to replace most previous Unsupported: messages. 2020-06-09 19:20:16 -04:00
Wilson Snyder d42f9c095b Delay parsing of associative arrays until dtypes known. 2020-06-09 07:13:40 -04:00
Wilson Snyder 46e10173f8 Support --bbox-unsup parsing of class extern function/task. 2020-06-08 22:33:57 -04:00
Wilson Snyder 6e2d8df9e5 Tests: Add --debug-exit-parse 2020-06-08 22:10:55 -04:00
Wilson Snyder e2b40195b4 Tests: Reference issue #2410. 2020-06-08 20:58:04 -04:00
Wilson Snyder 541f983dba Merge tests from issue-2409-timing (but disabled mostly) 2020-06-08 20:36:22 -04:00
Wilson Snyder 47f040a5fd Internals: Do data type elaboration always as child node, before movement to symbol table. 2020-06-08 06:47:18 -04:00
Wilson Snyder 4984d19ae9 Support --bbox-unsup parsing :: referencing typedef in class 2020-06-07 19:59:03 -04:00
Wilson Snyder 305448ea86 Cleanup parser errors to identify packages by :: instead of symbol table 2020-06-07 16:54:25 -04:00
Wilson Snyder b469feb44b Fix some syntax error context by splitting internal parse and lex filelines 2020-06-07 13:45:50 -04:00
Wilson Snyder 820a4dbbdd Internals: Pass fileline directly. No functional change intended. 2020-06-07 10:53:21 -04:00
Wilson Snyder 418b36ea71 Internals: Pass fileline directly and avoid yyerror 2020-06-07 10:17:50 -04:00
Wilson Snyder 05e51d0d18 Tests: Excempt some wide files 2020-06-07 09:59:09 -04:00
Wilson Snyder 0098e67e59 Tests: Use lint in many negative tests to avoid running under both vlt and vltmt 2020-06-07 07:15:07 -04:00
Wilson Snyder 5cd5c05c05 Support --bbox-unsup parsing of event control expressions 2020-06-06 15:54:44 -04:00
Wilson Snyder 933e796cc2 Support $swrite with arbitrary arguments 2020-06-06 14:47:54 -04:00
Wilson Snyder ae701e014d Support --bbox-unsup parsing of for with multiple increments 2020-06-06 13:55:15 -04:00
Wilson Snyder 3a0b8c8870 Fix parsing parameter type with assignment and no type keyword. 2020-06-06 13:44:45 -04:00
Wilson Snyder 4862916f39 Support --bbox-unsup parsing of 'constraint', 'dist', 'solve' 2020-06-06 12:08:36 -04:00
Wilson Snyder 870ec27b73 Support --bbox-unsup parsing of 'randomize' 2020-06-06 11:22:48 -04:00
Wilson Snyder a21947d887 Support --bbox-unsup parsing of 'with' 2020-06-06 11:11:23 -04:00
Wilson Snyder 893dee3434 Support --bbox-unsup parsing of forward defed class calls 2020-06-06 10:21:16 -04:00
Wilson Snyder f083805ab5 Support --bbox-unsup parsing of parameterized classes 2020-06-06 10:06:32 -04:00
Wilson Snyder 1eaec2aa8a Support --bbox-unsup of $cast 2020-06-06 09:30:11 -04:00
Wilson Snyder 4c7d5a1dc0 Fix --bbox-unsup to bypass more parser unsupported errors. 2020-06-06 08:50:47 -04:00
Wilson Snyder 48740a0dba Tests: Add t_param_type 2020-06-05 22:22:44 -04:00
Wilson Snyder ff41701ddc Fix crash on undeclared packages. 2020-06-05 18:50:06 -04:00
Wilson Snyder 5a622fd9db Tests: Temporary fix for (#2407) 2020-06-05 07:28:51 -04:00
Wilson Snyder 7fe49de420 Tests: Tests to fix misc internal coverage holes. 2020-06-04 20:23:55 -04:00
Wilson Snyder d7cc1e6844 Tests: Use lint in many negative tests to avoid running under both vlt and vltmt 2020-06-03 20:05:13 -04:00
Wilson Snyder 42312101b5 Tests: Add array OOB tests as unsupported (#792) 2020-06-03 19:36:50 -04:00
Wilson Snyder 329f5b712a Tests: Add alias tests as unsupported (#697) 2020-06-03 19:27:22 -04:00
Tomasz Gorochowik 277dee109c
Fix Ariane issues with PostAdd nodes (#2400) 2020-06-03 12:50:24 -04:00
Ludwig Rogiers 2b6353b36e
Support vpi_handle type vpiLeftRange and vpiRightRange for vpiRange objects (#2395)
* Implement vpi_handle type vpiLeftRange and vpiRightRange for vpiRange objects

* Change VerilatedVpioConst type to vpiConstant
2020-06-02 08:04:22 -04:00
Wilson Snyder 8b647f0977 Fix error on UNPACKED in parser. (#1541) 2020-06-02 08:00:37 -04:00
Wilson Snyder a57826b125 Line Coverage now tracks all statement lines, not just branch lines. 2020-05-31 15:52:17 -04:00
Michael Killough 047852eb08
Fix OpenBSD make in tests. (#2388) 2020-05-31 09:03:51 -04:00
Geza Lore fe306a36b8
Add MergeCond pass to combine assignments with ?: on rhs (#2376)
This provides minor simulation performance benefit, but can provide
large C++ compilation time improvement, notably with Clang (4x).

This patch implements #2366 .
2020-05-30 21:09:05 +01:00
Wilson Snyder fbc814b54a Internal code coverage fixes 2020-05-29 19:35:54 -04:00
Tomasz Gorochowik a4a1c7a384
Fix swerv issues with Increment nodes (#2380) 2020-05-29 13:03:04 -04:00
Wilson Snyder 5089ac6119 Remove VL_ULL as ULL now in MSVC & C++11 2020-05-28 20:32:07 -04:00
Maciej Sobkowski 9d48ff7745
Support pre/postifx incrementation/decrementation in array index (#2223) 2020-05-28 18:08:15 -04:00
Wilson Snyder 41e362b580 Tests: Remove some old conditional-fail checks. 2020-05-27 21:44:28 -04:00
Geza Lore d737266f64
Add OPT_GLOBAL to use for run-time library (#2373)
This allows compiling the run-time library with optimization even when OPT_FAST is not used in order to imporove model build speed, possibly during debug cycles.
2020-05-27 01:52:08 +01:00
Wilson Snyder 978c35995a Support const cast (ignored since not linting const yet) 2020-05-26 20:44:20 -04:00
Stefan Wallentowitz dc90e6c3c3
Generate file with waivers (#2354)
This adds the flag --generate-waivefile <filename>. This will generate
a verilator config file with the proper lint_off statemens to turn off
warnings emitted during this particular run.

This feature can be used to start with using Verilator as linter and
systematically capture all known lint warning for further
elimination. It hopefully helps people turning of -Wno-fatal or
-Wno-lint and gradually improve their code base.

Signed-off-by: Stefan Wallentowitz <stefan.wallentowitz@hm.edu>
2020-05-26 20:38:14 +02:00
Stefan Wallentowitz 68a2ed6776
Fix output of loops on waiving (#2355)
When an unopt loop is waived, we also don't want the loop's example
path being plot.

Signed-off-by: Stefan Wallentowitz <stefan.wallentowitz@hm.edu>
2020-05-26 08:45:57 +02:00
Geza Lore 7b683fe258 Use sane --output-split values by default to help large builds
--output-split is now on by default with value 20000.
--output-split-cfuncs and --output-split-ctrace now defaults to the
value of --output-split unless explicitly specified.
2020-05-26 01:22:10 +01:00
Geza Lore 72858175a2 Only emit VM_PARALLEL_BUILDS=1 iff --output-split caused a split.
Previously we set VM_PARALLEL_BUILDS=1 if the --output-split option was
provided. Now we only do it iff it actually causes a split.
2020-05-26 01:22:10 +01:00
Geza Lore 9d7086067c Rework serial/parallel build mode
Instead of __ALLfast.cpp and __ALLslow.cpp, we now create only a single
__ALL.cpp and compile it with OPT_FAST, this speeds up small builds
where the C compiler does not dominate. A separate patch will follow
turning VM_PARALLEL_BUILDS on by default at a certain size.

Given this change to the build there is now no point in emitting both
fast and slow routines into the same .cpp file when --output-split is
not set as they will be just included in the same __ALL.cpp file. To
keep things simpler and the output easier to comprehend, V3EmitC has
also been changed to always emit the fast and slow files separately.

Also change verilated.mk to apply OPT_SLOW to all slow files, not just
ones called *__Slow.cpp. This change in particular ensures __Syms.cpp
is build as slow.

Part of #2360.
2020-05-26 01:22:10 +01:00
Wilson Snyder abc3c216f8 Internal code coverage: Better support fastcov [still not default]. 2020-05-25 10:50:46 -04:00
Wilson Snyder c9e59e767a Tests: Add setenv method. 2020-05-23 22:24:26 -04:00
Vassilis Papaefstathiou a7432bdea7 Support wide operands in queues and dynamic arrays (#2352) 2020-05-23 21:59:56 -04:00
Wilson Snyder 3097d5e093 Commentary 2020-05-23 21:56:56 -04:00
Wilson Snyder 57621a93ad Internals: Move PLI errors into linker, and better test. 2020-05-23 11:55:34 -04:00
Wilson Snyder 6a882f9dc6 Internal code coverage improvements. No functional change intended. 2020-05-23 10:34:58 -04:00
Wilson Snyder 5c11de1663 Tests: Check queue typedef. 2020-05-22 22:14:26 -04:00
Wilson Snyder 01f3e81a36 Internals: Parse extend/implements/etc using generic identifiers. 2020-05-21 21:31:15 -04:00
Wilson Snyder 7834028842 Tests: Skip genhtml if too old 2020-05-19 08:24:21 -04:00
Geza Lore d20a4db773
Fix regression due to early constant folding in +: and -: (#2338) 2020-05-18 18:46:00 +01:00
Stephen Henry ba3930777a
Support display/scan %u/%z (#2324) (#2332) 2020-05-18 08:10:32 -04:00
Geza Lore 9c054a5774 Optimize trace activity flags a bit more
- Improve flag pruning heuristic
- Set all trace activity flags in slow code. This in turns enables us
to remove checking the slow flag on the fast path.
2020-05-17 19:41:24 +01:00
Wilson Snyder 4773a1e77c Misc internal coverage improvements. 2020-05-17 11:06:14 -04:00
Geza Lore dc25e9b949
Optimize fine grained trace activity flags (#2336)
Firstly, we always use a byte array for fine grained activity flags
instead of a bit vector (we used to use a byte array only if we had
parallel mtasks). The byte vector can be set more cheaply in eval,
closing about 1/3 of the gap in performance between compiling with
or without --trace on SweRV EH1. The speed of tracing itself is not
measurably different.

Secondly, we prune the activity tracking such that if a set of activity
flag combinations only guard a small number of signals, we will turn
those signals into awayls traced signals. This avoids code which
sometimes tests dozens of activity flags just to subsequently check one
signal and dump it if it's value changed. We can just check the signal
state straight instead, and not bother with the flags. This removes
about 30% of activity flags in SweRV EH1, and makes both single threaded
VCD and FST tracing 8-9% faster.
2020-05-17 13:53:02 +01:00
Wilson Snyder 17e7da77f0 Misc internal coverage improvements. 2020-05-16 18:02:54 -04:00
Wilson Snyder d33d0301f8 Support verilator_coverage --write-info for lcov HTML reports. 2020-05-16 09:18:35 -04:00
Wilson Snyder ffd461dcf8 Tests: Check need -cc message 2020-05-16 07:10:44 -04:00
Wilson Snyder 1d0a726437 Update internal code coverage framework. 2020-05-16 06:15:25 -04:00
Wilson Snyder 2edbcce032 Tests: Need only one run of t_trace_c_api.pl 2020-05-15 22:33:20 -04:00
Wilson Snyder 35a53d9adb Add t_trace_c_api test. 2020-05-15 20:38:08 -04:00
Wilson Snyder 85de3048a5 Tests: Avoid poluting non-obj_ files. 2020-05-14 18:50:49 -04:00
Stephen Henry 1a0da2e4ec
Support multi-channel descriptor (MCD) I/O (#2197) 2020-05-14 18:03:00 -04:00
Wilson Snyder 148762364b Tests: Complicated for loops long ago supported. 2020-05-13 20:53:55 -04:00
Wilson Snyder f005b7fd87 Support scan %* format 2020-05-11 22:13:59 -04:00
Stephen Henry 484b574cef
Fix crash on self-referential enum type. (#2319) 2020-05-11 18:44:28 -04:00
Wilson Snyder 29695adf70 Fix 10s/100s timeunits. 2020-05-11 08:15:52 -04:00
Wilson Snyder fac43811fd Commentary 2020-05-10 21:26:09 -04:00
Wilson Snyder 15f63d12d5 Fix message for seeded random. 2020-05-10 21:15:48 -04:00
Wilson Snyder ba7b3fd60f Support $display(,,). 2020-05-10 20:48:18 -04:00
Wilson Snyder 897b9ccfe2 Fix display of huge double. 2020-05-10 16:03:46 -04:00
Wilson Snyder b97e1aa9fe Support cast to string 2020-05-10 15:42:16 -04:00
Wilson Snyder d4a631446b Fix crash in unroller on increment-only while loops. 2020-05-10 15:26:41 -04:00
Wilson Snyder a2cc053c6f Tests: Fix t_math_svl.pl 2020-05-10 15:19:38 -04:00
Wilson Snyder 8998ffc4e5 Support reporting some fork syntax errors. 2020-05-10 15:01:43 -04:00
Wilson Snyder 629dd16714 Tests: Rename t_delay_func_bad 2020-05-10 14:28:42 -04:00
Yossi Nivin f9a0cf0cff
Support $countbits (#2287) 2020-05-10 14:27:22 -04:00
Wilson Snyder 070bcddf5a Support unpacked array .sum and .product. 2020-05-10 12:48:33 -04:00
Wilson Snyder feb1e2bd48 Commentary 2020-05-10 11:01:57 -04:00
Wilson Snyder a7e17a8855 Fix double conversion on half of conditional. 2020-05-08 21:35:45 -04:00
Wilson Snyder 60fa1db731 Tests: Trivial cleanup 2020-05-08 21:35:45 -04:00
Geza Lore ac09ad3ffd
Minor improvements to DPI open array handling (#2316)
- Allow arbitrary number of open array dimensions, not just 3. Note
right now this only works with the array querying functions specified
in IEEE 1800-2017 H.12.2
- Issue error when passing dynamic array or queue as DPI open array
(currently unsupported)
- Also tweaked AstVar::vlArgTypeRecurse, which should now error or fail
for unsupported types.
2020-05-08 18:22:44 +01:00
Wilson Snyder 27953e26b6 Backout example change. 2020-05-08 07:35:54 -04:00
Wilson Snyder 9375d9f603 Fix $isunknown with constant Zs. 2020-05-07 21:40:08 -04:00
Wilson Snyder 72bd91c7f1 Support $isunbounded and parameter $. (#2104) 2020-05-07 21:12:58 -04:00
Wilson Snyder 8850ca962e Fix newish error to use standard parens to ref IEEE. 2020-05-07 21:12:58 -04:00
Wilson Snyder 5f7ae1fbce wip 2020-05-07 21:04:26 -04:00
Wilson Snyder b56a25e89c Fix newish error to use standard parens to ref IEEE. 2020-05-07 18:21:11 -04:00
Wilson Snyder ca77a93214 Add lint check for bad delay locations. 2020-05-06 19:25:13 -04:00
Yutetsu TAKATSUKASA aa86e0bbc0
Support 'E', 'p', and 'P' when overriding floating point parameter. (#2310) 2020-05-06 07:45:07 -04:00
Wilson Snyder 7d7e67b49b Show Verilog reference on V3Number asserts. 2020-05-04 19:57:21 -04:00
Wilson Snyder a41ea180fa Fix +: and -: on unpacked arrays. (#2304) 2020-05-04 19:40:50 -04:00
Wilson Snyder 98889b3f4e Tests: Fix permission 2020-05-04 19:35:48 -04:00
Tim Snyder 83fbfa8c71
Fix /usr/bin/env perl in lieu of /usr/bin/perl (#2307)
Enables scripts to work where perl is not installed at /usr/bin/perl
2020-05-04 19:27:30 -04:00
Tim Snyder a57262d6e7
Fix use /usr/bin/env perl in lieu of /usr/bin/perl (#2306)
Enables scripts to work where perl is not installed at /usr/bin/perl
2020-05-04 18:42:15 -04:00
Geza Lore fe708f045a Fix Travis oddity 2020-05-04 00:21:07 +01:00
Geza Lore 8afcd67a1f Fix FST tracing of little endian vectors 2020-05-03 22:39:45 +01:00
Wilson Snyder 8f64e4a76f Support $root, #2150. 2020-05-02 08:29:20 -04:00
John Demme 6e9008fb5a
Fix VerilatedVarProps::totalSize missing the first unpacked dim (#2296) 2020-05-01 07:42:29 -04:00
Wilson Snyder a6deee2083 Fix clock enables with bit-extends, #2299. 2020-04-30 19:22:58 -04:00
Wilson Snyder 9fd4541069 Fix reduction OR on wide data, broke in v4.026, #2300. 2020-04-30 17:53:54 -04:00
Geza Lore 849487da23
Modify --build to be a standalone option (#2294)
- Issue an error when --build is used together with --make
- When given --build, always use GNU Make to perform the build
- Update documentation (examples were good as they were)
- Remove the broken t_flag_build_cmake test

Fixes #2280
2020-04-30 12:54:50 +01:00
Geza Lore aa9cde22c8
Use SIMD intrinsics to render VCD traces (#2289)
Use SIMD intrinsics to render VCD traces.

I have measured 10-40% single threaded performance increase with VCD
tracing on SweRV EH1 and lowRISC Ibex using SSE2 intrinsics to render
the trace. Also helps a tiny bit with FST, but now almost all of the FST
overhead is in the FST library.

I have reworked the tracing routines to use more precisely sized
arguments. The nice thing about this is that the performance without the
intrinsics is pretty much the same as it was before, as we do at most 2x
as much work as necessary, but in exchange there are no data dependent
branches at all.
2020-04-30 00:09:09 +01:00
Wilson Snyder b44efe7ef7 Use 'suggest' for consistent wording. 2020-04-28 21:19:19 -04:00
Wilson Snyder 15ad3f46be Fix logical not optimization with empty begin, #2291. 2020-04-28 21:15:20 -04:00
Wilson Snyder 910803e6db Fix error on unpacked connecting to packed, #2288. 2020-04-27 18:38:54 -04:00
Wilson Snyder 87e1c36e4a Support event data type (with some restrictions). 2020-04-25 15:37:46 -04:00
Wilson Snyder 3b37b5b92d Tests: Check output from some unsupported tests. 2020-04-24 08:22:19 -04:00
Geza Lore 27f4399c31
Fix tests failing on rerun after passing from clean. (#2281) 2020-04-23 21:27:06 -04:00
Wilson Snyder f93ae707e0 Tests: Add bad option test. 2020-04-23 19:56:26 -04:00
Geza Lore 8208fe8a0e
Fix test failures on Ubuntu 20.04 (#2278)
- Packaged SystemC lives in /usr so needed to update regex in test
driver
- Clang 10 complains about mixed named and positional initializers in
struct definitions.
2020-04-23 17:29:37 -04:00
Wilson Snyder ace35b3e81 Tests: Add -G test. 2020-04-23 08:05:14 -04:00
Wilson Snyder 2b58e834ee Tests: Rename IVERILOG define for consistency. No functional change. 2020-04-23 08:05:14 -04:00
Wilson Snyder 7176aee852 Internals: Parse fork and delays, but then still report unsupported. 2020-04-22 21:31:40 -04:00
Wilson Snyder 77915f78db Add experimental-only option. 2020-04-21 20:45:23 -04:00
Geza Lore c52f3349d1
Initial implementation of generic multithreaded tracing (#2269)
The --trace-threads option can now be used to perform tracing on a
thread separate from the main thread when using VCD tracing (with
--trace-threads 1). For FST tracing --trace-threads can be 1 or 2, and
--trace-fst --trace-threads 1 is the same a what --trace-fst-threads
used to be (which is now deprecated).

Performance numbers on SweRV EH1 CoreMark, clang 6.0.0, Intel i7-3770 @
3.40GHz, IO to ramdisk, with numactl set to schedule threads on different
physical cores. Relative speedup:

--trace     ->  --trace --trace-threads 1      +22%
--trace-fst ->  --trace-fst --trace-threads 1  +38% (as --trace-fst-thread)
--trace-fst ->  --trace-fst --trace-threads 2  +93%

Speed relative to --trace with no threaded tracing:
--trace                                 1.00 x
--trace --trace-threads 1               0.82 x
--trace-fst                             1.79 x
--trace-fst --trace-threads 1           1.23 x
--trace-fst --trace-threads 2           0.87 x

This means FST tracing with 2 extra threads is now faster than single
threaded VCD tracing, and is on par with threaded VCD tracing. You do
pay for it in total compute though as --trace-fst --trace-threads 2 uses
about 240% CPU vs 150% for --trace-fst --trace-threads 1, and 155% for
--trace --trace threads 1. Still for interactive use it should be
helpful with large designs.
2020-04-21 23:49:07 +01:00
James Hanlon 97cbc10925 Add --flaten for use with --xml-only (#2270). 2020-04-21 18:14:08 -04:00
Wilson Snyder 174fd1bf0e Codacy cleanups. No functional change. 2020-04-20 22:01:47 -04:00
Wilson Snyder b12413e42f Tests: Reenable some tests incorrectly marked unsupported. 2020-04-20 21:55:23 -04:00
Wilson Snyder 15f7685755 Codacity cleanups. No functional change intended. 2020-04-20 21:43:05 -04:00
Wilson Snyder fceedd9f4d Tests: Update static test. 2020-04-19 21:18:57 -04:00
Wilson Snyder 4272f2116e Tests: Update static test. 2020-04-19 20:10:07 -04:00
Geza Lore 6a54922044
Set FST timescale correctly. (#2266)
The FST trace timescale used to be set in the constructor via
set_time_unit, but at that point we haven't normally opened the
file yet so it was just dropped. On top of that, we actually want
to use set_time_resolution... FST trace timescales now match the VCD.
2020-04-19 08:47:22 -04:00
Wilson Snyder 466535abdc Support direct class member init. 2020-04-18 20:20:17 -04:00
Geza Lore efacac2e3d
Tests: Ignore SystemC file paths in expected test results (#2265) 2020-04-18 18:56:19 -04:00
Geza Lore 74e16d85c5
Fix FST trace initial time stamp. (#2264)
If the first dump was not at time zero, then the FST trace used
to contain the initial values as if they were set at time zero. Now
they only appear at the time the first dump call is actually made,
and hence match the VCD trace exactly.
2020-04-18 18:54:02 -04:00
Wilson Snyder 39d7cbf412 Fix arrayed instances connecting to slices, #2263. 2020-04-17 19:30:53 -04:00
Wilson Snyder 8f7e463656 Tests: Fix makeflag test, was failing older makes. 2020-04-16 17:31:41 -04:00
Wilson Snyder d4f7f5297a
Support IEEE time units and time precisions, #234. (#2253)
Includes `timescale, $printtimescale, $timeformat.
VL_TIME_MULTIPLIER, VL_TIME_PRECISION, VL_TIME_UNIT have been removed
and the time precision must now match the SystemC time precision.
To get closer behavior to older versions, use e.g. --timescale-override
"1ps/1ps".
2020-04-15 19:39:03 -04:00
Wilson Snyder 58091edd68 Tests: Fix cmake -j unknown 2020-04-15 18:08:31 -04:00
Yutetsu TAKATSUKASA 18412f9322
Add --build option to call make/cmake as subprocess (#2249)
* Add --build, -j, -MAKEFLAGS, and --no-verilate options
* Verilator: Can build on both gmake and cmake
2020-04-15 17:44:21 -04:00
Geza Lore 1a64c7d232
Fix run-time formatting of variable wider than 1023 bits (#2261) 2020-04-15 17:26:15 -04:00
Geza Lore 08b74e5ab9
Fix crash when formatting constant wider than 1023 bits (#2260) 2020-04-14 18:07:09 -04:00
Geza Lore dc5c259069
Improve tracing performance. (#2257)
* Improve tracing performance.

Various tactics used to improve performance of both VCD and FST tracing:
- Both: Change tracing functions to templates to take variable widths as
  template parameters. For VCD, subsequently specialize these to the
  values used by Verilator. This avoids redundant instructions and hard
  to predict branches.
- Both: Check for value changes via direct pointer access into the
  previous signal value buffer. This eliminates a lot of simple pointer
  arithmetic instructions form the tracing code.
- Both: Verilator provides clean input, no need to mask out used bits.
- VCD: pre-compute identifier codes and use memory copy instead of
  re-computing them every time a code is emitted. This saves a lot of
  instructions and hard to predict branches. The added D-cache misses
  are cheaper than the removed branches/instructions.
- VCD: re-write the routines emitting the changes to be more efficient.
- FST: Use previous signal value buffer the same way as the VCD tracing
  code, and only call the FST API when a change is detected.

Performance as measured on SweRV EH1, with the pre-canned CoreMark
benchmark running from DCCM/ICCM, clang 6.0.0, Intel i7-3770 @ 3.40GHz,
and IO to ramdisk:

            +--------------+---------------+----------------------+
            | VCD          | FST           | FST separate thread  |
            | (--trace)    | (--trace-fst) | (--trace-fst-thread) |
------------+-----------------------------------------------------+
Before      |  30.2 s      | 121.1 s       |  69.8 s              |
============+==============+===============+======================+
After       |  24.7 s      |  45.7 s       |  32.4 s              |
------------+--------------+---------------+----------------------+
Speedup     |    22 %      |   256 %       |   215 %              |
------------+--------------+---------------+----------------------+
Rel. to VCD |     1 x      |  1.85 x       |  1.31 x              |
------------+--------------+---------------+----------------------+

In addition, FST trace size for the above reduced by 48%.
2020-04-14 00:13:10 +01:00
Wilson Snyder dba88bae3c Support class new. 2020-04-12 18:57:12 -04:00
Wilson Snyder ea3acc2d3a Fix --skip-identical broke recent commit. 2020-04-11 20:22:57 -04:00
Wilson Snyder 8e6674066f Tests: Clean before rerunning failing test. 2020-04-11 11:40:15 -04:00
Wilson Snyder 15b40a97d9 Support `unconnected_drive 2020-04-09 23:26:03 -04:00
Geza Lore 0cfa828572 Fix DPI import/export to be standard compliant, #2236. 2020-04-07 19:07:47 -04:00
Wilson Snyder b6c21ad21a Fix duplicate traces with $dumpfile, part of #2237. 2020-04-06 08:33:51 -04:00
Wilson Snyder 26301a4133 Commentary 2020-04-06 08:19:32 -04:00
Wilson Snyder 383f9832d4 Tests: Standardize verilog indentation. 2020-04-05 21:53:24 -04:00
Wilson Snyder a331397954 Fix real conversion from constant with X/Z. 2020-04-05 11:56:15 -04:00
Wilson Snyder a494ad5ec7 Support $ferror, #1638. 2020-04-05 11:22:05 -04:00
Wilson Snyder e55338f927 Support $fflush without arguments, #1638. 2020-04-05 10:11:28 -04:00
Wilson Snyder 6eadb8e771 Add simplistic class support with many restrictions, see manual, #377. 2020-04-05 09:30:23 -04:00
Wilson Snyder bf17bb4648 Fix codacity warnings 2020-04-04 20:08:58 -04:00
Wilson Snyder c288a7bfb9 Add GCC10-style line number prefix when showing source text for errors. 2020-04-03 20:07:46 -04:00
Marco Widmer 7f9aa057bf
Support split_var in vit files (#2219) 2020-04-03 08:08:23 -04:00
Wilson Snyder dcde026bac With --Wpedantic, report forward typedefs that are unused. 2020-04-02 07:39:14 -04:00
Wilson Snyder 926209706f Report REALCVT on $display format mistakes. 2020-04-01 20:42:47 -04:00
Wilson Snyder 19abce5535 Suppress REALCVT for whole real numbers. 2020-04-01 18:43:53 -04:00
Wilson Snyder e6beab4037 Fix implicit conversion of floats to wide integers. 2020-03-31 20:42:07 -04:00
Wilson Snyder ebeb645539 Commentary 2020-03-30 20:09:55 -04:00
Wilson Snyder 5c72f01598 Fix assertions with unique case inside, #2199. 2020-03-30 18:13:51 -04:00
Matthew Ballance 510be53521
Expose VPI cbNextDeadline via the public API (#2212)
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2020-03-28 13:47:21 -04:00
Wilson Snyder 4145a38c47 Fix duplicate typedefs in generate for, #2205. 2020-03-26 18:10:20 -04:00
Wilson Snyder 590b1853d0 Fix packages as enum base types, #2202. 2020-03-24 17:57:12 -04:00
Wilson Snyder 1e0e51edd3 Fix parameter type redeclaring a type, #2195. 2020-03-21 12:13:55 -04:00
Wilson Snyder 0ca07e4d58 Tests: Remove t_emit_memb_limit/vltmt as slow 2020-03-21 12:08:38 -04:00
Wilson Snyder 1ce360ed5b Add SPDX license identifiers. No functional change. 2020-03-21 11:24:24 -04:00
Wilson Snyder 5f63b24c50 Change --quiet-exit to also suppress 'Exiting due to N errors'. 2020-03-15 08:09:51 -04:00
Wilson Snyder 81c659957e Add column numbers to errors and warnings. 2020-03-14 22:02:42 -04:00
Wilson Snyder ee8dd32c04 Check and document error format, #2191. 2020-03-14 21:48:26 -04:00
Wilson Snyder 0a755e6ecf Tests: Favor use of expect_filename. No functional change. 2020-03-14 17:42:15 -04:00
Wilson Snyder 135ccf6595 Tests: Fix ormux on travis. 2020-03-08 09:48:13 -04:00
Wilson Snyder 9a2a3f8db7 Tests: Add t_gate_ormux, #2186, #2187. 2020-03-08 09:18:12 -04:00
Wilson Snyder 8ccc17f30b Add setting VM_PARALLEL_BUILDS=1 when using --output-split, #2185. 2020-03-08 09:03:29 -04:00
Wilson Snyder 6c6d70a5e5 Fix FST when multi-model tracing. 2020-03-07 18:39:58 -05:00
Wilson Snyder 6f49f802b1 Tests: Add fst_identical. 2020-03-07 16:59:46 -05:00
Wilson Snyder e70cba77e6 Add support for dynamic arrays, #379. 2020-03-07 10:24:27 -05:00
Wilson Snyder 135cbcd79a Internals: Move 'new' unsupported forward from parse into Ast. 2020-03-05 22:33:31 -05:00
Wilson Snyder 75ecad591a Implement $displayb/o/h, $writeb/o/h, etc, Closes #1637. 2020-03-05 21:49:25 -05:00
Wilson Snyder 30a33a6104 Add support for and , #2126. 2020-03-01 21:39:23 -05:00
Wilson Snyder 0ca0e07354 Internals: Vcd doesn't need code when registering. No functional change intended. 2020-02-29 20:42:52 -05:00
Wilson Snyder aac02acf92 Tests: Rename 2020-02-29 10:06:52 -05:00
Wilson Snyder 082c9e0b1d Tests: Add two-design trace tests. 2020-02-29 09:44:51 -05:00
Wilson Snyder a7bd934fe3 Tests: Cleanup false used as 0. No functional change. 2020-02-29 08:56:49 -05:00
David Stanford e98a380b44
Tests: Update some tests to skip if prerequisites aren't installed (#2181) 2020-02-29 07:20:23 -05:00
Wilson Snyder 4878fe3a1f Add split_var metacomment to assist UNOPTFLAT fixes, #2066. 2020-02-28 19:15:08 -05:00
Wilson Snyder 68b6a0b667 Fix genblk naming with directly nested generate blocks, #2176. 2020-02-25 22:21:16 -05:00
Wilson Snyder 93ac79981b Tests: Rename t_var_dotted. No functional change. 2020-02-24 18:51:44 -05:00
Todd Strader 60f82961b4 De-tabify 2020-02-24 06:36:13 -05:00
Todd Strader f7d1c6ca72 emacs verilog-batch-indent 2020-02-24 06:36:13 -05:00
Todd Strader 4b4f10f5e6 Follow other clock gating examples 2020-02-24 06:36:13 -05:00
Todd Strader 120f62fe85 Fix is probably to mark as a clock 2020-02-24 06:36:13 -05:00
Todd Strader db6ecbd57e Test for #2169 2020-02-24 06:36:13 -05:00
Wilson Snyder 28e19cef90 Fix undeclared VL_SHIFTR_WWQ, #2114. 2020-02-23 19:33:37 -05:00
Tobias Wölfel 18f8cd0529
Allow assert disable (#2168)
* Add +verilator+noassert flag

This allows to disable the assert check per simulation argument.

* Add AssertOn check for assert

Insert the check AssertOn to allow disabling of asserts.
Asserts can be disabled by not using the `--assert` flag or by calling
`AssertOn(false)`, or passing the "+verilator+noassert" runtime flag.
Add tests for this behavior.
Bad tests check that the assert still causes a stop.
Non bad tests check that asserts are properly disabled and cause no stop
of the simulation.

Fixes #2162.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>

* Correct file location

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>

* Add description for single test execution

Without this description it is not obvious how to run a single test from
the regression test suite.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
2020-02-15 18:17:23 -06:00
Wilson Snyder 0d6ebf21b3 Suggest svSetScope, #2152. 2020-02-07 17:59:02 -05:00
Todd Strader 77f1b3eef4 Support parameter access from arrays of interfaces, #2155. 2020-02-06 19:19:23 -05:00
Wilson Snyder 2576c136f6 Fix `pragma pedantic check to work with -E. 2020-02-01 22:03:18 -05:00
Yutetsu TAKATSUKASA 50fb7fc8b4
Tests: Resolve self assignment in t_unoptflat_simple_2, Closes #2149. 2020-02-01 19:07:02 -05:00
Wilson Snyder 2d195ebae5 Cleanup IEEE references. 2020-01-30 20:23:57 -05:00
Wilson Snyder d218f1746c Add warning on genvar in normal for loop, #2143. 2020-01-29 21:16:44 -05:00
Yutetsu TAKATSUKASA 8d8eb1b9f3
Tests: Resolve racing among initial blocks in t_display_signed.v, #2144. 2020-01-29 17:07:45 -05:00
Wilson Snyder d4614c290e Fix WIDTH warning on </<= of narrower value, #2141. 2020-01-28 20:10:10 -05:00
Tobias Rosenkranz 027cce35c0 Support enum.next(k) with constant k > 1, #2125. 2020-01-27 17:25:25 -05:00
Wilson Snyder 9fd81b2c6b Support string character access via indexing. 2020-01-26 16:38:22 -05:00
Wilson Snyder 5430e4ac9b Cleanup more errors showing data types. 2020-01-26 15:54:57 -05:00
Wilson Snyder 619214b48f Support $sampled. 2020-01-26 13:38:15 -05:00
Wilson Snyder 68fa82fb14 Support $typename, and use to cleanup error messages. 2020-01-26 13:21:25 -05:00
Wilson Snyder cac50282eb Fix pattern replication without key. 2020-01-26 11:38:34 -05:00
Wilson Snyder b50ef9ff39 Tests: Disabled test for 5.9. 2020-01-26 11:23:52 -05:00
Wilson Snyder 8a8f1135b7 Support type(expression) operator, #1650. 2020-01-26 10:28:13 -05:00
Wilson Snyder a4e8d39932 Spelling fixes 2020-01-24 20:10:44 -05:00
Wilson Snyder 8f0e8e0696 Fix FST tracing of enums inside structs. 2020-01-24 19:46:46 -05:00
Pieter Kapsenberg 957c1d606b Add detailed XML location to cell elements, #2134, #2122.
This was accidentally omitted from the previous PR #2122.
2020-01-22 07:18:50 -05:00
Stefan Wallentowitz 22088c907f
Set maximum number width (#2128)
Adjust the maximum number width to 64K. Add --max-num-width option to
adjust this setting.

Closes #2082
2020-01-21 12:17:31 +01:00
Pieter Kapsenberg 4a122fd0f2 Add detailed location to XML output (#2122)
* Add detailed location to XML output

* Fixing build failures

* less cryptic regulary expressions

* correcting typo in test

* Adding file letter to the location attribute, and cleaning up the regular expression in the tests.

* Add remaining test expected output files for XML changes

* spacing fix, adding documentation on changes
2020-01-20 14:08:13 -05:00
Wilson Snyder 7024ea8cb6 Cleaner tristate error. #2117. 2020-01-18 07:56:50 -05:00
Wilson Snyder 623c4ec103 Internals: Create VL_DO_DANGLING. No functional change intended. 2020-01-16 20:17:11 -05:00
Pieter Kapsenberg 4443ab34fd Support left justified . Closes #2101. 2020-01-15 07:32:45 -05:00
Wilson Snyder 81e8127168 Add parameter values in XML. #2110. 2020-01-14 18:51:20 -05:00
Wilson Snyder 47803c3591 Tests: Better message for contributors. 2020-01-14 17:49:04 -05:00
Wilson Snyder af38e8d387 Improve error on > 127 char modnames. #2106. 2020-01-14 07:33:12 -05:00
Wilson Snyder 918df2e618 Support / with assoc arrarys. Closes #2100. 2020-01-14 07:01:17 -05:00
Wilson Snyder 7bed17b14b Fix clang warning 2020-01-13 19:01:30 -05:00
Stefan Wallentowitz fad465abf1
Add lint_off -match waivers (#2102)
* Add more directives to configuration files

Allow to set the same directives in configuration files that can also
be set by comment attributes (such as /* verilator public */ etc).

* Add support for lint messsage waivers

Add configuration file switch '-match' for lint_off. It takes a string
with wildcards allowed and warnings will be matched against it (if
rule and file also match). If it matches, the warning is waived.

Fixes #1649 and #1514 
Closes #2072
2020-01-12 10:03:17 +01:00
Wilson Snyder fe94f9891b Add error on misused define. 2020-01-11 09:16:26 -05:00
Wilson Snyder 2638f9db19 Error cleanups. 2020-01-10 19:18:27 -05:00
Wilson Snyder 16bb97687a Tests: Check for missing newlines at EOF. 2020-01-10 18:49:23 -05:00
Wilson Snyder a2911ed933 Fix shebang breaking some shells. Closes #2067. 2020-01-09 20:01:12 -05:00
Wilson Snyder 2a50fafef2 Fix %{number}s with strings. #2093. 2020-01-09 19:39:27 -05:00
Wilson Snyder 06247686c5 Codacy cleanups 2020-01-08 19:33:47 -05:00
Wilson Snyder 9978cbfa5c Fix tracing -1 index arrays. Closes #2090. 2020-01-08 07:32:31 -05:00
Stefan Wallentowitz 37dc33a195
Deprecation (#2088)
* Add deprecation warning

* Deprecate -msg in configuration files

* Deprecate sc_clock
2020-01-03 17:27:51 +01:00
Stefan Wallentowitz 924fe235a9
No assign alias for unpacked public variables (#2089)
Public variables are all emitted in the C code and unpacked arrays
arrays are sliced up for this. After inlining public unpacked array
assignments should not be alias assignments but actual assignments, so
that they are sliced and hence emitted properly.

Fixes #2073
2020-01-03 13:44:45 +01:00
Stefan Wallentowitz b7665a88db
Rename msg to rule in configuration files (#2080)
Rename the -msg switch to -rule in configuration files as it is more
clear.

resolves #2068
2019-12-30 19:15:43 +01:00
Wilson Snyder a0d391d695 Tests: Less aggressive contributors check. 2019-12-23 19:01:29 -05:00
Wilson Snyder f23a7bfdd7 Tests: Check for carriage returns 2019-12-23 17:34:43 -05:00
Peter Monsson 9b998cf6b3 Support implication operator "|->" in assertions, #2069.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-23 16:49:18 -05:00
Wilson Snyder 4afde8b478 Test class parsing (intended as part of last commit). 2019-12-23 15:18:55 -05:00
Wilson Snyder 2cbfe99ad5 Parse all class constructs, as still unsupported. 2019-12-23 15:03:04 -05:00
Peter Monsson ea979c8f83 Fix disable iff in assertions. Closes #1404.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-22 15:49:10 -05:00
Stefan Wallentowitz 9a54b2144b Fix queue issues, bug1643.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-18 18:17:18 -05:00
Stefan Wallentowitz d738501c01 Fix queues as statements, bug1641. 2019-12-17 06:08:41 -05:00
Wilson Snyder f514049c04 Add cleaner error on version control conflicts in sources. 2019-12-16 21:54:20 -05:00
Wilson Snyder 83a1bd0675 Support immediate cover statements & refactor coverage internals. 2019-12-16 21:44:20 -05:00
Yutetsu TAKATSUKASA 8cdc0c4e00 Support string putc, getc, substr, bug1606.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-15 08:09:52 -05:00
Wilson Snyder 460e0541f3 Add error when `resetall inside module 2019-12-14 22:04:58 -05:00
Wilson Snyder 2408de16a0 Support bounded queues. 2019-12-14 21:39:47 -05:00
Wilson Snyder 2a1c57ada6 With -Wpedentic, warn about bad `pragma 2019-12-14 10:13:38 -05:00
Stefan Wallentowitz 3ac6745658 Add vpiTimeUnit and allow to specify time as string, bug1636.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-13 19:11:37 -05:00
Wilson Snyder 39950d16d0 Ignore `uselib to end-of-line, bug1634. 2019-12-12 20:57:48 -05:00
Wilson Snyder 6046b06b17 Tests: Fix no-email contributors. 2019-12-11 18:56:10 -05:00
Julien Margetts f7a06cb54a Fix little endian cell ranges, bug1631.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-11 17:15:45 -05:00
Yutetsu TAKATSUKASA c2037ddbc5 Support string compare, icompare, ato* methods, bug1606.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-09 19:17:52 -05:00
Wilson Snyder ca1b083d5c Fix clang warning. 2019-12-09 18:53:56 -05:00
Wilson Snyder bd0eadb311 Fix handling user-botch of %d to print real. 2019-12-08 22:48:44 -05:00
Wilson Snyder 62b0d15d2e Add lint check for bad enum 4-state values. 2019-12-08 22:26:54 -05:00
Wilson Snyder 700f2072c0 Framework for WDatas being vectors of 64-bit EDatas, but not supporting this at this time. 2019-12-08 21:36:38 -05:00
Wilson Snyder cda5c53cf9 Add BOUNDED warning and promote bounded queues to unbounded. 2019-12-08 15:56:49 -05:00
Wilson Snyder 81fc1d48a6 Fix gate lvalue optimization error, bug831. 2019-12-07 16:49:11 -05:00
Wilson Snyder 10a6b566ef Fix error on unpacked concatenations, bug1627. 2019-12-07 15:53:34 -05:00
Driss Hafdi cff5485821 Tests: Unsupported test for bug1627.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-07 13:46:50 -05:00
Driss Hafdi dcbdac1b81 Tests: Unsupported test for bug1626.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-07 13:46:29 -05:00
Driss Hafdi a59777aa75 Tests: Unsupported test for bug1624.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-07 13:15:46 -05:00
Driss Hafdi d82b9128d0 Tests: Unsupported test for bug1623.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-07 12:59:00 -05:00
Driss Hafdi ab4f18c892 Tests: Unsupported test for bug1622.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-07 12:59:00 -05:00
Todd Strader 4480938b25 Fix interface reference tracing, bug1595. 2019-12-07 12:28:19 -05:00
Driss Hafdi 11a1b201a9 Tests: Unsupported on parameters in functions, bug1624. 2019-12-06 18:51:39 -05:00
Wilson Snyder 5c6d74cd80 Fix assertion on dotted parameter arrayed function, bug1620. 2019-12-04 19:25:45 -05:00
Wilson Snyder fe684e8733 Allow redefining VL_PRINTF, bug1598. 2019-12-03 19:12:18 -05:00
Garrett Smith 96f8bbd023 Support float and shorts, bug1592, bug1619.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-12-03 18:26:22 -05:00
Wilson Snyder ac4f0da9ee Tests: Add output wire check. 2019-12-02 20:38:43 -05:00
Wilson Snyder 559852f60b Add error when number missing value. 2019-12-02 20:21:24 -05:00
Wilson Snyder b0669f3aca Fix false unused message on __Vemumtab, msg3180. 2019-12-02 19:03:33 -05:00
Todd Strader 00979ede14 Fix overly aggressive --protect-lib check 2019-12-02 08:33:44 -05:00
Wilson Snyder 2076b0219d Fix labels on functions with returns, bug1614. 2019-12-01 17:19:03 -05:00
Wilson Snyder e28175108f Support queues (excluding {} notation and pattern assignments), bug545. 2019-12-01 12:35:49 -05:00
Wilson Snyder b81295230a Support associative arrays. 2019-12-01 11:52:48 -05:00
Wilson Snyder 3d6e8e9eb0 Add -Wno-context.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-11-23 10:40:32 -05:00
Wilson Snyder df192f2b61 Support / with warning. 2019-11-23 09:16:06 -05:00
Wilson Snyder 17ad59394f Support shortreal as real, with a SHORTREAL warning. 2019-11-23 08:34:40 -05:00
Wilson Snyder 682c2a610f Fix $display("%p") to be closer to IEEE. 2019-11-21 19:29:46 -05:00
Wilson Snyder 59782266b9 Tests: Fix uninitalized data in t_vpi_time tests, bug1612. 2019-11-21 18:42:40 -05:00
Wilson Snyder 99455a16bf Fix // in filenames, bug1610. 2019-11-20 21:23:03 -05:00
Wilson Snyder a86e1953eb Tests: Fix object order dependence, bug1611. 2019-11-20 06:57:39 -05:00
Matthew Ballance f63dfd7028 Fix VPI timed callbacks to be one-shot, pull5.
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-11-19 22:44:33 -05:00
Wilson Snyder 0f6b625db8 Fix hang on concat error, bug1608. 2019-11-19 19:23:40 -05:00
Wilson Snyder 2ff22d9050 Fix earlier +verilated+error+count to do all . 2019-11-17 08:12:39 -05:00
Wilson Snyder 0c0198cf55 Support string.toupper and string.tolower. 2019-11-17 05:05:09 -05:00
Wilson Snyder d480c2f033 Add +verilator+error+limit to see more assertion errors. 2019-11-16 18:25:47 -05:00
Wilson Snyder 8ebe86e54b Fix color assertion on empty if, bug1604. 2019-11-16 17:23:51 -05:00
Wilson Snyder 3eb0ff8aa0 Detect wrong number of args on method calls. 2019-11-16 15:18:57 -05:00
Wilson Snyder c36d9a68f5 Support $ungetc. 2019-11-16 12:55:10 -05:00
Wilson Snyder 8c5aa21a11 Support $rewind. 2019-11-16 12:21:35 -05:00
Wilson Snyder 47b5e36e60 Add -Wpedantic for compliance testing. 2019-11-16 11:59:21 -05:00
Wilson Snyder a481638edb Add error on redefining preprocessor directives. 2019-11-16 10:19:43 -05:00