Commit Graph

3364 Commits

Author SHA1 Message Date
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
9b8aebb00c Commentary on --build 2020-04-15 18:08:37 -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
Wilson Snyder
1883ab29cb clang-format 10.0 forward compatibility. No functional change. 2020-04-15 17:36:57 -04:00
Geza Lore
1a64c7d232
Fix run-time formatting of variable wider than 1023 bits (#2261) 2020-04-15 17:26:15 -04:00
Wilson Snyder
f3308d236b clang-format remaining sources. No functional change. 2020-04-15 07:58:34 -04:00
Wilson Snyder
1b94e3b0e2 Internals: clang-format files needed for #2249. 2020-04-14 19:55:00 -04:00
Geza Lore
08b74e5ab9
Fix crash when formatting constant wider than 1023 bits (#2260) 2020-04-14 18:07:09 -04:00
Wilson Snyder
5c966ec510 clang-format many files. No functional change.
Use nodist/clang_formatter to reformat files that are now clean.
2020-04-13 22:52:23 -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
dc27a179e2 Always define VL_SIG etc; conditional definitions were long removed SystemPerl. 2020-04-13 19:07:56 -04:00
Wilson Snyder
236e6baa76 clang-format: Loops allowed on single line. 2020-04-13 17:44:19 -04:00
Wilson Snyder
dba88bae3c Support class new. 2020-04-12 18:57:12 -04:00
Wilson Snyder
d4b6e2b2b5 Internals: NodeModule for packages. 2020-04-12 14:53:10 -04:00
Wilson Snyder
1e2d73fc80 Internals: clang-format and refactor taskref pin handling. 2020-04-12 08:26:14 -04:00
Wilson Snyder
ea3acc2d3a Fix --skip-identical broke recent commit. 2020-04-11 20:22:57 -04:00
Nathan Kohagen
152505e879 Fix make install/uninstall for examples/xml_py, #2252. 2020-04-11 18:11:53 -04:00
Wilson Snyder
8e6674066f Tests: Clean before rerunning failing test. 2020-04-11 11:40:15 -04:00
Geza Lore
8b2666cd04
Fix to make trace code allocation dense. (#2250)
This looks like a bits/bytes bug. The affected m_codeInc member
determines how many 32-bit words to allocate in a buffer used to store
previous values of the signal, but this was off by a factor of 8, so
we used to use too much memory.

SweRV VCD tracing speed +6.5% (excluding IO, clang 6.0), due mainly to
reduced D cache misses.
2020-04-11 16:00:43 +01:00
Wilson Snyder
afa8e4c786 Internals: Favor const_iterator. No functional change. 2020-04-11 10:54:42 -04:00
Wilson Snyder
ef211fc9e0 Make sure SystemC always included in -sc mode to prevent ordering issues. 2020-04-11 10:33:40 -04:00
Wilson Snyder
1a6c2fc55d Fix class members getting misoptimized away. 2020-04-10 21:10:21 -04:00
Wilson Snyder
15b40a97d9 Support `unconnected_drive 2020-04-09 23:26:03 -04:00
Wilson Snyder
343db78c03 Fix including verilated_sc in Syms to fix compile order problem exposed in #2237. 2020-04-09 23:03:47 -04:00
Nathan Myers
4c1ae4701a
Add assertion for monotonic dump times #2103 (#2237) 2020-04-09 19:00:27 -04:00
Geza Lore
05f213c266
VCD tracing speed improvements (#2246)
* Don't inline VCD dump functions

Improves model speed with tracing. Measured on SweRW cmark:
- GCC 5.5      ~3% faster
- Clang 6.0    ~12% faster (!)

* Remove redundant test from VCD bit tracing.

Improves model speed with tracing. Measured on SweRW cmark:
 - GCC 5.5      ~7.5% faster
 - Clang 6.0    ~1.5% faster
2020-04-09 08:19:26 -04:00
Geza Lore
0f617988d4
Compile fast tracing code with OPT_FAST in single compile mode. (#2245)
When using the __ALL*.cpp based single compile mode (i.e.: without
VM_PARALLEL_BUILDS), the fast path tracing code used to be included in
__Allsup.cpp, which was compiled with OPT_SLOW, severely harming tracing
performance. We now have __ALLfast.cpp and __ALLslow.cpp instead of
__ALLcls.cpp and __ALLsup.cpp, so we can compile the fast support code
with OPT_FAST as well.
2020-04-08 21:05:43 -04:00
Wilson Snyder
1e0b37f4bc Commentary 2020-04-08 17:55:12 -04:00
Geza Lore
991d8b178b
Fix FST tracing performance by removing std::map from hot path. (#2244)
This patch eliminates a major piece of inefficiency in FST tracing
support, by using an array to lookup fstHandle values corresponding
to trace codes, instead of a tree based std::map. With this change, FST
tracing is now only about 3x slower than VCD tracing. We do require
more memory to store the symbol lookup table, but the size of that is
still small, for the speed benefit.
2020-04-08 17:54:35 -04:00
Wilson Snyder
608d5a87d1 tests: Avoid assuming a timescale. 2020-04-07 20:55:47 -04:00
Wilson Snyder
914a6edd33 Add error if use SystemC 2.2 and earlier (pre-2011) as is deprecated. 2020-04-07 19:58:17 -04:00
Geza Lore
0cfa828572 Fix DPI import/export to be standard compliant, #2236. 2020-04-07 19:07:47 -04:00
Wilson Snyder
4556b6c022 Fix clang warning. 2020-04-07 12:17:48 -04:00
Wilson Snyder
cba05480ba Fix clang warning. 2020-04-06 20:13:24 -04:00
Wilson Snyder
2abbae8dd0 Internals: Remove strncpy to appease codacity. 2020-04-06 19:26:31 -04:00
Wilson Snyder
f13bd1aec4 Fix clang unused warning. 2020-04-06 08:53:19 -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
50535a1894 Internals: cppcheck 1.90 fixes. No functional change intended. 2020-04-05 18:57:47 -04:00
Wilson Snyder
ff31abe341 Commenary 2020-04-05 17:01:33 -04:00
Wilson Snyder
763f621d4c Deprecate VL_ULL. 2020-04-05 16:45:53 -04:00
Wilson Snyder
d922cae0a2 Commentary 2020-04-05 16:13:41 -04:00
Wilson Snyder
efaf375887 Configuring with ccache present now defaults to using it; see OBJCACHE in the manual. 2020-04-05 16:10:33 -04:00
Wilson Snyder
5932eae32a Commentary 2020-04-05 16:09:18 -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
b617cd5549 Internals: Add V3ERROR_NA_RETURN. No functional change. 2020-04-05 10:26:53 -04:00
Wilson Snyder
e55338f927 Support $fflush without arguments, #1638. 2020-04-05 10:11:28 -04:00