Commit Graph

2065 Commits

Author SHA1 Message Date
Wilson Snyder
cff37f0775 Add GENUNNAMED lint warning.
Also fix generate-for blocks with empty statements getting lost.
2023-07-01 08:31:53 -04:00
Wilson Snyder
8b1cc3b303 Commentary: Changes update 2023-07-01 07:35:58 -04:00
Wilson Snyder
63b2dbb827 Fix error when multiple duplicate DPI exports (#4301). 2023-06-20 06:26:46 -04:00
Wilson Snyder
e7de3d368f Commentary: Deprecation planned for 32-bit pointer -m32 mode (#4268). 2023-06-17 08:44:13 -04:00
Wilson Snyder
9dbc669199 devel release 2023-06-13 19:39:50 -04:00
Wilson Snyder
7d2d32420a Version bump 2023-06-13 19:31:57 -04:00
Wilson Snyder
e08bbcdb07 Commentary 2023-06-12 21:59:52 -04:00
Wilson Snyder
2488af9066 Commentary: Changes update 2023-06-12 20:38:33 -04:00
Wilson Snyder
e9135598b3 Fix method calls on function return values. 2023-05-29 18:51:27 -04:00
Wilson Snyder
7f12ad9d91 Commentary: Changes update 2023-05-27 07:17:37 -04:00
Wilson Snyder
5efe9367d2 Fix SystemC signal copy macro use (#4135). 2023-05-27 07:00:26 -04:00
Wilson Snyder
426069a4dd Configure for faster C++ linking using 'mold', if it is installed. 2023-05-23 21:26:29 -04:00
Wilson Snyder
5982528274 Fix duplicate std:: declaration with -I (#4215). 2023-05-22 20:32:20 -04:00
Wilson Snyder
d269fbb446 Add creating __inputs.vpp file with --debug (#4177). 2023-05-07 17:58:14 -04:00
Wilson Snyder
444020f7c7 Fix super.new missing data type (#4147). 2023-05-07 16:47:34 -04:00
Wilson Snyder
e6f5a0495f Fix $fscanf of decimals overflowing variables (#4174). 2023-05-07 08:25:10 -04:00
Wilson Snyder
0606a29f13 Fix arrays of unpacked structs (#4173). 2023-05-06 21:41:17 -04:00
Wilson Snyder
4bb876aee5 Fix false IMPLICITSTATIC on package functions. 2023-05-06 19:48:22 -04:00
Wilson Snyder
a3640c1767 Support get_randstate/set_randstate class method function. 2023-05-06 19:09:19 -04:00
Wilson Snyder
fdea386727 Fix false WIDTHEXPAND on array declarations (#3959). 2023-05-05 22:05:19 -04:00
Wilson Snyder
28944ed862 Fix crash on duplicate imported modules (#3231). 2023-05-05 20:31:48 -04:00
Wilson Snyder
3250ee5707 Commentary: Changes update 2023-05-05 20:24:45 -04:00
Wilson Snyder
3e986517c3 devel release 2023-04-30 07:10:14 -04:00
Wilson Snyder
5d3a9eec7f Version bump 2023-04-30 07:08:27 -04:00
Wilson Snyder
e15f5266a3 Commentary: Changes update 2023-04-29 22:16:53 -04:00
Risto Pejašinović
f794180865
Fix hier attribute of --xml-only cell section to respect begin blocks (#4129) (#4133)
Co-authored-by: Risto Pejasinovic <risto.pejasinovic@cern.ch>
2023-04-24 07:28:29 -04:00
Geza Lore
0e769d42a1 Optimize trigger evaluation
Pack the elements of VlTriggerVec as dense bits (instead of a 1 byte
bool per bit), and check whether they are set on a word granularity.
This effectively transforms conditions of the form `if (trig.at(0) |
trig.at(2) | trig.at(64))` into `if (trig.word(0) & 0x5 | trig.word(1) &
0x1)`. This improves OpenTitan ST by about 1%, worth more on some other
designs.
2023-04-24 09:09:36 +02:00
Wilson Snyder
cbeb9d39ff Fix -CFLAGS to allow overriding optimization levels (#4140). 2023-04-23 10:18:48 -04:00
Geza Lore
cac634d39b
Fix DfgToAst conversion of CountBits (#4101) (#4143) 2023-04-23 08:49:44 -04:00
Wilson Snyder
0307d59c1f Fix unpacked structs under classes (#4102). 2023-04-10 19:40:34 -04:00
Wilson Snyder
2ab34b5eeb Fix false error on new const assignment (#4098). 2023-04-09 19:46:47 -04:00
Wilson Snyder
d67d75282c Support ++/-- on dotted member variables. 2023-04-07 20:57:17 -04:00
Wilson Snyder
38000a3da0 Fix unnecessary verilated_std.sv waivers in --waiver-output. 2023-04-06 21:43:23 -04:00
Wilson Snyder
05660d1118 Add CONSTRAINTIGN warning when constraint ignored. Likewise ignore constraint_mode, rand_mode. 2023-04-05 21:27:37 -04:00
Wilson Snyder
69121633cf Support class srandom and class random stability. 2023-04-01 10:50:27 -04:00
Wilson Snyder
947402bc57 Fix interface generate begin (#4065). 2023-03-26 08:49:38 -04:00
Wilson Snyder
577e0700ba Commentary: Changes update 2023-03-21 04:52:12 -04:00
Jesse Taube
daf157e6c0
Fix false LATCH warning on --assert 'unique else if' (#4033) (#4054). 2023-03-21 04:42:19 -04:00
Wilson Snyder
2b21697b86 Support class extends of package::class. 2023-03-18 17:26:36 -04:00
Wilson Snyder
5f02f95ce6 Commentary (#3906) (#3931) 2023-03-18 15:49:11 -04:00
Wilson Snyder
d60a3e2b66 Fix random internal crashes (#666).
Internally, in V3Broken check m_interpp for null, and make several cleanups
in the addNext/addNextHere/unlinkFr* methods.
2023-03-18 09:48:26 -04:00
Wilson Snyder
ed1e377bb1 Fix large return blocks with --comp-limit-blocks (#4028). 2023-03-16 21:40:01 -04:00
Wilson Snyder
51ba4a1531 Fix clocking block scope internal error (#4032). 2023-03-16 20:48:18 -04:00
Wilson Snyder
8f4d4f07a4 Commentary 2023-03-16 07:09:16 -04:00
Wilson Snyder
8ae79066a2 Fix false ENUMVALUE on expressions and arrays. 2023-03-15 21:56:35 -04:00
Wilson Snyder
a8ce272e4a Commentary: spelling 2023-03-14 08:39:54 -04:00
Wilson Snyder
2c62714a30 Fix push to dynamic queue in struct (#4015). 2023-03-13 22:03:53 -04:00
Wilson Snyder
f13e753b52 Change ZERODLY to a warning. 2023-03-12 21:28:14 -04:00
Wilson Snyder
ba953bfa94 Commentary: Changes update 2023-03-12 10:49:19 -04:00
Wilson Snyder
1debd0405b Support complicated IEEE 'for' assignments. 2023-03-12 10:46:40 -04:00
Wilson Snyder
259201b352 Support $fopen as an expression 2023-03-11 18:11:01 -05:00
Wilson Snyder
a1d4cd658e devel release 2023-03-04 11:31:58 -05:00
Wilson Snyder
21093fd1bd Version bump 2023-03-04 11:19:44 -05:00
Wilson Snyder
ab502c5196 Fix coverage of class methods (#3998). 2023-03-03 19:26:15 -05:00
Felix Neumärker
12728bc478 Fix UNDRIVEN warning seg fault (#3989) 2023-03-03 18:54:38 -05:00
Wilson Snyder
a85e6a9d8c Commentary: Changes update 2023-03-01 22:43:39 -05:00
Wilson Snyder
326a60d307 Add error on mixing .name and by-port instantiations. 2023-03-01 21:19:21 -05:00
Wilson Snyder
b1a95f642f Support cast to numbers from strings. 2023-02-28 23:34:33 -05:00
Wilson Snyder
c03affa544 Fix enum.next(0) and enum.prev(0). 2023-02-26 15:24:24 -05:00
Wilson Snyder
7559af5879 Fix missing error on negative replicate (#3963). 2023-02-22 19:11:02 -05:00
Wilson Snyder
026bbc306b Removed deprecated --cdc option. 2023-02-13 22:49:51 -05:00
Wilson Snyder
f8b0e359b9 Support class parameters without initial values. 2023-02-13 22:06:52 -05:00
Wilson Snyder
50929e5d43 Fix packed array structure replication. 2023-02-13 07:49:08 -05:00
Wilson Snyder
5064ec2806 Support type case and type equality comparisons. 2023-02-12 20:09:10 -05:00
Wilson Snyder
10d0088f73 Fix generate case with empty body statements. 2023-02-12 18:14:18 -05:00
Wilson Snyder
15d0ec317d Fix lint for non-integral types in packed structs. 2023-02-12 16:32:36 -05:00
Wilson Snyder
2bb2935924 Commentary: Changes update 2023-02-11 10:38:00 -05:00
Wilson Snyder
b778784333 Add --annotate-points option, change multipoint on line reporting (#3876). 2023-02-08 20:22:54 -05:00
Wilson Snyder
cf88700fc2 Fix virus detection false positive (#3944). 2023-02-08 18:44:07 -05:00
Wilson Snyder
1607225063 Fix VPI upper interface scopes not found (#3937). 2023-02-05 16:16:39 -05:00
Wilson Snyder
f6d4f1ad02 Fix very long VPI signal names (#3929). 2023-02-02 19:10:23 -05:00
Wilson Snyder
ef9f443532 Fix single-element replication to dynarray/unpacked/queue (#3548). 2023-01-31 22:43:41 -05:00
Wilson Snyder
aea1834ed8 Commentary (#3920) 2023-01-31 12:11:35 -05:00
Wilson Snyder
6a12c4d02a Commentary: Changes update 2023-01-29 16:57:30 -05:00
Wilson Snyder
6a7dfb7696 Fix pattern assignment to unpacked structs (#3510). 2023-01-29 16:50:10 -05:00
Wilson Snyder
a19dddf05e Fix real parameters of infinity and NaN. 2023-01-28 22:11:09 -05:00
Wilson Snyder
248bd173d3 Support interface classes and class implements. 2023-01-28 18:06:37 -05:00
Wilson Snyder
f20997a2f0 Support global clocking and $global_clock. 2023-01-28 12:31:52 -05:00
Wilson Snyder
93517b8378 Support unpacked unions. 2023-01-27 22:41:12 -05:00
Wilson Snyder
665758a68b devel release 2023-01-22 11:55:22 -05:00
Wilson Snyder
5b8941d717 Version bump 2023-01-22 11:52:21 -05:00
Wilson Snyder
5cd3d831bb Commentary: Changes update 2023-01-22 08:59:06 -05:00
Wilson Snyder
c2bdd06fcc Fix VPI one-time timed callbacks (#2778). 2023-01-21 13:43:27 -05:00
Wilson Snyder
e94023367f Fix elaboration of member selected classes (#3890). 2023-01-19 17:44:27 -05:00
Wilson Snyder
035bf13e4a Fix foreach unnamedblk duplicate error (#3885). 2023-01-18 21:48:06 -05:00
Wilson Snyder
5fce23e90d Fix empty case items crash (#3851). 2023-01-10 07:18:12 -05:00
Wilson Snyder
30f6831be6 Commentary: Changes update 2023-01-07 14:54:12 -05:00
Wilson Snyder
b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Wilson Snyder
3ccb2e0f2d Fix initiation of function variables (#3815). 2022-12-23 10:51:52 -05:00
Wilson Snyder
71d29a235f Commentary: Changes update 2022-12-20 19:51:17 -05:00
Wilson Snyder
bae60ab8ea devel release 2022-12-14 22:08:39 -05:00
Wilson Snyder
4cefccf5d2 Version bump 2022-12-14 21:59:58 -05:00
Wilson Snyder
01b521a0ea Commentary: Changes update 2022-12-11 15:10:23 -05:00
Wilson Snyder
afc66f6a85 Fix make jobserver with submakes (#3758). 2022-12-11 14:19:40 -05:00
Wilson Snyder
722e38f532 Commentary, part of last commit (#3783) 2022-12-11 13:30:00 -05:00
Wilson Snyder
3f4d4dec77 Fix ENUMVALUE on typedef (#3777) 2022-12-11 11:50:22 -05:00
Wilson Snyder
a0e7930036 docs: Fix spelling 2022-12-09 22:39:41 -05:00
Wilson Snyder
e465a30eee Fix lint_off EOFNEWLINE in .vlt files (#3796). 2022-12-01 18:27:36 -05:00
Wilson Snyder
d87ef8394a Fix CASEINCOMPLETE when covers all enum values (#3745) (#3782).
Co-authored-by: "G-A. Kamendje" <gkamendje@gmail.com>
2022-11-30 19:42:21 -05:00
Wilson Snyder
8ff607f679 Deprecate verilated_fst_sc.cpp and verilated_vcd_sc.cpp (#3507) 2022-11-29 22:17:50 -05:00
Wilson Snyder
f4be3d5d2b Fix empty string literals converting to string types (#3774). 2022-11-27 13:28:57 -05:00
Wilson Snyder
aacb38b776 Support assignment expressions. 2022-11-19 15:23:37 -05:00
Wilson Snyder
3c77c7bb92 Support and 2022-11-16 21:10:54 -05:00
Wilson Snyder
c6ecd60993 Support pre_randomize and post_randomize. 2022-11-13 11:59:40 -05:00
Wilson Snyder
d25834e57b Add ENUMVALUE warning when value misused for enum (#726). 2022-11-12 20:11:05 -05:00
Wilson Snyder
0a045a7bf6 Change ENDLABEL from warning into an error. 2022-11-12 12:09:48 -05:00
Wilson Snyder
a427860825 Support randcase. 2022-11-11 21:53:05 -05:00
Wilson Snyder
227e61f891 Fix comparing ranged slices of unpacked arrays. 2022-11-11 18:01:30 -05:00
Wilson Snyder
9d7c4d9af3 Fix wait 0. 2022-11-11 17:18:59 -05:00
Wilson Snyder
16586d1d37 Fix tracing parameters overridden with -G (#3723). 2022-11-10 20:30:10 -05:00
Wilson Snyder
e64295e92b Fix missing UNUSED warnings with --coverage (#3736). 2022-11-09 21:45:14 -05:00
Wilson Snyder
167f4ebbd4 Commentary: Changes update 2022-11-05 09:32:41 -04:00
Wilson Snyder
0b0b642241 devel release 2022-10-29 17:54:12 -04:00
Wilson Snyder
52d29d238c Version bump 2022-10-29 17:45:54 -04:00
Wilson Snyder
5c658f8cd5 Fix width mismatch on inside operator (#3714). 2022-10-28 06:38:49 -04:00
Wilson Snyder
5f9b0929b4 Commentary: Changes update 2022-10-27 21:35:09 -04:00
Wilson Snyder
4154584c4b Commentary: Changes update 2022-10-21 20:04:07 -04:00
Wilson Snyder
a57a3579c0 Fix false LATCH warning on 'unique if' (#3088). 2022-10-21 19:10:06 -04:00
Wilson Snyder
347e9b4ec8 Fix cell assigning integer array parameters (#3299). 2022-10-21 18:26:39 -04:00
Wilson Snyder
79682e6072 Support empty generate_regions (#3695). [mpb27] 2022-10-20 22:04:50 -04:00
Wilson Snyder
7e1b92fa75 Add --get-supported to determine what features are in Verilator (#3688). 2022-10-20 21:42:30 -04:00
Wilson Snyder
e7068369fe Fix $display of fixed-width numbers (#3565). 2022-10-18 21:10:35 -04:00
Wilson Snyder
b930d0731a Fix foreach and pre/post increment in functions (#3613). 2022-10-18 20:04:09 -04:00
Wilson Snyder
2723223884 Fix LSB error on --hierarchical submodules (#3539). 2022-10-18 17:29:51 -04:00
Wilson Snyder
cb7b024e8f Commentary: Spelling, and add upgrade notes (#3462) 2022-10-16 11:10:41 -04:00
Wilson Snyder
b16b607b98 Commentary: Changes update 2022-10-15 11:04:03 -04:00
Wilson Snyder
732d5bea10 Commentary: Standard format for company contributions 2022-10-15 10:59:31 -04:00
Wilson Snyder
d9a0d0ade2 Commentary (fix earlier commit) 2022-10-15 10:57:46 -04:00
Wilson Snyder
14f58ed6c7 Add error on real edge event control. 2022-10-15 06:21:34 -04:00
Geza Lore
b2070a9407 Commentary: Mention DFG in changes 2022-10-12 10:21:02 +01:00
Wilson Snyder
880cac2fdd Merge branch 'master' into develop-v5 2022-10-01 11:24:55 -04:00
Wilson Snyder
0b843ada03 devel release 2022-10-01 08:34:43 -04:00
Wilson Snyder
746c7ea8f7 Version bump 2022-10-01 08:28:27 -04:00
Wilson Snyder
fa4b10b4d9 Commentary: Changes update 2022-09-30 23:03:26 -04:00
Wilson Snyder
cd2a5771b8 Add --timing to --binary (#3625). 2022-09-28 19:02:23 -04:00
Wilson Snyder
b92173bf3d Add --binary option as alias of --main --exe --build (#3625). 2022-09-28 09:04:33 -04:00
Wilson Snyder
d162619bd3 Merge branch 'master' into develop-v5 2022-09-20 20:06:21 -04:00
Wilson Snyder
fc4ffd454e Rename --bin to --build-dep-bin. 2022-09-18 10:32:43 -04:00
Geza Lore
27031ed688 Merge branch 'master' into develop-v5 2022-09-15 10:28:35 +01:00
Wilson Snyder
75fd71d7e5 Add --main to generate main() C++ (previously was experimental only) (#3265). 2022-09-14 20:18:40 -04:00
Wilson Snyder
9efd64ab98 Commentary 2022-09-14 20:13:28 -04:00
Wilson Snyder
7aa01625d8 Commentary: Changes update 2022-09-14 08:15:42 -04:00
Wilson Snyder
81fe35ee2e Fix typedef'ed class conversion to boolean (#3616). 2022-09-12 18:03:56 -04:00
Geza Lore
fd6275a62b Merge branch 'master' into develop-v5 2022-09-05 17:03:43 +01:00
Geza Lore
d42a2d6494 Fix V3Gate crash on circular logic
The recent patch to defer substitutions on V3Gate crashes on circular
logic that has cycle length >= 3 with all inlineable signals (cycle
length 2 is detected correctly and is not inlined). Fix by stopping
recursion at the loop-back edge.

Fixes #3543
2022-09-02 19:58:58 +01:00
Wilson Snyder
849bb5590a Merge branch 'master' into develop-v5 2022-08-31 19:51:07 -04:00
Wilson Snyder
8d0c06e570 devel release 2022-08-31 19:49:24 -04:00
Wilson Snyder
5b2fbf4f37 Version bump 2022-08-31 19:46:45 -04:00
Wilson Snyder
592dab2bdb Commentary: Changes update 2022-08-31 19:27:43 -04:00
Wilson Snyder
51daa64e9a Fix --hierarchical with order-based pin connections (#3585). 2022-08-31 18:12:21 -04:00
Wilson Snyder
819e8741cc Merge branch 'master' into develop-v5 2022-08-30 00:20:21 -04:00
Wilson Snyder
c335aad25f Fix --hierarchical with order-based pin connections (#3583). 2022-08-29 22:49:19 -04:00
Wilson Snyder
2358ced061 Rename tracing rolloverSize and add test (#3570). 2022-08-28 08:25:02 -04:00
Geza Lore
5c356a4680 Merge branch 'master' into develop-v5 2022-08-22 14:32:06 +01:00
Krzysztof Bieganski
39af5d020e
Timing support (#3363)
Adds timing support to Verilator. It makes it possible to use delays,
event controls within processes (not just at the start), wait
statements, and forks.

Building a design with those constructs requires a compiler that
supports C++20 coroutines (GCC 10, Clang 5).

The basic idea is to have processes and tasks with delays/event controls
implemented as C++20 coroutines. This allows us to suspend and resume
them at any time.

There are five main runtime classes responsible for managing suspended
coroutines:
* `VlCoroutineHandle`, a wrapper over C++20's `std::coroutine_handle`
  with move semantics and automatic cleanup.
* `VlDelayScheduler`, for coroutines suspended by delays. It resumes
  them at a proper simulation time.
* `VlTriggerScheduler`, for coroutines suspended by event controls. It
  resumes them if its corresponding trigger was set.
* `VlForkSync`, used for syncing `fork..join` and `fork..join_any`
  blocks.
* `VlCoroutine`, the return type of all verilated coroutines. It allows
  for suspending a stack of coroutines (normally, C++ coroutines are
  stackless).

There is a new visitor in `V3Timing.cpp` which:
  * scales delays according to the timescale,
  * simplifies intra-assignment timing controls and net delays into
    regular timing controls and assignments,
  * simplifies wait statements into loops with event controls,
  * marks processes and tasks with timing controls in them as
    suspendable,
  * creates delay, trigger scheduler, and fork sync variables,
  * transforms timing controls and fork joins into C++ awaits

There are new functions in `V3SchedTiming.cpp` (used by `V3Sched.cpp`)
that integrate static scheduling with timing. This involves providing
external domains for variables, so that the necessary combinational
logic gets triggered after coroutine resumption, as well as statements
that need to be injected into the design eval function to perform this
resumption at the correct time.

There is also a function that transforms forked processes into separate
functions.

See the comments in `verilated_timing.h`, `verilated_timing.cpp`,
`V3Timing.cpp`, and `V3SchedTiming.cpp`, as well as the internals
documentation for more details.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-08-22 13:26:32 +01:00
Geza Lore
9ac64d0b92 Improve performance of MTask coarsening
Various optimizations to speed up MTasks coarsening (which is the long
pole in the multi-threaded scheduling of very large designs).

The biggest impact ones:
- Use efficient hand written Pairing Heaps for implementing priority
  queues and the scoreboard, instead of the old SortByValueMap. This
  helps us avoid having to sort a lot of merge candidates that we will
  never actually consider and helps a lot in performance.
- Remove unnecessary associative containers and store data structures
  (the heap nodes in particular) directly in the object they relate to.
  This eliminates a huge amount of lookups and helps a lot in
  performance.
- Distribute storage for SiblingMC instances into the LogicMTask
  instances, and combine with the sibling maps. This again eliminates
  hash table lookups and makes storage structures smaller.
- Remove some now bidirectional edge maps, keep only the forward map.

There are also some other smaller optimizations:
- Replaced more unnecessary dynamic_casts with static_casts
- Templated some functions/classes to reduce the number of static
  branches in loops.
- Improves sorting of edges for sibling candidate creation
- Various micro-optimizations here and there

This speeds up MTask coarsening by 3.8x on a large design, which
translates to a 2.5x speedup of the ordering pass in multi-threaded
mode. (Combined with the earlier optimizations, ordering is now 3x
faster.)

Due to the elimination of a lot of the auxiliary data structures, and
ensuring a minimal size for the necessary ones, memory consumption of
the MTask coarsening is also reduced (measured up to 4.4x reduction
though the accuracy of this is low).

The algorithm is identical except for minor alterations of the order
some candidates are added or removed, this can cause perturbation in the
output due to tied scores being broken based on IDs.
2022-08-20 21:18:50 +01:00
Wilson Snyder
ebb37b0156 Merge branch 'master' into develop-v5 2022-08-20 14:02:09 -04:00
Wilson Snyder
90dc04cf93 Add --future0 and --future1 options. 2022-08-20 14:01:13 -04:00
Geza Lore
4d81eb021d Revert "Improve performance of MTask coarsening"
This reverts commit 83475008d9.
2022-08-19 18:03:45 +01:00
Geza Lore
83475008d9 Improve performance of MTask coarsening
Various optimizations to speed up MTasks coarsening (which is the long
pole in the multi-threaded scheduling of very large designs).

The biggest impact ones:
- Use efficient hand written Pairing Heaps for implementing priority
  queues and the scoreboard, instead of the old SortByValueMap. This
  helps us avoid having to sort a lot of merge candidates that we will
  never actually consider and helps a lot in performance.
- Remove unnecessary associative containers and store data structures
  (the heap nodes in particular) directly in the object they relate to.
  This eliminates a huge amount of lookups and helps a lot in
  performance.
- Distribute storage for SiblingMC instances into the LogicMTask
  instances, and combine with the sibling maps. This again eliminates
  hash table lookups and makes storage structures smaller.
- Remove some now bidirectional edge maps, keep only the forward map.

There are also some other smaller optimizations:
- Replaced more unnecessary dynamic_casts with static_casts
- Templated some functions/classes to reduce the number of static
  branches in loops.
- Improves sorting of edges for sibling candidate creation
- Various micro-optimizations here and there

This speeds up MTask coarsening by 3.8x on a large design, which
translates to a 2.5x speedup of the ordering pass in multi-threaded
mode. (Combined with the earlier optimizations, ordering is now 3x
faster.)

Due to the elimination of a lot of the auxiliary data structures, and
ensuring a minimal size for the necessary ones, memory consumption of
the MTask coarsening is also reduced (measured up to 4.4x reduction
though the accuracy of this is low).

The algorithm is identical except for minor alterations of the order
some candidates are added or removed, this can cause perturbation in the
output due to tied scores being broken based on IDs.
2022-08-19 16:59:20 +01:00
Geza Lore
1404319b28 Merge branch 'master' into develop-v5 2022-08-19 13:39:44 +01:00
Wilson Snyder
f435d96241 Fix case statement comparing string literal (#3544). 2022-08-15 21:56:09 -04:00
Wilson Snyder
cbe1b8e266 Fix segfault exporting non-existant package (#3535). 2022-08-08 17:53:50 -04:00
Geza Lore
ad2fbfe62d Merge branch 'master' into develop-v5 2022-07-29 12:04:24 +01:00
Yutetsu TAKATSUKASA
1f9323d086
Set correct dtype in replaceShiftSame() (#3520)
* Tests: Add a test to reproduce bug3399

* Fix3399. Set the correct dtype in replaceShiftSame().

* Tests: update stats.

* Update Changes
2022-07-29 07:05:04 +09:00
Yutetsu TAKATSUKASA
60eab3eb8c
Fix wrong result of bit op tree optimization #3509 (#3516)
* Tests: Add a test to reproduce #3509

* Tests: Compile without tautological-compare check because bit op tree optimization is disabled in the test.

* Internals: Dedup code. No functional change is intended.

* Fix #3509.

"2'b10 == (2'b11 & {1'b0, val[0]})"  and "2'b10 != (2'b11 & {1'b0, val[0]})" were
wrongly optimized to "!val[0]" and "val[0]" respectively.
Now properly optimize them to 1'b0 and 1'b1.

* Commentary

* Commentary: Update Changes
2022-07-24 19:54:37 +09:00
Geza Lore
c9ac9a75a6 Merge branch 'master' into develop-v5 2022-07-12 17:29:45 +01:00
Wilson Snyder
5f3316d3dc * Fix empty string arguments to display (#3484). 2022-07-09 08:30:57 -04:00
Wilson Snyder
a4fddb3fbe Fix table misoptimizing away display (#3488). 2022-07-09 07:55:46 -04:00
Yutetsu TAKATSUKASA
9f37cef1bb
Fix #3470 of incorrect bit op tree optimization (#3476)
* Tests: Add a test to reproduce #3470

* Update LSB during return path of traversal. No functional change is intended.

* Introduce LeafInfo::m_msb

* Update LeafInfo::m_msb when visitin AstCCast

* Internals: Add comment, reorder. No functional change is intended.

* Delete explicit from copy constructor to fix build error.

* Update Changes

* Internals: Remove unused parameter. No functional change is intended.

* Tests: Add explanation to t_const_opt.
2022-07-06 08:33:37 +09:00
Wilson Snyder
e7ca4a69e3 Merge branch 'master' into develop-v5 2022-06-19 15:22:09 -04:00
Wilson Snyder
f2fba51fe2 devel release 2022-06-19 15:13:29 -04:00
Wilson Snyder
7c79f0d431 Version bump (Changes update) 2022-06-19 15:10:23 -04:00
Wilson Snyder
1fa82ffb7b Commentary: Update ChangeLog 2022-06-19 15:00:10 -04:00
Wilson Snyder
e7dc2de14b Fix BLKANDNBLK on $readmem/$writemem (#3379). 2022-06-04 12:43:18 -04:00
Wilson Snyder
0f324c8309 Merge branch 'master' into develop-v5 2022-06-04 11:59:49 -04:00
Wilson Snyder
59dc2853e3 Support concat assignment to packed array (#3446). 2022-06-03 21:32:13 -04:00
Wilson Snyder
ada58465b2 Add -f<optimization> options to replace -O<letter> options (#3436). 2022-06-03 20:43:16 -04:00
Wilson Snyder
173f57c636 Changed --no-merge-const-pool to -fno-merge-const-pool (#3436). 2022-06-03 19:41:59 -04:00
Geza Lore
b51f887567
Perform VCD tracing in parallel when using --threads (#3449)
VCD tracing is now parallelized using the same thread pool as the model.
We achieve this by breaking the top level trace functions into multiple
top level functions (as many as --threads), and after emitting the time
stamp to the VCD file on the main thread, we execute the tracing
functions in parallel on the same thread pool as the model (which we
pass to the trace file during registration), tracing into a secondary
per thread buffer. The main thread will then stitch (memcpy) the buffers
together into the output file.

This makes the `--trace-threads` option redundant with `--trace`, which
now only affects `--trace-fst`. FST tracing uses the previous offloading
scheme.

This obviously helps a lot in VCD tracing performance, and I have seen
better than Amdahl speedup, namely I get 3.9x on XiangShan 4T (2.7x on
OpenTitan 4T).
2022-05-29 19:08:39 +01:00
Geza Lore
0722f47539
Improve V3MergeCond by reordering statements (#3125)
V3MergeCond merges consecutive conditional `_ = cond ? _ : _` and
`if (cond) ...` statements. This patch adds an analysis and ordering
phase that moves statements with identical conditions closer to each
other, in order to enable more merging opportunities. This in turn
eliminates a lot of repeated conditionals which reduced dynamic branch
count and branch misprediction rate. Observed 6.5% improvement on
multi-threaded large designs, at the cost of less than 2% increase in
Verilation speed.
2022-05-27 16:57:51 +01:00
Krzysztof Bieganski
d7a75dc026 Merge branch 'master' into develop-v5 2022-05-25 11:06:38 +02:00
Wilson Snyder
530817191e Support non-ANSI interface port declarations (#3439). 2022-05-25 00:50:50 -04:00
Geza Lore
c7610ed044 Fix FST tracing thread in CMake build 2022-05-20 17:04:46 +01:00
Geza Lore
ffc1c51526 Commentary 2022-05-20 16:44:53 +01:00
Geza Lore
b130a8cfeb Add -DVM_TRACE_VCD in model builds with Make with --trace 2022-05-20 16:44:38 +01:00
Wilson Snyder
7f1a9239ab Commentary, fix typo (#3121) 2022-05-15 11:14:07 -04:00
Geza Lore
599d23697d
IEEE compliant scheduler (#3384)
This is a major re-design of the way code is scheduled in Verilator,
with the goal of properly supporting the Active and NBA regions of the
SystemVerilog scheduling model, as defined in IEEE 1800-2017 chapter 4.

With this change, all internally generated clocks should simulate
correctly, and there should be no more need for the `clock_enable` and
`clocker` attributes for correctness in the absence of Verilator
generated library models (`--lib-create`).

Details of the new scheduling model and algorithm are provided in
docs/internals.rst.

Implements #3278
2022-05-15 16:03:32 +01:00
Geza Lore
c8102c8ffe Fix typo 2022-05-15 16:01:35 +01:00
Wilson Snyder
5aa12e9b51 Add assert when VerilatedContext is mis-deleted (#3121). 2022-05-15 10:51:03 -04:00
Wilson Snyder
3c4131d45d Fix 'with' operator with type casting (#3387). 2022-05-15 09:53:48 -04:00
Geza Lore
f6f03bc261 Merge branch 'master' into develop-v5 2022-05-15 12:05:12 +01:00
Wilson Snyder
c2328ef46a Spelling fixes. 2022-05-14 16:12:57 -04:00
Geza Lore
766fb56651 Merge branch 'master' into develop-v5 2022-05-14 10:30:45 +01:00
Wilson Snyder
71dedccbbe Support compile time trace signal selection with tracing_on/off (#3323). 2022-05-12 22:28:08 -04:00
Geza Lore
bec4610e12 Merge branch 'master' into develop-v5 2022-05-08 15:50:50 +01:00
Wilson Snyder
3d762282b9 Fix hang with large case statement optimization (#3405). 2022-05-05 07:02:52 -04:00
Wilson Snyder
184ebe72a2 Merge branch 'master' into develop-v5 2022-05-02 22:27:58 -04:00
Wilson Snyder
30783e6a79 devel release 2022-05-02 22:23:05 -04:00
Wilson Snyder
aa86c777f4 Version bump 2022-05-02 22:17:20 -04:00