Compare commits

...
947 Commits
Author SHA1 Message Date
Geza Lore e4cc6cadca Fix %m in hierarchical models (#8575)
The model of a hierarchical block, or of a --lib-create library, is
named after the %m of its instance in the parent model, but %m within it
also used to include the name of its top module (l2-name within the
partition), adding an extra level per block. %m now matches across
non-hierarchical, --hierarchical and manual --lib-create builds.

before: top.t.u_sub.sub.u_leaf.leaf
after:  top.t.u_sub.u_leaf
2026-10-02 14:20:41 +01:00
Kornel Uriasz 93e9660ea5 Internals: V3Randomize cleanup. No functional change intended (#8574)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-10-02 07:54:51 -04:00
Geza Lore 5ba2a4836d Tests: Fix DFG tests using same name for models 2026-10-02 09:32:27 +01:00
Wilson Snyder bdfb2e8db1 Fix --hierarchical parameter specialization name collisions (#8555) (#8565)
Fixes #8565.
2026-10-01 08:04:56 -04:00
Geza Lore c5b6f4c80f CI: Add HammerBlade to RTLMeter runs 2026-10-01 12:49:21 +01:00
Nick Brereton 0fc4310048 Fix VPI rows for dynamic and class type variables (#8564) 2026-10-01 07:48:56 -04:00
Wilson Snyder e04f350109 Revert: Fix --hierarchical parameter specialization name collisions (#8555 revert) (#8565). 2026-10-01 07:48:36 -04:00
verilator-bot[bot] 33a6d05382 Apply 'make format' 2026-10-01 11:03:14 +00:00
Nazar Zibilyuk ea536a54b8 Fix waking --sc wrapper when DPI/delay makes work runnable (#8394) (#8534)
Fixes #8394
2026-10-01 12:01:17 +01:00
Wilson Snyder 71c6638ccf Commentary: Changes update 2026-09-30 20:33:45 -04:00
Wilson Snyder 5ac4a7eb22 Commentary 2026-09-30 20:33:39 -04:00
Wilson Snyder f8bf67111e Tests: Fix some scenarios labels. No test coverage change. 2026-09-30 20:25:54 -04:00
Nick Brereton 368f59d5f2 Optimize exhaustive case if-chains with an unconditional else (#8554) 2026-09-30 20:17:00 -04:00
Marco Bartoli 2a82047e4e Fix --hierarchical parameter specialization name collisions (#8555) 2026-09-30 20:15:47 -04:00
Ethan Sifferman 6438d977fa Fix dehash of a suffix after a hashed name (#8556) 2026-09-30 19:51:19 -04:00
Nick Brereton af1c668b99 Fix vpi_put_value crash on NULL value pointer (#8553) 2026-09-30 18:44:09 -04:00
Saqib Khan 5458bd2e77 Fix circular class inheritance hang (#8324) (#8545) 2026-09-30 18:42:58 -04:00
Martijn Wobbes 61289bc80b Fix cascading errors after unsupported class dot reference in parameter value (#8551)
Signed-off-by: Martijn Wobbes <[email protected]>
2026-09-30 17:53:42 -04:00
Aditya Shevade 1edf8f986a Fix real values and unenforced rand/randc type-eligibility rules in constraints (#8273) (#8275) (#8276) 2026-09-30 17:52:43 -04:00
Nick Brereton 226cf2f850 Fix stack depth calculations over calls (#8544) 2026-09-30 13:28:55 -04:00
Artur Bieniek d4e4b1d795 Optimize assertion control queries (#8547) 2026-09-30 11:32:56 -04:00
Kristof Marien 055b870e11 Fix derived class construction resets inherited per-instance rand_mode state (#8527) (#8528) 2026-09-30 11:07:49 -04:00
Marco Bartoli c686a25f54 Fix V3Const__gen.o not rebuilt when headers change (#8550) 2026-09-30 11:07:22 -04:00
Krzysztof Bieganski 1f0e80dbd6 Optimize sched-initial/static/final: call splitCheck once per sub-function (#8549)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2026-09-30 10:26:54 -04:00
Wilson Snyder a419e91574 Fix $c() inside a DPI export (#8402). [Nazar Zibilyuk]
Fixes #8402.
2026-09-29 19:17:34 -04:00
Nick Brereton 0993179e7e Tests: Add VPI tests for combinational, cross-scope and savable access (#8533) 2026-09-29 19:16:22 -04:00
Wilson Snyder 9637c62dfe Tests: Repair new test (#8538 repair) 2026-09-29 17:45:58 -04:00
Wilson Snyder 39796ca954 Commentary: Changes update 2026-09-29 17:40:07 -04:00
Noam Gallmann 7f9a8695c1 Fix crash on class handle passed to string port (#8536) (#8538) 2026-09-29 17:25:52 -04:00
Kristof Marien feb1f64be8 Fix extern class method rejects matching virtual interface argument type #8525 (#8526) 2026-09-29 16:53:54 -04:00
Marco Bartoli 68439fbb72 Fix nonblocking event trigger never firing in suspendable processes (#8485) 2026-09-29 16:48:09 -04:00
Marco Bartoli 21bae44b03 Fix verilator_coverage report to align with get_coverage() (#8522) (#8524) (#8531) 2026-09-29 16:36:33 -04:00
em2machine bbdc2cce08 Internals: fixDeadRefs, findLiveCloneOf, TypeTableDeadRefVisitor removal (#8492 partial) (#8537) 2026-09-29 16:33:17 -04:00
Hongseok Choi c2479ce807 Fix function reference into generate case block (#5312) (#8532) 2026-09-29 12:59:23 -04:00
Igor Zaworski 3fd0948cf2 Fix of queue pop return value access (#8529)
Fixes #8511,  #8380 repair

Signed-off-by: Igor Zaworski <[email protected]>
2026-09-29 16:45:28 +01:00
Kornel Uriasz 38f011ed2c Fix enums inside randomize() with (#8517)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-29 10:01:43 -04:00
em2machine 58fc34e6df Internals: Remove AstRefDType ledger parallel scaffolding in favor of AstRefDType tags (#8492 partial) (#8513) 2026-09-29 09:03:16 -04:00
Saqib Khan 9d9d367302 Support waiting on clocking block event through modport (#8403) (#8530) 2026-09-29 08:50:57 -04:00
Wilson Snyder 647b2056ed Fix verilator_coverage reports rounding incomplete coverage to 100.0% (#8523).
Fixes #8523.
2026-09-29 08:50:20 -04:00
Wilson Snyder 2c32da73c3 Commentary: Changes update 2026-09-29 08:37:08 -04:00
Geza Lore b3139df707 Fix emitting public parameters (#8520)
Fixes #8520, #8512 repair.
2026-09-29 12:23:40 +01:00
Geza Lore da4903f721 Fix bear version detection if uninstalled
Fallout from b8068fad46 The CI 'test' jobs
has no 'bear' installed but attempted to run due to caching the result
of the version check on disk. Check every time instead of caching.
2026-09-29 11:20:45 +01:00
Kristof Marien 640607a0d0 Fix rand_mode(0) not preserving dynamic array of struct values used in a dist constraint (#8508) (#8509) 2026-09-28 22:23:01 -04:00
Wilson Snyder f83ed971e2 Use reversable base64 for -generate-key 2026-09-28 20:11:31 -04:00
Wilson Snyder b8068fad46 CI: Make twice to see errors easier 2026-09-28 19:59:13 -04:00
Wilson Snyder bafdae1847 Internals: Favor constexpr for constants. No functional change intended. (#8521) 2026-09-28 19:58:56 -04:00
Marco Bartoli bde1b98ee0 Support coverpoint bin 'with' filters (#8518) 2026-09-28 18:29:54 -04:00
Kamil Danecki a949674a6b Support nested array and associative array element member access in constraint 3/4 - associative arrays (#8244)
Signed-off-by: Kamil Danecki <[email protected]>
2026-09-28 08:08:57 -04:00
Ethan Sifferman 510ae7b38b Fix duplicate struct declaration when inlining (#8515) 2026-09-28 09:41:56 +01:00
verilator-bot[bot] f5f9ddef9c Apply 'make format' 2026-09-28 01:06:50 +00:00
Marco Bartoli 4ab229e659 Support wildcard bins (#8516) 2026-09-27 21:06:09 -04:00
Michael Bedford Taylor 2c441d853c Optimize DFG temporary sharing across module instances (#8456) 2026-09-28 00:46:27 +01:00
Wilson Snyder c30604222f Tests: Fix stale file reference 2026-09-27 14:31:42 -04:00
Marco Bartoli a933e723c2 Support covergroup fixed-size bin arrays (#8514) 2026-09-27 13:57:38 -04:00
Wilson Snyder 6956befd29 Tests: Reformat some tests to mostly verilog-format standard. No test functional change. 2026-09-27 13:41:11 -04:00
Wilson Snyder f691cd1936 Change --protect to use SHA512 per IEEE 1735. 2026-09-27 13:34:11 -04:00
Wilson Snyder 626333df02 Commentary: Changes update 2026-09-27 13:28:00 -04:00
Geza Lore 43c3c88c38 Internals: AstCoverToggle is not an AstNodeStmt (#6280)
It is more akin to an AstAlways, being a module item.
2026-09-27 13:46:58 +01:00
Geza Lore 9e2c30faab CI: Move Code coverage to 26.04 2026-09-27 13:35:03 +01:00
Geza Lore 348b9b6209 Internals: Make the constant pool a regular package (#8512)
The constant pool is now an ordinary package, created with the netlist
and instantiated under $root like any other package, and most special
handling has been removed, including AstConstPool. Lookups go through
V3ConstPool, which has a singleton instance owned by V3Global. Static
methods on V3Common form the public interfce to add/find constant pool
entries.

With that, the constant pool is usable at any stage during compilation,
so enum and dimension tables created by V3Width, and enum value tables
created by V3Randomize now also live in the constant pool instead of
$unit, so identical tables are shared.

Associative array constants are handled separately from unpacked
tables, which used to be broken but unused.

Emitted constant pool variables use direct initialization, and
`constinit` with C++20 where the type allows it. This ensures we don't
change a run-time in a way that would result in unintended code size
increase.

-fno-merge-const-pool, which was introduced years ago but never prompted
a bug report is deprecated and has no effect.

This is also prep for future work.
2026-09-27 13:25:41 +01:00
Geza Lore d234caafc1 Optimize through package variables in Dfg 2026-09-26 15:01:32 +01:00
Francesco Urbani eec929e40e Support empty queue literals as function and task arguments (#8501) (#8502) 2026-09-26 08:11:49 -04:00
verilator-bot[bot] d1eb78f4e8 Apply 'make format' 2026-09-26 11:03:09 +00:00
Geza Lore 4c4d9cc7d2 CI: Fix previous commit 2026-09-26 12:01:57 +01:00
Geza Lore 98250f6cd2 CI: Format as the Verilator bot when running on main repo 2026-09-26 11:56:58 +01:00
Geza Lore f2114d3dc3 Internals: Make node type hashes stable with Ast changes
Instead of hashing node types by type id (which can change when
adding/removing Ast node types), astgen a stable hash based on node
name. This makes output more stable through Ast node
additions/deletions. Largely to help with 'make test-diff', should have
no user noticeable impact.
2026-09-26 10:37:56 +01:00
Geza Lore 33d63ac0b0 Internals: Identify $unit package by netlist pointer 2026-09-26 07:48:56 +01:00
em2machine 435af6afe6 Internals: Coverage cleanups before UAF fix (#8494) 2026-09-25 18:54:53 -04:00
Ethan Sifferman f6ff5b4cfb Fix elaboration of classes reached through deferred references (#8440) (#8510) 2026-09-25 17:34:47 -04:00
Marco Bartoli 4e29ecbf44 Fix disable fork and wait fork affecting pending NBA updates (#8483) 2026-09-25 16:35:51 -04:00
Deanyone Su 8b663f9c84 Optimize modport resolution with many interface instances (#8496) (#8497) 2026-09-25 14:38:18 -04:00
Marco Bartoli 3a76b29cb3 Add --coverage-max-bins and --coverage-max-real-bins and optimize covergroup bin generation (#8499) 2026-09-25 13:23:46 -04:00
Geza Lore 2e5e34d426 Internals: Set fabricated variable lifetimes
Set implicit net and traced coverage var lifetimes. No functional change.
2026-09-25 16:33:53 +01:00
Ryszard Rozak 0e0ce2be52 Fix mis-setting of process state from FINISHED to KILLED (#8506)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-09-25 09:43:55 -04:00
Ryszard Rozak 765d05acf8 Fix semaphore waiting on killed process (#8505)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-09-25 09:27:36 -04:00
Ryszard Rozak ba8e0a1437 Set status of finished process immediately (#8503)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-09-25 09:26:22 -04:00
Geza Lore 84dec259c8 Fix constant oversized shifts in V3Premit
- Arithmetic right shift used the MSB of the C++ type as the sign bit,
  instead of the MSB at the Verilog width.
- Constant shift amounts with their top bit set were treated as
  negative, so the oversized shift was emitted as undefined behavior.
- Shifts of an impure operand were replaced by zero, discarding the
  side effects of the operand.
2026-09-25 14:12:00 +01:00
Geza Lore f2dbf210a8 Fix masking of right shifted values with dirty upper bits (#8500)
Fixes #8500
2026-09-25 11:12:30 +01:00
Geza Lore 1c94fbb5d6 Internals: Remove code dead after recent refactoring (#8498) 2026-09-25 08:30:34 +02:00
Kristof Marien 4202862472 Fix disabled random dynamic array of structs referenced in a constraint (#8454) (#8455) 2026-09-24 20:44:09 -04:00
Geza Lore 02546791da Internals: Remove V3LinkDot::linkDotArrayed (#8495)
Follow up to #8476 and #8493, now that elaboration fully expands
instance arrays, linkDotArrayed's only remaining purpose was to name
AstBegin blocks created after V3Width.

Fix up earlier passes to name all Begin blocks they create, or avoid
creating AstBegin in the first place if possible.

One warning about assigning to a modport input of a generic interface
port had to move into LinkLValue (previously this only used to be
reported by linkDotArrayed, as the type/modportness only resolved in
V3Param, and the lvalueness is subsequently only known in LinkLValue).

Then remove linkDotArrayed and simplify V3LinkDot.cpp
2026-09-24 22:41:24 +01:00
Geza Lore 9e03fed56b Support multi-dim interface instance arrays and interface array ports (#8493)
Companion to #8476, and this now moves all instance array and interface
array/modport array port expansion into elaboration. Fixes #2675.

Arrays of interface instances and interface array ports are now split
into their elements during elaboration, instead of after V3Width in
V3Inst::dearrayAll, which is removed.

Background: next to every interface instance 'intf ifs()', V3LinkCells
creates a companion variable 'ifs__Viftop' of type IfaceRefDType
referring to the instance, so the instantiating module can use the
interface as a value (in pin connections, virtual interface assignments,
arguments, ...) just like a module referring to it through an interface
port. For an array of instances 'intf ifs[N]()', this variable is an
unpacked array of IfaceRefDType, but an IfaceRefDType can only refer to
a single instance, so it must be split into a variable for each element,
and every use of the whole array replaced.

V3Param expands interface instance arrays like module instance arrays,
also splitting the __Viftop variable referencing the whole array into a
variable for each element cell ('ifs__BRA__i__KET____Viftop', the
companion of element cell 'ifs__BRA__i__KET__'), and splits each
interface array port into a variable for each element. The whole array
variables remain until all references to them are replaced, so V3LinkDot
can link hierarchical references to the correct specialization.

In V3Width, every reference to a whole interface array, including
hierarchical ones, is replaced by an AstInitArray of references to its
element variables, typed as the whole array, e.g. 'ifs' becomes
'{ifs[0], ifs[1], ...}. The AstInitArray keeps its own type, so its uses
are checked as those of the whole array. The whole array variables are
removed at the end of V3Width.

V3Width then treats a whole interface array replaced by an AstInitArray
as an ordinary unpacked array value:
- A constant select yields the element, a slice the selected elements.
- A pin of an element of a module instance array selects its part of an
  interface array connection like any other connection.
- A pin of an interface array port is split into a pin for each element
  port, connected left index to left index.
- A member of an element is referenced through the interface, as for
  any other interface.

This supports slices of interface arrays, and interface ports of
multi-dimensional module instance arrays connected to interface arrays.
2026-09-24 19:10:33 +01:00
Marco Bartoli 1aa5ab2e3a Support weight in coverage (#8472) 2026-09-24 14:01:45 -04:00
David Harris 88082a4e96 Support automatic bins for enum coverpoints (#8462) (#8464) 2026-09-24 09:58:22 -04:00
Geza Lore 976ec63531 Support multi dimensional module instance arrays (#2675) (#8476)
Arrays of module instances are now expanded into their element cells
during elaboration in V3Param, instead of after V3Width in
V3Inst::dearrayAll. Element cells are named as before
(name__BRA__i__KET__...), are ordered from the left index to the right
index, and hierarchical references to them resolve in linkDotParamed.

Arrays of interface instances are still expanded by V3Inst. They will
move in a follow up patch.

Algorithmically:
- V3Praram replaces an arrayed AstCell, with a scalar Cell for each
  element. linkDotParamed can resolve against these as normal.
- V3Width then fixes up the AstPins of each expanded Cell according to
  the LRM rules. Either leaving the alone to connect to all instances,
  or inserting ArraySel/Sel to connect the relevant part to the relevant
  instance.

Partial #2675
2026-09-24 10:59:41 +01:00
Marco Bartoli 26dd04c020 Fix ##0 synchronous drive overriding later drives (#8482) 2026-09-23 21:32:14 -04:00
Wilson Snyder 3d386f8fa5 Internals: Add VL_DO_DANGLING in some missing places. No functional change intended. 2026-09-23 18:27:40 -04:00
Bartłomiej Chmiel 7fd68b58ca Fix VPI discoverability of forceable unpacked struct members (#8445) 2026-09-23 14:54:55 -04:00
David Harris 729a51e26e Fix unsized condition not reduced to one bit (#8465) (#8466) 2026-09-23 14:50:16 -04:00
em2machine f82cdbeaa7 Fix typedef through a parameterized sub-interface (#7943 repair) (#8124) (#8128) 2026-09-23 14:32:23 -04:00
David Harris e6ecf3a014 Fix embedded covergroup calling an enclosing class method (#8461) (#8463) 2026-09-23 14:26:03 -04:00
Artur Bieniek e9f60f3282 Fix model failing when host has fewer cores than --threads (#8475)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-23 13:52:47 -04:00
Geza Lore f458e40060 Move module inlining after V3Scope (#8453)
This moves V3Inline after V3Scope. Not doing #2226 yet as it has some
fallout. The inlining heuristic is identical to before, but the node
counts might have shifted, so output can be perturbed.

There is a wart needing to be fixed up with how Fsm coverage is
collected, which inserts declarations into the MODULE for each instance
of that module, but we can fix it up.

Otherwise it's fairly straight forward translation of the old algorithm,
there are some quirks due to V3Scope, but nothing drastic. Moving it far
later might be hard though, because of the Fsm-like rewrites, but that's
not something we want to do anyway.

Fixes #1539
2026-09-23 18:15:46 +01:00
Noam Gallmann ceb7dde938 Fix V3OutJsonFile comma emission for nested JSON scopes (#8469) (#8474) 2026-09-23 13:03:45 -04:00
David Harris a99ced0ed4 Fix covergroup '0/'1 bin values not filling to coverpoint width (#8458) (#8460) 2026-09-23 12:50:39 -04:00
Todd Strader e9a24647d8 CI: Fix regress wording (#8471) 2026-09-23 08:29:06 -04:00
Wilson Snyder 9401876de5 Commentary: Changes update 2026-09-23 08:16:58 -04:00
Wilson Snyder 492a8f7b67 Commentary 2026-09-23 08:16:51 -04:00
David Harris fe4b3bdec4 Fix $sscanf/$fscanf returning -1 after a partial match (#8457) (#8459) 2026-09-23 05:35:17 -04:00
Marco Bartoli 39e2d8e853 Support dynamic cross layouts and fix covergroup bin exclusions priority (#8424) 2026-09-22 20:44:25 -04:00
David Harris 525d1fade3 Fix internal error on covergroup in a specialized parameterized class (#8450) (#8452) 2026-09-22 19:00:20 -04:00
Geza Lore 6eced23e84 Optimize instance port connections by aliasing rather than by assignment (#8427)
Use AstAlias instead of AstAssignW in V3Inst port connection lowering,
the same way as V3Inline would do if the instance is inlined. This
closes some of the gap between -finline and -fno-inline behaviour, and
is also required for moving V3Inline post scope, where it could not
create aliases anymore (hence required for future patch to maintain
current behaviour).

This is also a partial fix to #4698 (only when the connected expression
is a plain VarRef)
2026-09-22 20:27:21 +01:00
Tynan McAuley 0ab3915de6 Fix data race in AstTypeTable by serializing V3VariableOrder (#8451) 2026-09-22 12:49:23 -04:00
Patrick Creighton d637b665ce Synthesize successive whole-element array assignments (#8316)
Preserve previous whole-element drivers when synthesizing successive
constant-index assignments to unpacked arrays. Retain earlier values
through their assignment temporaries and keep the default while some
elements remain uncovered.

Complete the array-default tracing path exposed by this representation.
Keep public-write checks, control-flow restrictions, and scheduling
unchanged, and cover propagation and conservative fallbacks in the
existing DFG regressions.

Part of #7964; array-only follow-up to #7966.
2026-09-22 17:46:38 +01:00
Artur Bieniek f04eb8de81 Fix compound types in anonymous structs (#8449)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-22 12:41:11 -04:00
Artur Bieniek 08c9032927 Fix internal error when task without CFunc is left in the tree (#8437)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-22 11:36:20 -04:00
Wilson Snyder 4110d13131 Tests: Also check for brace-init comments 2026-09-22 09:13:42 -04:00
Wilson Snyder 5dab8ab576 Commentary 2026-09-22 09:13:31 -04:00
Wilson Snyder e63ca70d92 Tests: Add memers commented test 2026-09-22 07:21:32 -04:00
Wilson Snyder f883b1c858 Commentary. No functional change 2026-09-22 07:20:46 -04:00
Ryszard Rozak dc179243eb Tests: Fix t_constraint_global_cls_arr (#8446)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-09-22 06:35:43 -04:00
Kornel Uriasz a1e6252e77 Internals: V3Randomize cleanup. No functional change intended (#8443)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-22 06:34:32 -04:00
Jonathan Drolet e71d4e7fe5 Fix force read update sensitivity quadratic (#8431) (#8433) 2026-09-21 23:17:39 -04:00
Artur Bieniek 9e6af08c84 Fix false MULTIDRIVEN for writes in tasks never executed (#8401) 2026-09-21 20:57:40 -04:00
Kristof Marien a50aea7709 Fix streaming dynamic arrays with different element types failing to compile (#8434) (#8435) 2026-09-21 20:57:03 -04:00
Kristof Marien 9ca90f414c Fix nested random dynamic arrays internal error (#8438) (#8439) 2026-09-21 20:50:37 -04:00
Kornel Uriasz ba1961c70b Fix unique constraint with multiple arrays (#8378)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-21 17:47:18 -04:00
dependabot[bot] 5883a5a40d CI: Bump the everything group with 4 updates (#8432) 2026-09-21 17:45:59 -04:00
Wilson Snyder d321a5fa5d Update IEEE references 2026-09-21 08:46:58 -04:00
Wilson Snyder 2180cfd635 Tests: Less aggressive waiting message 2026-09-21 08:11:21 -04:00
Wilson Snyder 232d3ecc0c Commentary: Changes update 2026-09-21 08:11:21 -04:00
Wilson Snyder 3884b3ddf3 Tests: skip t_forceable_unpacked_large (#8431 disable) 2026-09-21 08:11:21 -04:00
Kamil Danecki f954f4fd1d Support nested array element member access in constraint (#8243) 2026-09-21 08:10:53 -04:00
Geza Lore 46774fded9 Optimize away dead ports (#8426) 2026-09-21 02:02:59 +01:00
Geza Lore 3c05eef216 Fix losing coverage declarations if first in a module body (#8425) 2026-09-21 00:47:04 +01:00
Geza Lore e5384c7b68 CI: Fix yaml format 2026-09-20 23:56:59 +01:00
Geza Lore 33d1e4e685 CI: Fix more unintended cancellations 2026-09-20 23:38:41 +01:00
Geza Lore 652495a932 Fix interface modport resolution against non-scope symbol tables (#8420)
LinkDotFindVisitor queued an AstIface into m_ifaceModSyms once for every
symbol table entry it was reached through. When creating scopes,
LinkDotIfaceVisitor resolves the modport items against the AstVarScopes,
which LinkDotScopeVisitor only inserts under the entry of an AstScope. A
hierarchical block wrapper builds a second copy of the instance tree in
the symbol table, and an interface reached through that copy has no
AstVarScopes to resolve against.

Resolving is destructive (the AstModportVarRef is deleted once resolved),
so this only worked when a resolvable entry happened to be processed
first, and failed with "Modport item not found" otherwise. When creating
scopes, register from the AstScopes instead, as those are exactly the
entries that hold the AstVarScopes.

Reproduces on t_hier_block with -fno-inline, added as a test.
2026-09-20 20:52:17 +01:00
Geza Lore bef6c8afa0 CI: Fix imprecise 'onMaster' checks 2026-09-20 20:40:22 +01:00
Geza Lore 77e9938188 CI: Prevent concurrent format jobs on same ref 2026-09-20 20:40:22 +01:00
Geza Lore 8f0bd99449 CI: Fold pr-conflicting into pr-automation 2026-09-20 20:40:22 +01:00
Kaleb Barrett c4957ef206 Fix MSYS header include search to be after toolchain headers (#8422) 2026-09-20 15:14:11 -04:00
Geza Lore 2ee6f7435d CI: Fix unlabeling closed PRs canceling unrelated jobs 2026-09-20 20:08:41 +01:00
Shriyans Sahoo e71f6f3b7a Fix cache of boundary vertices in Dfg cycle breaking (#8308) 2026-09-20 17:05:56 +01:00
Geza Lore c545552cc1 Fix FSM coverage hierarchy being emitted as an absolute path (#8421)
AstNodeCoverDecl::hier() is relative to the scope the declaration is
emitted from, as V3EmitCImp builds the reported path as 'vlNamep + hierp',
and that is how V3Coverage uses it. V3FsmDetect instead set it to the
absolute scope name, so the instance path was counted twice.

This was masked whenever the owning module was inlined, as the declaration
then ended up in the top scope. With inlining disabled, an FSM in an
instance reported 'top.t.forced_wide_u.t.forced_wide_u'. In the inlined
case it reported 'top.TOP', leaking the internal top wrapper name into
user visible coverage output, rather than plain 'top'.
2026-09-20 16:21:40 +01:00
Geza Lore fcb2a22d8e Tests: Skip t_forceable_unpacked_large with dev-coverage
This test takes over 1 hour to run with code coverage collection.
2026-09-20 16:12:29 +01:00
Geza Lore 8f6d6cd13b Fix placing Always into List[VarScope] in LinkDot (#8419)
Updated order dependent tests.
2026-09-20 14:15:41 +01:00
Geza Lore dfa4ace3dd Optimize V3Scope to move nodes on the last instance of a module (#8417)
Nodes were always cloned under the new scope, with the originals deleted
at the end of the pass. Count total module instantiations up front, then
move the nodes instead of cloning them when scoping the last instance.

Required to avoid a memory regression in a follow up, but also faster
and less peak memory overall.

Output is identical.
2026-09-20 14:15:29 +01:00
Geza Lore d30487e0f7 Optimize V3Scope to gather variable reference fixups in a vector (#8418)
Each AstVarRef is visited exactly once (blocks are iterated under
their per-scope clone), and the fixups are independent, so no need
for the ordered set.
2026-09-20 14:15:07 +01:00
Marco Bartoli dc946aee2b Support enclosing cross identifiers in bin selections (#8416) 2026-09-20 08:57:14 -04:00
Geza Lore 9e3ec98461 CI: Don't skip CI on format (#8408) 2026-09-20 07:14:47 -04:00
Wilson Snyder c8b8c79ee9 Commentary: Changes update 2026-09-19 21:33:08 -04:00
Wilson Snyder 67e6d09768 Commentary 2026-09-19 21:31:14 -04:00
Wilson Snyder 3444d57929 Tests: Add VtOs.system 2026-09-19 21:31:14 -04:00
Geza Lore 8c6dd7a164 CI: Auto label on RTLMeter and Code coverage failure 2026-09-19 21:45:20 +01:00
Marco Bartoli 18ad801887 Fix covergroup constructor initialization (#8410) 2026-09-19 16:44:04 -04:00
Geza Lore 87983308c7 CI: Add job to block PR merges with pr-blocked: labels (#8415) 2026-09-19 21:18:29 +01:00
Geza Lore 23a4c8ef46 CI: Label as the CI app to trigger workflows 2026-09-19 20:50:50 +01:00
Geza Lore acb1333a85 CI: Auto label PRs with pr-blocked: improve-coverage 2026-09-19 19:59:34 +01:00
Kristof Marien c266da882d Fix crash when widthing a covergroup option through a forward class (#8351) (#8352) 2026-09-19 14:47:07 -04:00
Geza Lore ba68360819 CI: Auto label PRs with pr-blocked: fix-regression 2026-09-19 19:33:25 +01:00
Jonathan Drolet 6999fe0f29 Fix O(N^2) compile-time blowup forcing large unpacked arrays (#8395) 2026-09-19 14:22:38 -04:00
Kaleb Barrett 8fbfc82cc2 Fix issues with configuring flex during build on MacOS (#8412) 2026-09-19 13:34:30 -04:00
Geza Lore b0b4714a9d CI: Make regressions label driven (#8413) 2026-09-19 18:31:58 +01:00
Geza Lore ee51f322c7 CI: Fix previous commit 2026-09-19 18:00:57 +01:00
Geza Lore f6801633f8 CI: Add Regression passed job for status checks 2026-09-19 17:57:43 +01:00
Geza Lore f2fcacfe3d CI: Rename build-test.yml to regression.yml 2026-09-19 17:04:09 +01:00
Geza Lore 0b661a00c1 CI: Also mop up after the Regression job 2026-09-19 16:59:19 +01:00
Geza Lore 7400d28e6d CI: Don't restart RTLMeter/Coverage on unrelated label changes (#8411) 2026-09-19 16:52:27 +01:00
Geza Lore 36aa3e88c7 CI: Add PR automation job (#8203) 2026-09-19 16:30:50 +01:00
Geza Lore a9f959ff28 CI: Fix yaml format 2026-09-19 15:51:59 +01:00
Geza Lore b75ceeb121 CI: Delete skipped PR workflows 2026-09-19 15:48:24 +01:00
Kaleb Barrett d797c2009b CI: Move macOS build from 15 to 26 #8409 (#8409) 2026-09-19 13:02:48 +01:00
Marco Bartoli 014c9820de Warn on not yet implemented and ignored iff in default or transition bins (#8406) (#8407) 2026-09-18 21:34:54 -04:00
Marco Bartoli 1cefe95c85 Support iff in covergroup bins (#8406) 2026-09-18 20:29:22 -04:00
Nick Brereton a93317b6cc tests: Add VM_PREFIX_INCLUDE_DPI (#8386) 2026-09-18 17:29:53 -04:00
Jesús Alberto López Soto 724a42e31d Fix reevaluation of method calls in wait conditions (#8391) 2026-09-18 15:41:01 -04:00
Marco Bartoli 830cb633e5 Optimize covergroup bin metadata lookup (#8404) 2026-09-18 14:25:37 -04:00
Geza Lore ccb4ab9fe3 Optimize Dfg vertex input edge storage (#8313)
Store input edges of fixed arity vertices inline in the vertex class.
This reduces heap allocations, memory fragmentation, and pointer chasing
and speeds up Dfg passes. The extra branch introduced in inputEdgep() is
well predictable and profiling shows branchless alternatives are a loss.
2026-09-18 18:19:53 +01:00
Geza Lore 079422d6ae Fix Dfg driver tracing of partial assignments (#8377) (#8397)
Fixes #8377
2026-09-18 17:51:54 +01:00
Kornel Uriasz ce482bb087 Fix weighted dist constraints in presence of other constraints (#8392)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-18 10:30:39 -04:00
Andrii Andrieiev 064ecbcb82 Fix error on non-existent interface ports (#8393)
Signed-off-by: Andrii Andrieiev <[email protected]>
2026-09-18 08:26:56 -04:00
Ryszard Rozak c25f287779 Fix copy constructor of classes with constraints (#8381) 2026-09-18 07:47:25 -04:00
Igor Zaworski 5f38b797f3 Fix access types of refs and inouts (#8380) 2026-09-18 07:46:56 -04:00
Nick Brereton 3fd16ed498 Internals: Hoist vpi_put_value_array argument validation to entry point. (#8384) 2026-09-17 18:08:16 -04:00
Geza Lore 1f9c9681a7 CI: Move RTLMeter jobs to 26.04 (#8387)
Fixes #8379
2026-09-17 22:47:06 +01:00
Geza Lore 1c4c6c9e9d Improve V3Split (#8385)
Various cleanups, simplifications and improvements:
- Build the output bottom up, eliminating AstSplitPlaceholder
- Replace the 'ignore step' pruning with removing the vertices and edges
- Treat an NBA written variable as a block input, enabling more splits
- Move instead of clone leaf statements

Overall V3Split is faster, uses less memory, can do more splits, is
simpler algorithmically, and has half the lines of code in V3Split

Most notably this can now be split, which could not be before:

```systemverilog
always @(posedge clk) begin
    a <= !a;
    if (a) b <= c;
end
```

t_x_rand_mt_stability* pin $random values, but there is one random seed
per C thread, so they depend on which thread runs the block. More
splitting moved that block onto a different thread, so force a single
MTask in those tests to keep them stable.

Some property/assert test changed hit counts due to races, but are now
closer to what might be expected.
2026-09-17 23:11:26 +02:00
Geza Lore 2d0eaab5df Add -fno-slp-vectorize if C++ compiler is clang 18 (#8383)
Partial #8379
2026-09-17 18:38:39 +01:00
Nick Brereton bc7fd47908 Internals: Prepare VPI runtime for lazy public signals. No functional change. (#8382) 2026-09-17 13:00:19 -04:00
Marco Bartoli 1aa87913c8 Support illegal_bins and ignore_bins for cross bins (#8372) 2026-09-16 17:53:15 -04:00
Artur Bieniek e2caf971de Fix NFA rings for bounded SVA delays (#8371)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-16 17:52:28 -04:00
Marco Bartoli 08cadc034d Reland and fix "Fix wide enum names" (#8344) (#8362) (#8365) (#8366) 2026-09-16 17:47:51 -04:00
Geza Lore 9f66980355 Revert "Internals: Improve V3Split (#8373)" (#8374)
This reverts commit d8a3208bea.
2026-09-16 21:44:19 +01:00
Geza Lore d8a3208bea Internals: Improve V3Split (#8373) 2026-09-16 16:25:36 -04:00
Wilson Snyder 40c102b4f8 Fix docker compilation with --trace-fst (#8370).
Fixes #8370.
2026-09-16 12:36:14 -04:00
Geza Lore 573c2e61a6 Internals: Make V3LiftExpr non optional (#8369) 2026-09-16 12:29:56 -04:00
Pawel Kojma 282b898b21 Use VIsCached for checking purity of arguments in AstCMethodHard (#8350) 2026-09-16 11:23:34 -04:00
Wilson Snyder 195d0db009 Commentary: Changes update 2026-09-15 21:36:01 -04:00
Wilson Snyder 45dbc90343 Tests: Reformat some tests to mostly verilog-format standard. No test functional change. 2026-09-15 21:35:50 -04:00
Edmund Lam 529d98918a Fix deferring parameters for class::localparam access (#7746) (#7748) 2026-09-15 21:17:26 -04:00
Artur Bieniek c9e3f59f26 Fix stale reads of continuously assigned forceable signals (#8223)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-15 21:15:37 -04:00
Bartosz Skorowski 3e30f4476a Support constant expressions in bins (#8309)
Signed-off-by: Bartosz Skorowski <[email protected]>
2026-09-15 21:15:25 -04:00
Drew Risinger e0e0011b36 Optimize recursion depth in Dfg circular driver tracing (#8272) 2026-09-15 23:23:54 +01:00
Wilson Snyder a9ddb4fab3 Revert "Fix wide enum names" (#8344) (#8362) 2026-09-15 13:42:35 -04:00
Geza Lore 3343f4d6c8 Fix V3InstrCount with recursive functions (#8361)
Fixes #8327
2026-09-15 18:30:16 +01:00
Geza Lore 0f3a84643b CI: Fix pr-notification deletion 2026-09-15 17:01:45 +01:00
Marco Bartoli 253f51f1dc Fix %p format on class members (#8360) 2026-09-15 09:43:12 -04:00
Mike Murunov 270c528afd Fix missing implicit net for bufif/notif/nmos/pmos data input (#8353) (#8354) 2026-09-14 17:31:51 -04:00
Marco Bartoli c65f312d6e Fix wide enum names (#8344) 2026-09-14 16:29:42 -04:00
Dragon-Git 377865e2a0 Fix class-qualified self reference to a typedef in a parameterized class (#8348) (#8349) 2026-09-14 10:54:15 -04:00
Artur Bieniek 6a57cf10f4 Obtimize NBA assertions by keeping all writers before readers (#8326)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-14 10:29:27 -04:00
CatalpaEel 96e6bf02c4 Optimize wide four-state constant operations in V3Number (#8333) 2026-09-14 10:12:30 -04:00
Marco Bartoli 0bad0faca6 Fix ignoring cross_auto_bin_max instead of hard error (#8340) 2026-09-13 14:59:42 -04:00
Wilson Snyder 547eb6a836 Remove deprecated --structs-packed. 2026-09-13 14:54:34 -04:00
Wilson Snyder e172e94b30 Fix pattern type matching against nested aggregates (#7304).
Fixes #7304.
2026-09-13 14:48:07 -04:00
Wilson Snyder e871c3657e Commentary: Changes update 2026-09-13 14:00:43 -04:00
Wilson Snyder 3200946bb9 Tests: Improve t_string_to_bit 2026-09-13 13:41:53 -04:00
Marco Bartoli fb8bcdc0df Fix format of signed enums (#8338) 2026-09-13 13:34:10 -04:00
Marco Bartoli 47ead4e89d Support logic and set operations on binsof (#8306) 2026-09-13 12:59:10 -04:00
Kristof Marien 298922d887 Fix parameterized class nested in a parameterized interface (#8328) (#8329) 2026-09-12 15:31:10 -04:00
Wilson Snyder 4fedb791ed Add -fno-dead-members and optimize dead class member functions. (#8330) 2026-09-12 15:22:42 -04:00
Wilson Snyder 3bf0018354 Optimize away __Vconfigure if empty function 2026-09-12 14:36:45 -04:00
Wilson Snyder d523500b9b Optimize UVM reporting functions as branch-unlikely 2026-09-12 13:54:15 -04:00
Wilson Snyder a8a50bd8a0 Commentary 2026-09-12 12:22:14 -04:00
Wilson Snyder c7b1151f13 Fix unlinked VlProcess error 2026-09-12 11:00:29 -04:00
Wilson Snyder 73957647cc Add IEEE reference to some warnings 2026-09-12 09:06:09 -04:00
Wilson Snyder d048b62c13 Fix marking inherited virtual functions (part 2) 2026-09-12 08:55:45 -04:00
Wilson Snyder c8a75e9b4d Tests: Reformat some tests to mostly verilog-format standard. No test functional change. 2026-09-12 08:38:51 -04:00
Wilson Snyder 012b647833 Fix marking inherited virtual functions 2026-09-12 08:32:53 -04:00
Wilson Snyder 005b33faa1 Commentary: Changes update 2026-09-12 08:21:01 -04:00
Todd Strader 0c574618d0 Support VPI interface references (#8081) 2026-09-12 05:38:20 -04:00
Marco Bartoli 4aeb3dbc5a Fix wide typed pattern formatting primitives (#8325) 2026-09-11 18:11:14 -04:00
Wilson Snyder bd32c0e4c1 Internals: Refactor V3Dead ftask removal to use graph (#8322) 2026-09-11 06:52:25 -04:00
Wilson Snyder 72523c3be1 Tests: Fix coverage.dat in wrong directory 2026-09-10 21:21:04 -04:00
Andrii 2421c7b73b Fix property and sequence line coverage (#8314)
Signed-off-by: Andrii Andrieiev <[email protected]>
2026-09-10 18:00:24 -04:00
Nick Brereton dada720bca Internals: Inline VerilatedContext::assertCtlGet (#8320) 2026-09-10 15:48:58 -04:00
Artur Bieniek b06bd46dc9 Avoid duplicate lookup in NFA property recursion guard (#8321)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-10 20:46:54 +02:00
Artur Bieniek 5b24226b3b Avoid unnecessary per-vertex allocations in NFA lowering (#8319)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-10 20:21:37 +02:00
Artur Bieniek 09fd15af7b Narrow NBA shadow copies for partial writes (#8266)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-10 11:38:46 -04:00
Kamil Danecki ee792e235a Support rand dynamic arrays used inside with clause of randomize (#8246)
Signed-off-by: Kamil Danecki <[email protected]>
Signed-off-by: Igor Zaworski <[email protected]>
2026-09-10 10:40:30 -04:00
Artur Bieniek 557c21a337 Support multiplicity in SVA shapes that use NFA rings (#8267)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-10 10:39:35 -04:00
Wilson Snyder 24692ad3ef Internals: Change user1-4 storage to uint64 (#8317) 2026-09-10 06:45:54 -04:00
Wilson Snyder 3c8630744d Internals: V3Dead refactor and test update. No functional change. 2026-09-10 06:43:47 -04:00
Wilson Snyder 0dd45238a7 Internals: Update verilog_format flags for recent Verible 2026-09-10 06:39:43 -04:00
Geza Lore 1d2781091c Internals: Color densely in V3Graph::weaklyConnected, and return the count
No algorithm depends on this, so can be changed, later improvement will.
No functional change.
2026-09-09 21:11:23 +01:00
Geza Lore 5bf74e34b1 Internals: Move SplitReorderBaseVisitor next to SplitVisitor
Pure code movement to minimize change in subsequent patch.
2026-09-09 13:02:42 +01:00
Wilson Snyder 599f8b8e35 Tests: Reformat some tests to mostly verilog-format standard. No test functional change. 2026-09-08 21:26:11 -04:00
Geza Lore da39cea1bd Tests: Add -fno-exceptions to t_verilated_all (#8312)
Fixes #6771
2026-09-09 00:33:36 +01:00
Drew Risinger 3e874fb4d1 Fix CMake to call Verilator perl wrapper (#8269) (#8270) (#8311)
This reimplements commit c1c19494c4.
2026-09-08 18:29:09 -04:00
Geza Lore e4f210eb38 Optimize Dfg algorithms with an open addressing hash table (#8307)
This patch introduces V3HashTable.h, which defines an open addressing,
linear probing hash table. The table implement the public V3HashSet and
V3HashMap templates, which are generic containers. The benefit of this
over std::unordered_map and std::unordered_set is far better memory
locality during lookup. (The STL containers use chaining and require a
new heap allocation for every insertion, similarly probing involves
pointer chasing on collisions).

The new data structure is use in V3DfgCache, and V3DfgCse and yields a
significant speed improvement of those passes on large designs.
2026-09-08 23:21:13 +01:00
Wilson Snyder 5bb0e9b216 Commentary: Changes update 2026-09-08 18:09:39 -04:00
Wilson Snyder 5ce1abc2b4 Tests: Fix cleaning t_a6_examples (#8270 comment) 2026-09-08 18:07:12 -04:00
Geza Lore b835308a31 Optimize AstNodeDType::skipRefp to not track the type chain (#8310) 2026-09-08 18:00:08 -04:00
Geza Lore fa30985cda Internals: Exclude UDEBUGONLY from branch coverage 2026-09-08 21:49:10 +01:00
Kornel Uriasz f8c296ce2e Support unique constraint inside std::randomize (#8241)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-08 11:08:34 -04:00
Kornel Uriasz 47b9fba5e5 Fix array-size constraint on arrays inside base cass (#8219)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-09-08 09:11:02 -04:00
Martijn Wobbes d70d1e5cd0 Fix DECLFILENAME warning on nested declarations (#8302) 2026-09-08 07:15:37 -04:00
Artur Bieniek 76df8b4a7e Fix multidimensional packed array type handling (#8235)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-07 14:04:17 -04:00
Matthew Ballance 048d18a84f Add covergroup runtime registry (#8134) 2026-09-07 14:02:03 -04:00
Artur Bieniek cd2475fbd4 Support non-overlapped property implications correctly (#8268)
Signed-off-by: Artur Bieniek <[email protected]>
2026-09-07 13:50:13 -04:00
Igor Zaworski 9c6126b834 [#99994] Fix of detecting non-inlined awaits in V3Delayed.cpp (#7982)
Signed-off-by: Igor Zaworski <[email protected]>
2026-09-07 13:46:30 -04:00
dependabot[bot] 2bffeec8b9 CI: Bump the everything group with 2 updates (#8304) 2026-09-07 10:58:37 -04:00
Marco Frank 63bcfff80a Fix array slice crash when used as a bare value (#5132) (#8262) 2026-09-06 20:57:44 -04:00
Marco Bartoli 9da900a5e2 Add initial support for solo binsof (#8298) 2026-09-06 19:51:31 -04:00
Geza Lore bbbb9c3e7c Optimize away netlist teardown when about to exit (#8294) 2026-09-06 18:08:34 -04:00
Geza Lore 849cc5aeca Internals: Move wrapTop before V3Coverage (#8291) 2026-09-06 17:34:40 -04:00
github action 8213c0ea98 Apply 'make format' [ci skip] 2026-09-06 21:19:40 +00:00
Geza Lore 62bec1bffc Internals: Use auto in UASSERT_SELFTEST (#8299) 2026-09-06 17:16:08 -04:00
Marco Bartoli 0b824f160f Fix escape strings in pattern formatting (#8297) 2026-09-06 13:22:03 -04:00
Nick Brereton 4d1f208cf0 Fix assignment pattern default fill of an array of unpacked structs (#8289) 2026-09-06 11:44:44 -04:00
Geza Lore 7cf8c5cca6 Optimize more selects in DFG (#8292) 2026-09-05 19:57:26 -04:00
Kamil Danecki 73708c55c3 Support nested array and associative array element member access in constraint 1/4 - pre-cleanup (#8237)
Signed-off-by: Kamil Danecki <[email protected]>
2026-09-05 15:33:24 -04:00
Sumanth KadiyalaandSumanth Kadiyala 3990376c57 Internals: resolved incorrect array bounds guarding (#8224)
Co-authored-by: Sumanth Kadiyala <[email protected]>
2026-09-05 15:33:06 -04:00
Geza Lore d04647f459 Fix library method argument references (#8252)
Each VCMethod now carries a signature describing the access required of
the references passed as arguments to the call. 'r' if the argument is
read, 'w' if it is fully assigned so the old value does not matter, 'm'
if it is modified (or only conditionally assigned), with a trailing '+'
repeating the preceding entry for all remaining arguments.  Signatures
are validated at compile time, and V3Broken checks the arguments of
every AstCMethodHard against them.

The incorrect references this found and that are easy to fix are
repaired in this patch. "TODO" marks method that are currently broken or
not yet fit the scheme, these will be fixed in follow up patches.

Also renames SCHED_COMMIT and SCHED_ENQUEUE to NBA_COMMIT and
NBA_ENQUEUE, and remove unused methods.
2026-09-05 19:48:07 +01:00
Matthew Ballance 338c6c2885 Fix covergroup-internal references multi-threaded ordering (#7779) (#8255) 2026-09-05 14:08:03 -04:00
Aditya Shevade a6e21e0eb7 Fix phased solve...before diversity (#8189) (#8194) 2026-09-05 14:06:57 -04:00
Geza Lore f2fe2b6f2e Optimize Dfg synthesis of simple continuous assignments (#8286) 2026-09-05 13:07:53 -04:00
Geza Lore bcf613c4fe Optimize redundant memoization in DFG CSE (#8285) 2026-09-05 12:13:11 -04:00
Geza Lore b907a1a75d Optimize DFG vertex iteration callbacks (#8284) 2026-09-05 12:12:46 -04:00
Geza Lore 87108ff943 Optimize redundant vertex cache lookups in DFG peephole (#8283) 2026-09-05 11:13:30 -04:00
Geza Lore fa59f8f302 Optimize DFG synthesis symbol table ordering (#8282) 2026-09-05 11:13:09 -04:00
Wilson Snyder 35c1a244a8 Internals: Introduce Ast{class}::Super and cleanup. No functional change intended (but possible if was wrong base used earlier) 2026-09-05 10:45:39 -04:00
Wilson Snyder 3493e409b8 Internals: Sort Ast{class} functions in src/V3AstNodes.cpp, and enforce. No functional change. 2026-09-05 10:38:18 -04:00
Wilson Snyder 4f557a4b0c Internals: Reorganize non-Ast{class} functions in src/V3AstNodes.cpp. No functional change. 2026-09-05 10:32:27 -04:00
Wilson Snyder 13c60bfede Commentary: Changes update 2026-09-05 10:10:10 -04:00
Wilson Snyder d6441c9cd3 Change JSON dumps to suppress empty strings, etc 2026-09-05 10:09:25 -04:00
Wilson Snyder 32695cf8be Tests: Enforce Ast*::dump/dumpJson member dumps 2026-09-05 10:06:14 -04:00
Wilson Snyder 5ab54f3c01 Commentary. (Restore CONTRIBUTORS from earlier rev) 2026-09-05 10:05:47 -04:00
Wilson Snyder c1c19494c4 Revert 81fafe237e: Fix CMake to call Verilator perl wrapper (#8269 revert) (#8270 revert) 2026-09-05 09:59:16 -04:00
Wilson Snyder e7b30e214e Internals: Add missing classes to dumps(), enforce with new test. No simulation change. (#8293) 2026-09-05 09:50:13 -04:00
Drew Risinger 81fafe237e Fix CMake to call Verilator perl wrapper (#8269) (#8270) 2026-09-05 09:47:15 -04:00
Wilson Snyder 80de081af0 devel release 2026-09-05 08:45:33 -04:00
Wilson Snyder ea338be98e Version bump 2026-09-05 08:28:17 -04:00
Wilson Snyder c8a8f02c09 Commentary: Changes update 2026-09-05 08:27:32 -04:00
Nick Brereton b1c06fdb09 Fix use-after-free of captured interface typedef in deleted generate branch (#8287) 2026-09-04 14:27:11 -04:00
Andrii 18095ac924 Fix incorrect reference to sync/async in SYNCASYNCNET warning (#8281)
Signed-off-by: Andrii Andrieiev <[email protected]>
2026-09-04 11:01:10 -04:00
Aditya Shevade efc390a37d Fix std::randomize() with-clause array index arguments (#8279) (#8280) 2026-09-04 11:00:10 -04:00
Aditya Shevade 228635918e Fix mis-randomizing an unpacked struct member when not rand/randc (#8277) (#8278) 2026-09-03 20:08:44 -04:00
Wilson Snyder c917f04c65 Internals: Fix many but not all missing member dumps. No functional change. 2026-09-02 22:27:19 -04:00
Wilson Snyder c4a4f35ec4 Commentary: Changes update 2026-09-02 22:15:13 -04:00
Wilson Snyder e012f7c79d Fix segmentation fault on context destruction (#8265).
Fixes #8265.
2026-09-02 08:00:32 -04:00
Wilson Snyder 80907b1e26 Internals: Fix many but not all missing bool member dumps. No functional change. 2026-09-01 22:20:20 -04:00
Wilson Snyder a5f4f7eade Internals: Fix covergroupRefMember overload (#8259).
Fixes #8259.
2026-09-01 21:31:19 -04:00
Wilson Snyder c7aa95439c Internals: Cleanup some member name vs accessor name mismatches. No functional change. 2026-09-01 20:10:04 -04:00
Wilson Snyder a3932e259b Internals: Cleanup duplicate superRef. No functional change. 2026-09-01 20:01:20 -04:00
Wilson Snyder e6cee9d54c Tests: Check for binary files 2026-09-01 18:30:29 -04:00
Wilson Snyder f694e9e1e8 Revert NFA assertion outcomes (#7946 revert) (#8258) 2026-09-01 11:15:05 -04:00
Wilson Snyder 667f64813f Commentary: Changes update 2026-09-01 08:46:25 -04:00
Wilson Snyder 67818a3430 Internals: Fix unknown node message in V3Simulate. No simulation change intended. 2026-09-01 08:43:43 -04:00
Wilson Snyder 1c2fa7234d Fix removing extra width warnings after another error 2026-08-31 18:04:58 -04:00
Szymon Gizler be83d1393d Fix continuing on wait(0) (#7372) (#8231) 2026-08-31 13:06:23 -04:00
Matthew Ballance 9474a01d54 Add definitions for odr-used constexpr, as required by C++14 (#8256) 2026-08-31 10:38:18 -04:00
Yilou Wang c81be029a6 Fix NFA assertion scheduling to fix outcome counts (#7946) 2026-08-29 15:53:08 -04:00
Wilson Snyder 3c121c0a2e Fix initial statements with gate optimizaion (#8250) (#8253) 2026-08-29 14:29:03 -04:00
Wilson Snyder 0f96460042 Commentary: Changes update 2026-08-29 11:46:16 -04:00
Wilson Snyder 648035df72 Tests: Cleanup some time formats 2026-08-29 11:13:47 -04:00
Geza Lore dcf45da1c0 Fix excessive SIMILARNAME warnings (#8233) 2026-08-28 15:55:41 -04:00
Kamil Danecki d2920a627d Support solve before with associative array (#8232) 2026-08-28 15:19:08 -04:00
Paul Rigge 2954756190 Fix VL_MULS_* UB on signed int overflow (#8247) (#8248) 2026-08-28 14:53:22 -04:00
Geza Lore c70439961f Optimize associative constant patterns to fixed point (#8147) (#8209)
Re-associating constants can enable further simplification e.g. when
those constant become all zero/all ones. Run these patterns to fixed
point to capture the simplification, by revisiting the node.
2026-08-28 20:46:33 +02:00
Geza Lore ab20edbbaf Internals: Use single source of truth VCMethod enumeration (#8249) 2026-08-28 14:32:08 -04:00
Geza Lore 297713df8b Fix folding of short circuiting operators guarding member access (#8238)
V3Const eagerly deletes nodes (we want that in V3Const instead of using
pushDeletep, as otherwise the transient peak memory use during
verilation can be very high)

The std::map used to cache the predicate checking if a subtree contains
a member access then stale if a new node is allocated in the same address.

Fix by using unique node IDs stored in user4 as cache keys.

This is the bug uncovered by #8147

Related to #6963
2026-08-28 20:16:03 +02:00
Geza Lore 6a05cc680b CI: Update RTLMeter case lists - also for PRs 2026-08-28 17:40:46 +02:00
Geza Lore 50e42bc197 CI: Update RTLMeter case lists
- Only run Servant:*:phil on multi-threaded clang build
- Run HummingbirdV2-E203
2026-08-28 16:51:14 +02:00
Geza Lore c64afda7fc Fix MULTIDRIVENPROC on static loop induction variables (#8242)
Disable MULTIDRIVENPROC for static variables used as loop induction
variables. Same way as we disable similar warning in Dfg. While bad
style and bad for performance, it's common legacy code style.
2026-08-28 15:27:50 +02:00
Igor Zaworski 1ad9acd22e Fix scheduling of variables written in non-inlined functions in suspendable processes (#7909) 2026-08-27 08:33:49 -04:00
Jakub Wasilewski 2f856971ed Add Unigen2 constrained randomization algorithm (#8042)
Signed-off-by: Jakub Wasilewski <[email protected]>
2026-08-27 08:33:14 -04:00
Geza Lore 8546d5db06 Internals: Move the eval loop into the runtime library (#8225)
The loops modelling the SystemVerilog scheduling regions are no longer
generated. They now live in 'VerilatedEvalLoop' in the runtime library.
The generated model holds one as a member, passing itself to it, and
exposes each evaluation entry point to it as a pure virtual method on
VerilatedModel. The model's 'eval' and 'eval_step' remain the top level
entry points, and are backward compatible.

V3Sched no longer emits '_eval' or '_eval_settle', etc.. Instead every
evaluation entry point called from the runtime is enumerated by 'VEval',

Scheduling creates all entry points, for all scheduling regions, even if
they are empty, and the runtime eval loop calls everything
unconditionally. If regions are empty, this is simply a call to an empty
function. This will hurt performance on very small models, but should
not be noticeable on anything meaningful, so it is likely best to keep
to reduce complexity.

A scheduling entry points evaluate a single iteration and returns
whether it did any work, they are effectively the previous
`_eval_phase_*` functions.
2026-08-27 07:53:02 -04:00
Geza Lore 59f221986c Fix errors on stream connected to instance port (#8234) 2026-08-27 07:51:35 -04:00
Sumanth Kadiyala 99c6f9ced8 Internals: Add flag to replace VNUser union w/ std::variant for type validation (#8213) 2026-08-26 20:09:21 -04:00
Eddie Rydell 7bff0196b1 Fix procedural tristate assignment overrides (#6785) (#8130) 2026-08-26 19:23:46 -04:00
Kamil Danecki f055eeabe0 Support soft foreach in constraint (#8174) 2026-08-26 11:05:12 -04:00
Artur Bieniek 7f9333723f Fix sampled-value functions output on the first cycle (#8162) 2026-08-26 10:30:59 -04:00
Pawel Klopotek cce0277e1a Fix backslash behavior in string literals (#8211)
Signed-off-by: Pawel Klopotek <[email protected]>
2026-08-26 10:02:39 -04:00
Wilson Snyder 51a2dc3efb Commentary: Changes update 2026-08-26 06:09:57 -04:00
Wilson Snyder 0dcdea3325 Commentary: AGENTS tweaks 2026-08-26 06:09:50 -04:00
Wilson Snyder 1cd2588241 Tests: Print stats with --benchmark 2026-08-26 06:02:27 -04:00
Geza Lore 087b15bdb3 Remove source location from DIDNOTCONVERGE error (#8225 prep) (#8227) 2026-08-26 04:55:36 -04:00
Aliaksei Chapyzhenka 5e4151e3e0 Internals: Add WASI (wasm32-wasip1) build support (#8216) (#8217) 2026-08-25 19:13:07 -04:00
Aisha b23b53227d Fix SIMILARNAME warning on parameters and localparams (#8186) (#8226) 2026-08-25 16:19:41 -04:00
Yilou Wang 8cbaf505ee Fix solver session stability to avoid breaking randomize (#7991) 2026-08-25 13:13:59 -04:00
Matthew Ballance 0b85b80ece Fix method calls to be a reorder barrier (#8222)
Signed-off-by: Matthew Ballance <[email protected]>
2026-08-25 13:09:14 -04:00
Pawel Klopotek 821478070d Fix V3Task Inout pin resizing error (#8212) 2026-08-25 10:27:24 -04:00
Artur Bieniek 69f42ea480 Support s_until/s_until_with in property expression (#8220) 2026-08-25 10:26:43 -04:00
Artur Bieniek f6d56c6440 Optimize consecutive repetiton and goto repetition using ring-buffer (#8096) 2026-08-25 08:26:46 -04:00
Geza Lore 538c6a6b76 Fix unoptimized code generation for postponed region (#8218) 2026-08-25 10:31:36 +02:00
Wilson Snyder 1c9a9e0cce Tests: Rename some mis-grouped tests 2026-08-24 18:41:25 -04:00
Wilson Snyder 6fc18710bd Commentary: Changes update 2026-08-24 18:16:58 -04:00
Yilou Wang 67cbc36ef0 Fix randomize misreading solver replies and applying partial models (Part3a of #7991) (#8136) 2026-08-24 18:14:06 -04:00
dependabot[bot] 2cd0efbc0f CI: Bump docker/setup-buildx-action in the everything group (#8210) 2026-08-24 12:28:51 -04:00
Yilou Wang 3c027baa44 Fix $past in final blocks on a sampling-tick finish (#8153) 2026-08-24 11:09:02 -04:00
Artur Bieniek 33ad9d530e Fix V3Width SVA bound limit guard, leave headroom for alignment, respect --max-num-width (#8192)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-24 08:57:18 -04:00
Jonathan Drolet d0321b8502 Fix VPI force data corruption (#8160) 2026-08-24 08:21:13 -04:00
Geza Lore ee8e2c0e12 Internals: Fix regression badge in README 2026-08-24 08:03:00 +02:00
Geza Lore 8fc78e31d7 CI: Name build-test.yml 'Regressions' 2026-08-24 08:03:00 +02:00
Wilson Snyder 477b48fb3d CI: Add pr-conflicting.yml 2026-08-23 18:48:57 -04:00
Wilson Snyder df0d801790 Internals: Duplicate code cleanup. No functional change intended. 2026-08-23 16:24:59 -04:00
Wilson Snyder d2760be0d4 Fix fork no-timing and constructor no-timing message 2026-08-23 16:24:59 -04:00
Wilson Snyder d18bcc2a69 Commentary: Changes update 2026-08-23 16:24:59 -04:00
Geza Lore 8a45a2d46e CI: Reduce verbosity of the Pages job 2026-08-23 19:56:26 +02:00
Marco Bartoli 63a59fce22 Fix typedef clocking input sampling (#7688 partial) (#8204) 2026-08-23 10:38:28 -04:00
Marco Bartoli c4b84b20f7 Support covergroup events with reference members or ref arguments (#8201) 2026-08-23 10:35:43 -04:00
Aditya Shevade d5f7878eb4 Fix internal error on an enum literal inside a with lambda body (#8190) (#8193) 2026-08-23 07:47:43 -04:00
github action 459711ba71 Apply 'make format' [ci skip] 2026-08-22 19:46:51 +00:00
Marco Bartoli 0820506d74 Support covergroup/function/task (ref/virtual/array) interface arguments (#8180) 2026-08-22 15:46:07 -04:00
Geza Lore 063b938f41 CI: Fold up old notification comments on PRs
Notifications posted on pull requests now carry a marker naming their
source, as an HTML comment on their first line, which is invisible when
rendered. When posting, 'ci-pages-notify.bash' finds its own earlier
notifications with the same marker on that pull request, and deletes them.
A pull request therefore holds a single comment per source, rather than
accumulating one per run.

The superseded comments are not lost entirely. Each notification carries a
one line summary linking its report, stashed in an HTML comment, and the
notification superseding it inherits that summary, together with the
history the superseded one held itself, into a collapsed 'Workflow history'
section. That section therefore lists all the earlier reports, stays flat
however many runs a pull request sees, and holds no entry for the report
shown right above it.

The 'pr-notification' artifact is now uploaded via the new reusable
'upload-pr-notification' action, which validates the content the reporting
scripts produced, and records the source key and the pull request number
alongside it.

Fixes #8037
2026-08-22 18:40:14 +02:00
Geza Lore cb618d6f9c CI: Factor out coverage report generation 2026-08-22 18:40:14 +02:00
Wilson Snyder 4aceba1106 Fix internal on backslash quoted strings (#8198).
Fixes #8198.
2026-08-22 10:51:45 -04:00
Wilson Snyder d359a9ce3c Commentary: Changes update 2026-08-22 10:47:46 -04:00
Artur Bieniek 3dbfa7708f Add NEVERMATCH warning when an SVA sequence can never match (#8176) (#8183)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-22 08:31:23 +02:00
Geza Lore cda258cbed Fix crash on multiple missing type parameters (#8184) 2026-08-21 17:15:41 -04:00
Wilson Snyder cccf7ef1b3 Internals: Fix clang warning (earlier commits) 2026-08-21 17:03:10 -04:00
Wilson Snyder 8844593abb Internals: Cleanup code duplication. No functional change intended. 2026-08-21 16:51:19 -04:00
Wilson Snyder 9badc5485d Internals: Cleanup code duplication. No functional change intended. 2026-08-21 16:51:19 -04:00
Wilson Snyder fd319beb8a Internals: Cleanup code duplication. No functional change intended. 2026-08-21 16:51:19 -04:00
Ryszard Rozak c9e270a9fa Internals: V3Randomize cleanup. No functional change intended (#8187)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-08-21 16:36:52 -04:00
Geza Lore d1067002da Fix crash on empty '#()' parameter list on class instance (#8182)
The following used to crash:

```systemverilog
    class base #(type T = int); endclass
    class derived extends base; endclass
    derived #() d; // <- crash due to '#()'
```
2026-08-21 18:16:09 +02:00
Geza Lore a7ecba4f4e Fix crash on forward-referencing parameters (#8175) 2026-08-21 17:47:10 +02:00
Wilson Snyder 99c26d3994 Update linfstwriter from upstream (#7193 prep) (#8181) 2026-08-21 16:35:15 +02:00
Todd Strader e656b11cd1 Internals: Dev coverage tweaks (#8161) 2026-08-21 12:27:52 +02:00
Artur Bieniek f7c087468d Support overlong within sequences as never-matching (#8177)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-20 15:20:54 -04:00
Andrii 227e432695 Fix invalid conversion of VlQueue (#8172)
Signed-off-by: Andrii Andrieiev <[email protected]>
2026-08-20 07:09:05 -04:00
Geza Lore 38ae4e617d CI: Cache archives downloaded by apt (#8159)
Belt-and-braces in case GitHub apt mirrors start acting up again: On any
successful apt install, cache the deb files downloaded/needed for the
step, so on next run the mirrors need not be consulted. (That is: trade
apt mirror access with GitHub cache access, which is more reliable)
2026-08-20 11:16:17 +02:00
Andrii e717c513e9 Fix null pointer dereference in killQueue (#8171)
Signed-off-by: Andrii Andrieiev <[email protected]>
2026-08-20 10:55:45 +02:00
Kornel Uriasz f6f6f84047 Fix array reference in reduction constraints (#8158)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-19 15:52:04 +02:00
Geza Lore cacadd6c7d CI: Add timeout to apt install steps (#8154)
These tend to hang for hours on occasion. Install all apt dependencies
via ci-install.bash, and add a hard timeout and retry for each attempt.

Also removed unnecessary man-db config (GitHub has this off by default
now) and ineffective install path exclusions.
2026-08-19 15:34:57 +02:00
Geza Lore 65094514d6 Tests: Automatically disable ASLR under TSAN (#8156) (#8157)
Fixes #8156
2026-08-19 15:25:07 +02:00
Wilson Snyder f88b59f39f Revert fixed point (#8147 revert) (#8155) 86b7cfb05c 2026-08-19 07:54:42 -04:00
Wilson Snyder 700858c112 Commentary: Changes update 2026-08-19 07:50:32 -04:00
Geza Lore 2ba4bd9211 Internals: Add more statistics in V3Expand
- Per pattern stats, similar to DfgPeephole
- Impure rejection count
- Number of temporaries introduced

Tweak output for consistency
2026-08-19 13:28:01 +02:00
Geza Lore 7523a0cd8e Fix exponential expansion of nested selects (#8137) (#8151)
Fixes #8137
2026-08-19 11:00:47 +02:00
Artur Bieniek 8c2b7410f0 Optimize NFA delay-ring edge traversal, drop complexity to linear (#8145)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-19 04:02:11 -04:00
github action 70b5ce802b Apply 'make format' [ci skip] 2026-08-19 06:46:09 +00:00
Sumanth KadiyalaandSumanth Kadiyala 88e87b8abb Fix segmentation fault on parameters (#8102) (#8149)
Co-authored-by: Sumanth Kadiyala <[email protected]>
2026-08-19 02:45:35 -04:00
Pawel Klopotek 7628a540af Fix invalid C++ on cast (#8113)
Signed-off-by: Pawel Klopotek <[email protected]>
2026-08-19 08:29:29 +02:00
Artur Bieniek 06ee8b7261 Use unsigned in NFA, guard against overflow using V3Width. (#8152)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-19 08:05:05 +02:00
Pawel Klopotek f5ae58ddab Fix unpacked array passing to logic task arg error (#8148)
Signed-off-by: Pawel Klopotek <[email protected]>
2026-08-19 08:04:28 +02:00
Geza Lore 86b7cfb05c Optimize associative constant patterns to fixed point (#8147)
Re-associating constants can enable further simplification e.g. when
those constant become all zero/all ones. Run these patterns to fixed
point to capture the simplification, by revisiting the node.
2026-08-18 19:41:24 +02:00
Yilou Wang 8a29360ade Fix NFA assertion crash and mis-counted property if/case (#8074) 2026-08-18 18:30:38 +02:00
Marco Bartoli b032379de2 Support coverpoint and cross iff (#8125) 2026-08-18 09:46:31 -04:00
Geza Lore ba893abb2c Optimize circular logic in Dfg (#7902)
Introduce a new DfgPrev vertex, representing the value of a variable
before any in-graph assignments. This can be used to break all remaining
cycles in the graph, so all Dfgs become acyclic after V3DfgBreakCycles.
The circular dataflow is still represented, and is taken care of by the
scheduler, it is just the DfgGraph that represents the logic that
becomes acyclic.

This makes V3DfgBreakCycles a mandatory transform, so drop the disabling
-fno-dfg-break-cycles option (still parsed, but has no effect).

Note the effect of this is small, as most cycles can be fixed up by
driver tracing, which is unchanged, but this is required for some
upcoming work.
2026-08-18 14:54:12 +02:00
Geza Lore 94a63dd407 Fix streaming concatenation uninitialized RMW access (#8143) 2026-08-18 12:03:51 +02:00
Geza Lore d9fb606869 Internals: Move DPI export AstScopeName out of statement list (#6280) (#8139)
AstScopeName is an AstNodeExpr, but V3Task stashed the DPI export scoping
marker into the enclosing AstCFunc's statement list (addStmtsp), placing an
expression in a statement position.

Give AstCFunc a dedicated 'scopeNamep' operand to hold the marker instead.
Part of #6280
2026-08-18 11:25:12 +02:00
Geza Lore 8baff6ae33 Internals: Don't wrap elaboration severity task in an AstInitial (#6280) (#8142)
An elaboration severity system task ($info/$warning/$error/$fatal used
as a module/generate/program/checker item), which is a module item,was
parsed as an AstInitial wrapping an AstElabDisplay. That put
AstElabDisplay (a non-statement) into the procedural statement list of
an AstInitial.

AstElabDisplay is evaluated by V3Width, which then deletes it. The
AstInitial wrapper is historic and has no effect.

Part of #6280
2026-08-18 11:19:50 +02:00
Geza Lore 7c6b225b7e Internals: Make AstConstraintBefore an AstNodeStmt (#6280) (#8141)
AstConstraintBefore ('solve x before y') is a constraint item that appears
in constraint bodies alongside its siblings AstConstraintExpr,
AstConstraintUnique and AstConstraintIf, all of which are AstNodeStmt.
Part of #6280.
2026-08-18 11:19:40 +02:00
Geza Lore 2a9757bf38 Internals: Make AstCLocalScope an AstNodeStmt (#6280) (#8140)
AstCLocalScope wraps statements in an unnamed C++ scope ('{ ... }') and is
only ever placed in statement position. Part of #6280.
2026-08-18 11:19:27 +02:00
Kornel Uriasz 74d12c5b5e Fix 'get-value' for empty constrained arrays (#8138)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-18 10:05:00 +02:00
Geza Lore d4a18d4dfb Fix unordered data hazards in multi-threaded scheduling (#8133)
The OrderGraph used during V3Order step deliberately omits some variable
accesses from the dependency graph. E.g.: a read of a variable that is
in the reading block's own hybrid sensitivity list emits no edge, nor
does a read ignored due to a force/release, nor an access to a variable
marked 'ignoreSchedWrite' and friends. For serial mode that is fine, the
logic runs one block at a time. In parallel mode two such blocks can run
concurrently, and if one writes what the other reads, that is a data
race at runtime.

These accesses cannot be recovered from the graph edges. They are now
collected from the AST while the OrderGraph is built, and held by the
OrderLogicVertex performing them.

FixDataHazards is reworked around these access lists stored in
OrderLogicVertex, so it is now aware of all variable accesses the logic
makes, including those not encoded by the dependency graph edges. The
previous heuristic of fixing data hazards by merging same-rank MTasks is
removed. Additional edges are inserted instead to prescribe a fixed
ordering of conflicting MTasks. To insert edges without unduly
increasing the critical path, or introducing cycles, new edges are
added such that they preserve topological ordering, and they are
inserted between vertices sorted by critical path length. See algorithm
details in the code.

Also add a data hazard checker under '--debug-partition', reporting every
unordered accessor pair left in the final MTask graph.

This fixes the race demonstrated by t_sched_hybrid_hazard (#7913),
which is no longer expected to fail.

Under ThreadSanitizer over the vltmt tests: 17 failing before, 3 after,
with no regressions. The 3 remaining are different defects.
2026-08-18 08:50:50 +02:00
github action 96ea587df0 Apply 'make format' [ci skip] 2026-08-18 06:07:36 +00:00
Sunimali Rathnayake 2d8d8add42 Fix public table offsets larger than 32 bits (#8135) 2026-08-18 08:06:53 +02:00
Geza Lore 7dcd4e0b65 Improve MTask coarsening in multi-threaded scheduling (#8120)
This is a large refactor of the MTask graph and coarsening algorithm, in
prep for fixing the bug described in #7913, it can also improve the
resulting multi-threaded schedule.

Two major changes:

OrderMTaskGraph now maintains the critical paths of the MTasks through
mutation. There are 2 ways to mutate the graph, which are done via
methods on the graph itself: adding an edge (used during construction,
and will be used later during fixing data hazards), or merging an MTask
into another (used during contraction). All critical path measures are
automatically updated and propagated on any mutation, so no external
algorithm needs to maintain them explicitly.

The merge candidate scoreboard used during contraction is simplified to
remove deferral of updated scores. This simplifies the code and results
in a greedily more optimal schedule. (The previous tranched rescore was
an optimization to work around the previous std::set based scoreboard,
however since the algorithm now uses an efficient PairingHeap,
verilation time is not impacted by the more accurate scoring, while
yielding better results).

Combining these two into a single patch as the code is highly
interdependent and any one change without the other would be just a
noisy transit point with unclear performance implications. Together it
should be a clear improvement.

Also added a stronger validation step run with '--debug-partition',
which checks all invariants throughout the algorithms.
2026-08-17 23:14:52 +02:00
Yilou Wang ace84ef2b3 Fix simulation hang when the solver stops answering (Part2 of #7991) (#8129) 2026-08-17 13:01:41 +02:00
Matthew Ballance a3553e7bee Add runtime support for covergroup cross-points (#7847) 2026-08-16 15:33:38 -04:00
Wilson Snyder e2f7755611 Tests: Fix whitespace 2026-08-15 07:08:53 -04:00
em2machine d2f62fda93 Fix use-after-free of captured interface typedef reference during parameter cloning (#8076) 2026-08-15 06:07:01 -04:00
em2machine 93401038c0 Fix reading another parameter resolves to 0 in cloned modules (#8086) (#8069) 2026-08-15 06:06:25 -04:00
github action 3334576b1d Apply 'make format' [ci skip] 2026-08-15 01:00:00 +00:00
Wilson Snyder 6d6d15e003 Tests: Fix side-effects in checkd randomize 2026-08-14 20:59:19 -04:00
Wilson Snyder d6b206cc7d Internals: Cleanup some VPI messages and fix test coverage 2026-08-14 19:47:45 -04:00
Wilson Snyder edd4cd4faf Tests: Cleanup false suppressions in t_dist_warn_coverage.py 2026-08-14 18:55:41 -04:00
Wilson Snyder 91216bdac1 Tests: Add uvm-2020-3.2-vlt 2026-08-14 18:31:23 -04:00
Wilson Snyder 92300ab675 Commentary: Changes update 2026-08-14 18:28:19 -04:00
Artur Bieniek 0b50390359 Fix COVERIGN on SVA goto repetition (#8118)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-14 13:52:10 -04:00
Geza Lore 621a67e819 Fix R/W references to random builtin function seeds (#8112) 2026-08-14 12:29:12 -04:00
Adam Kostrzewski 75a776c516 Fix invalid typedef linkdot (#8106)
Signed-off-by: Adam Kostrzewski <[email protected]>
2026-08-14 12:28:35 -04:00
Demin Han 743e0f4a82 Fix the clang compilation using pch (#8105)
Signed-off-by: Demin Han <[email protected]>
2026-08-14 12:19:28 -04:00
Adam Kostrzewski 649598c74c Fix unintended side-effect insertion on associative array read (#8077) 2026-08-14 15:23:44 +02:00
Geza Lore 0a3657517d Optimize temporary insertion for single bit replicates in DFG (#8110)
A '{N{bit}}' mask expands to a bit vector where every word is the same
value, obtained by negating the replicated bit. Recomputing that at each
use is no more expensive than loading it
2026-08-14 14:58:31 +02:00
Kornel Uriasz 2957939d4b Throw unsupported when reduction constraining dynamic subarray (#8111)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-14 07:56:31 -04:00
Yilou Wang abf199cf0e Fix randc cycling in a class that also uses solve...before (Part1 of #7991) (#8055) 2026-08-14 07:16:44 -04:00
Marco Bartoli 7da43d8302 Support class handle covergroup arguments (#8071) 2026-08-13 20:41:39 -04:00
Wilson Snyder c8853d1507 Tests: Reformat some recent tests to mostly verilog-format standard. No test functional change. 2026-08-13 18:59:37 -04:00
Wilson Snyder edf43ae76f Tests: Rename inf to avoid VAMS errors 2026-08-13 18:59:37 -04:00
Wilson Snyder 63478f2946 Commentary: Changes update 2026-08-13 18:59:37 -04:00
Artur Bieniek 95721f5040 Optimize NFA ring buffer clear operation using lazy invalidation (#8101)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-13 18:54:57 -04:00
Geza Lore 1397d5d01e Optimize VL_WORDS_I/VL_BYTES_I (#8095) 2026-08-13 14:44:04 -04:00
github action 098f375e9d Apply 'make format' [ci skip] 2026-08-12 23:13:40 +00:00
Sumanth KadiyalaandSumanth Kadiyala 44fe96b2da Add +verilator+assert+lock to ignore RTL assert control statements (#8086)
Co-authored-by: Sumanth Kadiyala <[email protected]>
2026-08-12 19:13:02 -04:00
Artur Bieniek 0ebb92da26 Fix hierarchical class scope resolution (#8094)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-12 15:29:04 -04:00
Artur Bieniek 73bcf5e0db Fix NFA range ring outgoing bit selection (#8061 repair) (#8092)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-12 12:28:32 -04:00
Artur Bieniek e962efca12 Fix untyped dtype error on sampling functions with property arguments (#8060)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-12 05:16:48 -04:00
Wilson Snyder 0b51926fff Commentary: Changes update 2026-08-11 20:05:01 -04:00
Wilson Snyder 08cd5fe30b Tests: Reformat some recent tests to mostly verilog-format standard. No test functional change. 2026-08-11 20:04:45 -04:00
Nikolai Kumar da0c31926e Fix forceable unpacked array element force with procedural assign (#8084) (#8085) 2026-08-11 17:09:33 -04:00
Todd Strader e96cfc5e56 Tests: More VPI simulator support (#8083) 2026-08-11 15:14:01 -04:00
Igor Zaworski 2ef131f7ac Fix scheduling of variables written in non-inlined functions in suspendable processes (#7924)
Repair of reverted #7836

Signed-off-by: Igor Zaworski <[email protected]>
2026-08-11 13:18:18 +01:00
Igor Zaworski 945ea27fec Fix undefined symbol solver error (#8080)
Signed-off-by: Igor Zaworski <[email protected]>
2026-08-11 07:33:37 -04:00
Artur Bieniek 490bd38962 Optimize bounded always properties using ring buffers (#8061)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-10 08:45:50 -04:00
Bartłomiej Chmiel 121fc62aff Fix VPI cbValueChange for 1-bit select (#8063) 2026-08-10 07:52:18 -04:00
Paul Campbell 5d888d2ac0 Add SIMILARNAME warning when variables have names that only differ in lexical case (#7992) (#8020) 2026-08-10 06:57:58 -04:00
Kornel Uriasz 38259d11b6 Fix skipping non-constrained enum constraining when inside object of other class (#8075)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-10 06:52:14 -04:00
Tyrone Marhguy 86fa00416d Fix Linux peak memory stat to use VmHWM (#8022) (#8070) 2026-08-09 15:37:57 -04:00
Marco Bartoli 645b8cdf24 Support embedded covergroup clocking events (#8028) 2026-08-09 13:55:04 -04:00
Yogish Sekhar dde6aa34ce Fix FSM coverage on empty reset branches (#8005) (#8064) 2026-08-08 19:44:46 +01:00
Wilson Snyder 7601011bba Internals: Cleanup some user() comments. No functional change.
Fixes #8048.
2026-08-08 13:05:05 -04:00
Wilson Snyder 18844537bd Commentary: Changes update 2026-08-08 12:58:32 -04:00
Kamil Danecki 7e80ea6577 Support default clocking (#7984) 2026-08-07 13:21:18 +01:00
Nikolai Kumar 82dab79096 Fix wildcard equality against a 4-state constant in an assertion (#8056) (#8057) 2026-08-07 07:48:51 +01:00
Artur Bieniek 1a4bcac666 Support weak/strong keywords in property expressions (#8054)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-06 07:48:00 +01:00
Artur Bieniek e413e67ab3 Fix force helpers in multiply instantiated modules (#8047)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-05 16:47:45 -04:00
Artur Bieniek b1ec180a3b NFA simplification: do not pass arguments which values are derivable (#8053)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-05 12:40:12 -04:00
Marco Brambilla 1f164d7ee0 Fix wait fork trigger temporary split across generated functions (#7985) (#7986)
splitCheck() cuts a function's top level statement list on node count
alone, ignoring AstVar declarations in that list. localizeVars() puts the
dynamic trigger temporaries there, which a 'wait fork' reaches, so the
declaration could land in one sub-function and its references in another.
Sub-functions are emitted as separate C++ functions, so the output failed
to compile:

    error: '__Vtrigprevexpr_h5d9da2ce__0' was not declared in this scope

V3InlineCFuncs could also inline the sub-function holding the declaration
and free the AstVar while other sub-functions still referenced it, which
--debug reports as a broken link and which segfaults an -O3 build.

The existing "Can't split function with local variables" assertion only
checked AstCFunc::varsp(), not declarations among the statements.

Only allow a sub-function boundary where it does not separate a local
declaration from a reference to it. This keeps the temporaries function
local, as #6859 requires, while restoring the guarantee #5822 made that
splitting cannot orphan them.

Signed-off-by: Marco Brambilla <[email protected]>
2026-08-05 17:33:58 +01:00
Kornel Uriasz 3fa88ae7f3 Fix array size references in constraints (#8040)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-05 12:07:28 -04:00
Nikolai Kumar 351d67c81e Fix pin to non-existent port with PINNOTFOUND suppressed (#8051) (#8052) 2026-08-05 12:00:32 -04:00
Sumanth KadiyalaandSumanth Kadiyala 472a131df7 Fix nondeterminism in trace stage (#8046)
Co-authored-by: Sumanth Kadiyala <[email protected]>
2026-08-05 02:51:51 -04:00
Bartosz Skorowski e6c613f28d Fix write access to dynamic arrays (#8043)
Signed-off-by: Bartosz Skorowski <[email protected]>
2026-08-04 13:27:08 -04:00
Artur Bieniek e4b6bac50a Fix mid-range consecutive repetition rejects (#8041)
Signed-off-by: Artur Bieniek <[email protected]>
2026-08-04 17:50:33 +01:00
Pawel Klopotek 3c4ea47e02 Fix conditional expression with parameterized classes (#8039)
Signed-off-by: Pawel Klopotek <[email protected]>
2026-08-04 15:50:12 +01:00
github action 5bd8c49448 Apply 'make format' [ci skip] 2026-08-04 08:37:04 +00:00
JOTEGO ba8e4f9dec Fix gate deduplication with function arguments (#8038) 2026-08-04 04:36:25 -04:00
Kornel Uriasz 15b75c7c68 Fix skipping optimization for unpacked data types (#8031)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-04 01:48:15 -04:00
Yilou Wang 925a6640d1 Fix queued $finish/$stop request thread ordering (#7946 prep) (#7952) 2026-08-04 01:46:54 -04:00
Geza Lore b42d7c2d9e Internals: Move critical path propagators to MTaskGraph from Contraction
Code movement only prep for further work. No functional change, output
should be identical.
2026-08-03 17:35:10 +01:00
Geza Lore d58f512a85 Internals: Remove stepCost use in MT scheduling (#8032)
MT scheduling used to round MTask costs to the nearest 5% to supposedly
reduce the amount of work required for propagating critical path change
updates. Profiling shows this doesn't actually save any verilation time,
as the floating point arithmetic itself is costly, and the propagation
savings only kick in when merging small tasks into large ones, which is
not the common case. (The float arithmetic also made this step
non-reproducible across host architectures and libm versions  due to
numerical variance.)

Remove and use precise costs instead.
2026-08-03 17:34:44 +01:00
Nick Brereton 1356c15e44 Fix use-after-free in V3LinkDotIfaceCapture (#7943) 2026-08-03 15:55:30 +01:00
dependabot[bot] 3c47e5735a CI: Bump docker/login-action from 4.5.1 to 4.6.0 in the everything group (#8033) 2026-08-03 15:55:00 +01:00
Geza Lore 0750e18ad0 Internals: Remove ordering before MTask contraction (#8019)
As the removed comment suggests, this is dubious and RTLMeter suggests
it makes no measurable difference on average (some designs improve, some
regress small amounts, on average ~1.0x)

Prep for further fixes that will remove the pre ranking.
2026-08-03 10:44:51 +01:00
David Garau a24dd8b2dc Fix generic interface param resolution in module/cell parameterization (#7970) (#7971) 2026-08-03 05:18:59 -04:00
Yilou Wang 2022bacd38 Fix timing controls in interface tasks called via virtual interface (#7959) 2026-08-03 05:15:07 -04:00
Aisha 29fd2cf90d Add MULTIDRIVEN checks for clocking block outputs (#7987) 2026-08-03 04:54:43 -04:00
Josep Sans daf5826610 Fix assignment pattern key constant expressions (#8029) (#8030) 2026-08-02 12:53:43 +01:00
Krzysztof Bieganski 66808eec27 CI: Make light debug opt-in in CI build script (#8013) (#8027) 2026-08-02 02:34:38 -04:00
BRDR LIFE a3e7f5103d Tests: Check dist bucket draw is per-element in foreach (#8023) 2026-08-01 22:37:55 +05:30
Marco Bartoli 7e116ca601 Support embedded covergroup member references (Fix #7749) (#8015) 2026-08-01 02:13:53 -04:00
github action 56accae45e Apply 'make format' [ci skip] 2026-08-01 03:38:21 +00:00
BRDR LIFE 967b1bae57 Fix unique constraint crash, guards, and size (#8018) (#8018) 2026-07-31 23:37:53 -04:00
BRDR LIFE 6b3aebfa32 Fix dist inside a foreach nested in a constraint if (#8016) 2026-07-31 23:35:01 -04:00
Yilou Wang 704c5a1c96 Fix gcov dump on warnings discarding later coverage counts (#8017) 2026-07-31 12:08:05 -04:00
Geza Lore 781f6d90bf Internals: Refactor MT scheduling (#8012)
Prep for fixing test added in #7913.

This is a large scale no functional change refactor, however, MT output
is perturbed as tied scores will be broken differently due to ordering
changes (still deterministic).

Split multi-threaded scheduling out of the monolithic
V3OrderParallel.cpp, into relatively independent parts, simplify the
data structures, and drop redundant or unused code.

New translation units:
- V3OrderMTaskGraph.h/.cpp: OrderMTaskGraph, the graph of LogicMTask
  vertices and MTaskEdge edges. LogicMTask and MTaskEdge no longer
  depend on the coarsening algorithm's merge candidate types;
  per-algorithm auxiliary data is attached externally via the vertex and
  edge user pointers.
- V3OrderMTaskFixHazards.cpp: data hazard fixup, was FixDataHazards.
- V3OrderMTaskContraction.cpp: graph coarsening, was Partitioner
  together with PropagateCp and the merge candidate types.
- V3OrderParallel.cpp: now just the partitioning driver and ExecMTask
  graph construction.

Data structure changes:
- Delete V3Scoreboard.h/.cpp. The generic template had a single user, now
  a file-local MergeCandidateScoreboard in V3OrderMTaskContraction.cpp.
- Merge candidates are now MergeCandidate/SiblingMC/EdgeMC, distinguished
  by a bit in the candidate id rather than by a vtable, and allocated by
  the scoreboard, which owns their lifetime. This removes the multiple
  inheritance previously used by MTaskEdge.

Move `hashGraphDebug` which prints the hash of a graph's shape for debugging
to generic `V3Graph::hashGraphDebug`.

Removed (can be added back later):
- Unnecesasry self tests that force special data stucture requirements.
- Per stage --stats output under --debug. (Final figures still reported.)
- Various debug dumps
2026-07-31 15:03:26 +01:00
BRDR LIFE 40323cc02c Fix dist weights ignored when an item is not a literal (#8003) 2026-07-31 10:54:38 +05:30
BRDR LIFE 9cddf46932 Fix internal error forcing an array element read at a run-time index (#8004) 2026-07-30 23:57:15 -04:00
24bit-xjkp 589c9b9433 Fix missing verilator_coverage in cmake install (#8008) (#8011)
Fixes #8008.
2026-07-30 23:13:07 -04:00
Yilou Wang 99b71a37b7 Internals: Refactor randomization next and nextPhased into shared helpers (#7991 prep) (#8009). No functional change intended. 2026-07-30 21:41:37 -04:00
Artur Bieniek b70696fc0a Fix $finish continuing event loop (#7267) (#7950)
Fixes #7267,
2026-07-30 21:39:21 -04:00
Marco Bartoli 4b770cffb4 Fix cross module disable (Part 5 of #7857) (#8006) 2026-07-30 14:56:07 +01:00
github action 42e043cb01 Apply 'make format' [ci skip] 2026-07-30 10:15:15 +00:00
24bit-xjkp c5c3c45102 Internals: Remove static inline functions in headers (#7988) (#8007) 2026-07-30 15:44:40 +05:30
Marco Bartoli c3be3c8050 Fix nested named fork disable propagation (Part 4 of #7857) (#8001) 2026-07-29 14:49:34 +01:00
Gilberto Abram cac2c3df13 Fix MULTIDRIVEN/PROC warning suppression via lint_off (#8000) 2026-07-28 21:50:19 -04:00
BRDR LIFE 2e4dbb846c Fix force not substituted into an unpacked array index (#8002) 2026-07-29 06:58:06 +05:30
Yilou Wang b5fa4212b0 Fix UNSATCONSTR reporting constraint indices above 9 (#7995) 2026-07-28 18:25:19 -04:00
github action c23b0ee972 Apply 'make format' [ci skip] 2026-07-28 21:32:05 +00:00
Marco Bartoli 48e575b885 Fix self-disable of named blocks with forks (Part 3 of #7857) (#7996) 2026-07-28 22:31:32 +01:00
BRDR LIFE 5fd1c93d43 Fix randomize() with shadowing a user variable named 'item' (#7993) (#7994)
Fixes #7993.
2026-07-28 12:29:45 -04:00
spomatasmd a6f4dd031f Fix DfgPeephole miscompile of nested shifts with overflowing shift amount (#7977)
The REPLACE_SHIFTL_SHIFTL and REPLACE_SHIFTR_SHIFTR peephole optimizations
fold '(a << b) << c' into 'a << (b + c)' (and likewise for '>>'), but computed
'b + c' in the width of the shift-amount operand. When 'b + c' overflows that
width it wraps around, producing a too-small shift amount and a wrong result.

Compute the sum one bit wider than the amounts so it cannot overflow.

Fixes #7955
2026-07-28 10:42:51 +01:00
Marco Bartoli 73b3ca7d2c Fix immediate disable of fork join branches (#7856) (#7931) 2026-07-28 10:34:02 +01:00
dependabot[bot] de4de1c3f8 CI: Bump the everything group with 2 updates (#7989) 2026-07-27 19:52:43 +05:30
Wilson Snyder f8fb1d6646 Fix SYNCASYNCNET false positive with changed non-edge logic (#7980).
Fixes #7980.
2026-07-24 09:53:36 -04:00
Wilson Snyder d2de6b42cf * Fix $fgets being mis-optimized away (#7976).
Fixes #7976.
2026-07-24 09:26:01 -04:00
Wilson Snyder 370a40348b Commentary: Changes update 2026-07-24 09:20:25 -04:00
Bartosz Skorowski ee152be17b Fix lost writes when select width exceeds variable width (#7975)
Signed-off-by: Bartosz Skorowski <[email protected]>
2026-07-24 08:58:28 -04:00
github action a799fedea6 Apply 'make format' [ci skip] 2026-07-24 12:56:19 +00:00
Aisha 8f8b5ade55 Add MULTIDRIVENPROC warning for signals driven by multiple plain always blocks (#7968) 2026-07-24 08:54:09 -04:00
Jakub Michalski bb0300f605 Fix table optimization causing not contextually convertible to bool error (#7983)
Signed-off-by: Jakub Michalski <[email protected]>
2026-07-24 08:50:03 -04:00
Kornel Uriasz 7d3021c34d Fix varRef scope in unique on dynamic array (#7981)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-07-23 15:56:51 -04:00
Wilson Snyder e0e0fadacc Tests: Update gold files 2026-07-22 12:59:20 -04:00
Igor Zaworski f511f6c34d Add FSM arc coverage to verilator_coverage .info output
Signed-off-by: Igor Zaworski <[email protected]>
2026-07-22 12:26:14 -04:00
Igor Zaworski 0a855fce47 Add FSM state coverage to verilator_coverage .info output (#7973) 2026-07-22 12:24:02 -04:00
Pawel Klopotek f149dd304c Add error when scalar is passed to array task argument (#7948) 2026-07-22 07:54:58 -04:00
Philip Axer 8113f1df7a Fix randomization of unreferenced rand members of unpacked structs (#7910) (#7911)
Fixes #7910.
2026-07-21 07:42:04 -04:00
Yilou Wang b34f685f70 Fix dist constraint on a frozen variable failing randomization (#7878) 2026-07-21 06:39:09 -04:00
Yilou Wang f22676eea9 Fix solve-before dropping all soft constraints in randomize() (#7963) 2026-07-20 14:55:49 -04:00
Patrick Creighton cdfff86c2d Support delayed tristate gates (#7960) (#7961)
Fixes #7960.
2026-07-20 09:21:23 -04:00
Bartosz Skorowski 176e333774 Fix lambda parameter types in queue min and max (#7962)
Signed-off-by: Bartosz Skorowski <[email protected]>
2026-07-20 06:53:40 -04:00
Wilson Snyder 3924fe9c18 Fix uncaught type error leading to invalid C++ output (#7814).
Fixes #7814.
2026-07-19 13:32:53 -04:00
Wilson Snyder 3813249826 Commentary: Changes update 2026-07-19 13:31:48 -04:00
Mateusz Gancarz 185a49e628 Fix unlinked error with function call in derived class parameter (#7923)
Signed-off-by: Mateusz Gancarz <[email protected]>
2026-07-19 09:55:29 -04:00
Yilou Wang f7ce38dbc1 Tests: Pre-pull for #7946 (#7953) 2026-07-18 21:01:53 -04:00
Yilou Wang 22050b97a7 Internals: Refactor dist constraint lowering helpers from lowerDistConstraints (#7878 prepull) (#7954) 2026-07-17 11:42:58 -04:00
Adam Kostrzewski 7e1efe6d76 Support dynamic containers in unique constraints (#7947)
Signed-off-by: Adam Kostrzewski <[email protected]>
2026-07-17 10:55:14 -04:00
Eryk Szpotański f39c1799d2 Commentary: Fix the verilator_coverage -filter-type documentation (#7949)
Signed-off-by: Eryk Szpotanski <[email protected]>
2026-07-17 08:18:43 -04:00
Pawel Klopotek cf27c63b2d Fix type resolution when a local name shadows a type name (#7915) 2026-07-17 08:10:23 -04:00
Artur Bieniek 796d5174f3 Fix sampled-value clocks in repeated assertions (#7944) 2026-07-16 13:07:53 -04:00
Patrick Creighton cc1b36bafd Fix FSM detection of coverage-only branches (#7941) (#7942)
Fixes #7941
2026-07-16 09:48:36 -07:00
Artur Bieniek 255bcff3ac Support [*N:$] consecutive repetition (#7940)
Signed-off-by: Artur Bieniek <[email protected]>
2026-07-16 09:29:30 -04:00
Philip Axer 877fc1e812 Fix dropping variable writes across opaque calls (#7921) (#7933)
Fixes #7921.
2026-07-15 11:03:04 -04:00
Andrii affe4cde57 Fix class parameter resolution (#7935) 2026-07-15 10:56:22 -04:00
Kornel Uriasz 232b2eb04c Fix dynamic array handling in solve...before (#7922) 2026-07-15 10:48:54 -04:00
Nick Brereton baf012cf6a Fix streaming concat as output-port lvalue into unpacked struct (#7918) 2026-07-15 10:46:25 -04:00
Nick Brereton 25377b20af Optimize VPI symbol registration and scope construction (#7936) 2026-07-15 10:31:42 -04:00
Kornel Uriasz d9fdc20492 Internals: V3Randomize.cpp cleanup (#7937). No functional change. 2026-07-15 05:32:56 -07:00
Wilson Snyder 5ead758f28 Internals: Use addNextNull. No functional change intended. 2026-07-14 19:58:25 -04:00
Wilson Snyder 34603ebd60 Commentary: Changes update 2026-07-14 19:55:50 -04:00
Igor Zaworski 3b43b304a3 Add error on static virtual functions (#7932) 2026-07-14 05:12:26 -07:00
Marco Bartoli 3afb7e1a21 Internals: Refactor disable process queue plumbing (#7919) 2026-07-13 21:25:35 -04:00
Jeffrey Song e24efae5a0 Fix stream concatenation in init array patterns (#7890 repair) (#7928) 2026-07-13 20:29:19 -04:00
Jeffrey Song 4262aea87c Internals: Use snprintf for random unique indexes (#7925) 2026-07-13 11:35:22 -07:00
Nick Brereton dde8de0a0d Fix crash streaming an unpacked array of unpacked structs (#7917) 2026-07-11 20:31:01 -07:00
Yilou Wang 7ca78a75e7 Fix scoped randomize with array members under rand_mode (#7877) 2026-07-11 20:28:49 -07:00
Yilou Wang ec124a0905 Fix mid-window disable iff (#7792) (#7869)
Fixes #7792
2026-07-11 20:44:56 -04:00
Yilou Wang ca83bc50bf Fix solve-before over array variables failing randomization (#7876) 2026-07-11 20:44:37 -04:00
Geza Lore 52287c025f Tests: Add TSan and failing multi-threaded data race test (#7913)
PR #7902 uncovered a pre-existing bug in multi-threaded scheduling,
where we can end up with an un-ordered R-W hazard in the MTask graph,
resulting in non-deterministic runtime behaviour.

This is extremely hard to actually trigger on a small example, so using
ThreadSanitizer to flag it, which can identify the race reliably.

In this patch:
- Add configure and `verilator --get-supported TSAN` to check if the
  configured compiler supports ThreadSanitizer
- Add a --tsan option to the test driver.py which builds the test with
  thread sanitizer (similar idea to --gdbsim).
- Add a tests.enable_tsan() method to allow turning on TSan in the test
  Python file.
- Add a suppressions file that waives TSan errors in the runtime library
- Finally add `t_sched_hybrid_hazard` that demonstrates the data race
  triggered after #7902. This is currently expected failing, fix later.

With the suppression, there are 17 vltmt tests failing due races in the
generated code. (Using `driver.py --vltmt --tsan --quiet -j0`)
2026-07-10 14:34:51 +01:00
Yogish Sekhar 3c7727a8f4 Fix spurious FSM COVERIGN on datapath comparisons (#7900) (#7908)
Fixes #7900.
2026-07-10 09:00:17 -04:00
Wilson Snyder 3191d98391 Commentary: Changes update 2026-07-10 08:43:12 -04:00
Wilson Snyder 3bd04a70bd Commentary (#7916) 2026-07-10 08:38:01 -04:00
Artur Bieniek feb2fe0d94 Fix release of forced port nets (#7907) (#7901)
Fixes# 7901

Signed-off-by: Artur Bieniek <[email protected]>
2026-07-10 11:35:06 +01:00
Artur Bieniek b211af9d24 Fix independent force of multiply instantiated signals (#7905)
Signed-off-by: Artur Bieniek <[email protected]>
2026-07-10 11:31:08 +01:00
Kornel Uriasz 9740203485 Fix VL_TO_STRING function for array of structs (#7912)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-07-09 08:40:24 -07:00
Adam Kostrzewski a21bd8a417 Fix VlQueue falling into wrong template spec (#7914) 2026-07-09 07:33:28 -07:00
github action 1d42c45a34 Apply 'make format' [ci skip] 2026-07-09 12:46:08 +00:00
Jaeuk Lee 38895f8f29 Fix $display accepting streaming concat arguments (#7663) (#7890)
Fixes #7663.
2026-07-09 08:41:40 -04:00
Wilson Snyder f316ec0d66 Revert #7836: Fix scheduling of variables written in non-inlined functions in suspendable processes (#7836) 2026-07-08 14:45:05 -04:00
Artur Bieniek 671ff628ff Tests: Fix t_force_release to reflect intent (#7906)
Signed-off-by: Artur Bieniek <[email protected]>
2026-07-08 19:29:49 +01:00
Patrick Creighton c7e8075972 Fix --coverage on labelled inline assert/cover property (#7898) (#7904)
Fixes #7898
2026-07-08 09:18:33 -07:00
Jakub Michalski 646dcd3838 Support user-provided DPI-C function declarations (#7626) (#7893)
Fixes #7626.
2026-07-08 05:22:24 -07:00
Jakub Michalski 93d0443998 Fix memory leak in VerilatedFst::close() (#7899)
Signed-off-by: Jakub Michalski <[email protected]>
2026-07-08 08:48:17 +01:00
Artur Bieniek 6c20fdb7bd Optimize assertion NFAs using bit-vector ring buffers (#7885)
Signed-off-by: Artur Bieniek <[email protected]>
2026-07-07 19:26:50 -04:00
Geza Lore e743838d09 Internals: Remove DfgGraph::clone (#7896)
Only used by V3DfgBreakCycles, which today either improves the graph, or
leaves it unchanged. Remove unnecessary complexity.
2026-07-07 20:51:40 +01:00
Yilou Wang f1a8192a36 Fix mixed-width inside and dist range bounds failing randomization (#7875) 2026-07-07 11:26:19 -07:00
Matthew Ballance 87d77f0133 Fix internal error for coverpoints that reference a covergroup formal parameter (#7853 partial) (#7889) 2026-07-07 11:42:39 -04:00
Igor Zaworski aca58ca90f Fix scheduling of variables written in non-inlined functions in suspendable processes (#7836)
Signed-off-by: Igor Zaworski <[email protected]>
2026-07-07 12:34:24 +01:00
Artur Bieniek a5f4d40901 Fix range delays with parameter bounds (#7882)
Signed-off-by: Artur Bieniek <[email protected]>
2026-07-06 13:13:11 -04:00
Yilou Wang 8ed0acf1ec Support a sequence used as an event control (#7797) (#7846) 2026-07-06 13:12:01 -04:00
Geza Lore 39b646349f Add --enable-light-debug configure option (#7886)
Change default debug build to use -O0 instead of -Og as the latter is
still not great debugging experience. Use -Og -gz, plus the new -ggdb1,
which together significantly cut down debug info size, to save CI cache
space, while still enabling -gdbbt tests to work.
2026-07-06 18:02:37 +01:00
Geza Lore 56b0b679c6 CI: Disable ccache on coverage jobs (#7887)
gcc --coverage is unsupported by ccache and results in a bypass. Don't
save unnecessary caches.
2026-07-06 17:05:14 +01:00
dependabot[bot] 6baea8d846 CI: Bump the everything group with 5 updates (#7884) 2026-07-06 09:50:16 -04:00
Geza Lore fcc7acbfc6 CI: Factor out artifact based caching as a reusable action (#7883) 2026-07-06 14:16:06 +01:00
Geza Lore bf4c72f93b CI: Squash macos brew warning (#7881) 2026-07-06 11:43:55 +01:00
Geza Lore c78a342bdc CI: Don't Python make venv on cache hit 2026-07-06 11:30:59 +01:00
Geza Lore c2ed0aab00 CI: Use ci-install.bash for lint-py dependencies (#7880) 2026-07-06 11:27:58 +01:00
Geza Lore 5563b3b6f8 CI: Cache Python venv (#7879)
This is smallish and mostly static, should cache well, avoid setup cost.
2026-07-06 11:03:35 +01:00
Geza Lore 5750c888a6 CI: Improve ccache handling in build and test jobs (#7874)
Cache key isolation: Include the build flavour (ccwarn/asan/gcov) in the
build ccache key, so the coverage (gcov), asan, and RTLMeter
(ccwarn-off) configurations no longer share and thrash the single
'<runs-on>-<cc>' bucket, nor warm-start from each other's (near-useless)
caches.

Prune stale entries instead of a fixed size cap: After building/testing,
evict ccache entries this run did not touch (--evict-older-than, based
on the run's own duration).  This bounds the saved cache to the current
working set, so CCACHE_MAXSIZE and CCACHE_LIMIT_MULTIPLE are no longer
needed and are removed (ccache falls back to its 5G default ceiling, but
is realistically much smaller).

ccache configuration:
- Drop CCACHE_COMPRESS (already the default in ccache 4.x).
- Add CCACHE_COMPILERCHECK=content, so a changed compiler mtime on a rebuilt
  ephemeral runner image does not invalidate the whole restored cache.
- Hoist all ccache-related variables (CACHE_BASE_KEY, CCACHE_*, CXX) to the
  workflow-level env.

Remove dead ccache scaffolding:
- reusable-lint-py: the job never compiles or caches; drop its ccache env.
- reusable-rtlmeter-run: remove the disabled persistent-cache step and its
  storage variables; keep CCACHE_DISABLE=1, since caching must stay off to
  keep RTLMeter timings representative.

Store test job ccache as artifacts for reuse
2026-07-06 01:44:32 +01:00
Geza Lore 8b564f509b CI: Remove macos-15 gcc job
On macOS, gcc is an alias for clang, so this job was effectively the
same as the clang job.
2026-07-05 21:18:36 +01:00
Geza Lore c7c778f109 CI: Improve Pages job
Code coverage and RTLMeter complete (concluding 'skipped') on branch
pushes where they do no work, and each completion fires the Pages
workflow_run trigger. Rebuilding and redeploying master's pages for
these no-op events is wasteful.

Gate the build job so a workflow_run whose upstream conclusion is
'skipped' does nothing; deploy and notify need build, so they
cascade-skip.

Route such no-op runs to their own throwaway concurrency group. In the
shared 'pages' group they would, as the newest queued run, cancel a
pending real run and then deploy nothing (concurrency keeps only the
in-progress and newest pending run). Real runs keep sharing 'pages' and
serialize as before.

Add retry to deploy step to reduce flakyness due to the Pages back end.

Fix trigger on workflow file changes.
2026-07-05 21:11:45 +01:00
Geza Lore cbd78e689c CI: Cleanup Windows build (#7873)
The Windows build never actually used ccache; the '.ccache' directory
only ever held the win_flex_bison install, and cmake/MSVC did no compiler
caching. Clean this up:

- Drop the CCACHE_* environment variables from the job (meaningless here).
- Store win_flex_bison in a dedicated 'win_flex_bison' directory instead of
  the misleadingly named '.ccache', and cache just that (static key, as it
  is a fixed third-party tool).
- Set WIN_FLEX_BISON inside ci-win-compile.ps1 as an absolute path, rather
  than in the workflow, making the script self-contained.
- Use the runner's processor count for build parallelism instead of a fixed
  '-j 3', in both ci-win-compile.ps1 and ci-win-test.ps1.
- Remove the verilator-win.zip archive and upload steps; nothing consumes
  that artifact.
- Build Verilator with the Ninja generator from an MSVC developer shell
  instead of MSBuild. MSBuild only parallelizes across projects, and
  Verilator is a single project, so it compiled serially; Ninja keeps all
  cores busy. Also compile with /Od: this job only checks that Verilator
  builds and can verilate an example, so an optimized binary is not needed
  and the otherwise-dominant optimizer time is wasted.
2026-07-05 19:15:09 +01:00
Geza Lore 8d0c75171c CI: Unify regression and RTLMeter build jobs to one (#7872)
- Merge reusable-rtlmeter-build.yml into reusable-build.yml, selected by
  an 'install' flag: archive the installed Verilator for RTLMeter, or
  the whole repository tree for the test jobs.
- Align reusable-test.yml input arguments with  reusable-build.yml
- Pass build/test options as booleans instead of 0/1.
- Inline the single-entry build matrices, and hoist matrix keys that are
  constant across a job.
2026-07-05 18:52:55 +01:00
Geza Lore 6e06cd18da CI: Decouple build and test into separate scripts, simplify workflows (#7871)
- Split the monolithic ci-script.bash into ci-build.bash and
  ci-test.bash, with shared setup in ci-common.bash.
- Pass job parameters as explicit command-line options rather than
  environment variables (--compiler, --prefix, --suite, --asan,
  --gcov, --reloc, --ccwarn).
- Detect the host OS and distribution at runtime (uname,
  /etc/os-release) instead of the legacy Travis-era CI_OS_NAME,
  CI_RUNS_ON and CI_BUILD_STAGE_NAME variables.
- Remove dead code: FreeBSD support, Windows wavediff install, the
  unused CI_COMMIT variable, and various redundant operations.
- Inline the single-entry build-job matrices.
- Rename osx to macOS
- Refuse to run these ci scripts outside GitHub Actions to protect
  developer checkouts.
2026-07-05 15:46:30 +01:00
Geza Lore 198cce29ba CI: Restore relocation testing (#7870)
PR #7776 removed Ubuntu 22.04 clang from the test matrix, which was the
only one testing the relocation of an installation. Add back under
Ubuntu 24.04 clang.
2026-07-05 14:26:30 +01:00
Geza Lore a518efbedb Internals: Prepare V3DfgBreakCycles to support multi-dimensional arrays (#7867)
This is prep for more array support later. Minor functional improvement
for tracing arrays, but no meaningful change.
2026-07-05 11:40:08 +01:00
Geza Lore 13236822d3 CI: Use faster zstd for repo archives (#7868) 2026-07-05 09:24:33 +01:00
Geza Lore 2285e5b6da Optimize more always blocks in Dfg (#7775)
Optimize always blocks that:
- drive an unused variable (so logic can be pruned)
- write only a single variable (regardless of CFG size)
2026-07-05 09:24:01 +01:00
Geza Lore 1bab793c75 CI: Fix deleting pr notifications after multiple reruns 2026-07-04 22:46:19 +01:00
Geza Lore 566f4e6efc Internals: Add new VL_RESTORER flavours (#7866)
Restrict VL_RESTORER to be usable only with trivially copyable types.
Introduce VL_RESTORER_COPY and VL_RESTORER_CLEAR, which are more
efficient versions usable for non trivially copyable types.

VL_RESTORER_COPY semantically behaves the same as VL_RESTORER, but only
does one copy at initialization, and on scope exit restores via a move.

VL_RESTORER_CLEAR swaps the variable with an new one constructed via
the no-args constructor (e.g. empty collection), which does not require
any copying at any point.

Static assertions enforce picking one of the new flavours when copying
might be expensive.
2026-07-04 17:27:07 +01:00
Wilson Snyder 83eb54ec7e Fix wild compare operators on strings 2026-07-04 11:05:34 -04:00
Wilson Snyder f82f59a024 Commentary: Changes update 2026-07-03 13:01:05 -04:00
Wilson Snyder 12fab5d5d7 Tests: Cleanup some cross-simulator test differences 2026-07-03 13:00:23 -04:00
Pawel Klopotek 7ece66d06e Fix unique0 case side effects (#7787) 2026-07-03 12:49:21 -04:00
Eryk Szpotański a64234e897 Add comments as a branch description in coverage .info files (#7843)
Signed-off-by: Eryk Szpotanski <[email protected]>
2026-07-03 11:18:29 -04:00
Dragon-Git 58bd13b623 Fix heap-use-after-free in VlRNG::VlRNG() (#7865) 2026-07-03 06:38:48 -04:00
Pawel Kojma b97df914dd Fix clang++ ambiguous overload of '==' operator (#7863) 2026-07-03 06:37:48 -04:00
Geza Lore 0e371d6e5c Fix cleaning purity cache after assertions 2026-07-02 17:47:09 +01:00
Geza Lore 1106e89c84 Optimize random initialization
Fetching a thread-local is relatively expensive. Random initializing
wides used to do it once or twice per word, and on short runs for
large designs can be noticeably expensive, so fetch once per variable
instead. Also remove unused VL_RAND_RESET_{Q,W} functions.
2026-07-02 16:38:14 +01:00
Jakub Michalski 506f703da5 Internals: Remove unused variables in verilated_funcs.h (#7862)
Signed-off-by: Jakub Michalski <[email protected]>
2026-07-02 07:16:42 -04:00
Jakub Michalski 853ee5df17 Fix DFG misoptimizing bound checks (#7755)
Signed-off-by: Jakub Michalski <[email protected]>
2026-07-02 11:33:38 +01:00
Wilson Snyder 964474837f Commentary 2026-07-01 19:37:12 -04:00
Wilson Snyder ce4be92a67 devel release 2026-07-01 18:31:23 -04:00
Wilson Snyder 848d926ebd Version bump 2026-07-01 18:27:54 -04:00
Wilson Snyder bb9cad507f Commentary: Changes update 2026-07-01 18:27:54 -04:00
github action 9c655d379a Apply 'make format' [ci skip] 2026-07-01 19:59:37 +00:00
Sergey Chusov 1ea10ba71c Fix class scope '::' reference through an inherited type parameter (#7844) 2026-07-01 15:58:35 -04:00
Wilson Snyder 6b3e2ce971 Commentary: Changes update 2026-06-29 22:00:10 -04:00
dependabot[bot] e80329a57b CI: Bump actions/cache from 5.0.5 to 6.1.0 in the everything group (#7854) 2026-06-29 11:03:22 -04:00
github action 514fa120f5 Apply 'make format' [ci skip] 2026-06-29 14:58:00 +00:00
Joshua Leahy cf7e3f791a Fix covergroups without --coverage (#7848) (#7849)
Fixes #7848.
2026-06-29 10:56:59 -04:00
Wilson Snyder 276f2f344d Commentary: Changes update 2026-06-28 16:15:54 -04:00
Wilson Snyder 6006f91e2e Tests: Add t_queue_array (#6921 test) 2026-06-28 16:07:37 -04:00
Wilson Snyder c4f63583bc Tests: Fix t_cover_expr_fork data location 2026-06-28 15:40:10 -04:00
Wilson Snyder 657d5f6abf Tests: Add t_initial_dlyass2 (#5210).
Fixes #5210. (Confirms fixed in master earlier).
2026-06-28 15:34:50 -04:00
Wilson Snyder 9448e4366c Fix MSVC warning. No functional change. 2026-06-28 09:47:53 -04:00
Nick Brereton 59b85f670b Fix constant pool recache after dead scope removal (#7845) 2026-06-28 09:30:48 -04:00
Matthew Ballance d023b3b075 Support dynamic loading of VPI extensions (#7727) 2026-06-28 09:28:09 -04:00
Yilou Wang 3853301367 Fix disable iff ignored when its condition is held continuously true (#7841) 2026-06-26 06:00:44 -04:00
Geza Lore 2d157b29b0 Optimize assetOn checks furter 2026-06-25 20:12:49 +01:00
Yilou Wang f0f1c44dd6 Fix object randomization skipped by an unrelated global constraint (#7833) (#7838)
Fixes #7833.
2026-06-25 09:30:05 -04:00
Geza Lore b73a897db3 Optimize module inlining heuristic (#7837)
Rewrite module inlining decision to be based on a bipartite Module/Cell
graph, similar to V3InlineCFuncs. Preserved all old heuristics, but
added 2 new ones:

- If a module, and all the sub-hierarchy below it, is less than 10% the
  total flattened size of the design, then flatten the contents of that
  module (but the module itself is not necessarily inlined).

- If the flattened size of all instances of a module is less than 20% of
  the total flattened size of the design, then inline all instances of
  that module.

These are both relative to the total size of the design, so they
auto-scale with complexity. The net effect is that large shared
instances are preserved, but their contents are flattened out. E.g. in a
multi-core CPU this would keep the cores non-inlined but flatten out
most everything else. This still enables V3Combining and sharing those
later, but avoids potentially big overheads e.g. with small widely used
library modules.

Empirically this yields less generated C++ than the previous version
(due to removing lots of small functions), and can improve performance
10-20% while still having meaningful combining relative to the size of
the design.
2026-06-25 14:14:15 +01:00
Yilou Wang 000afcf52d Support variable-length intersect in SVA sequences (#7835) 2026-06-25 04:41:53 -07:00
github action 0ebae43713 Apply 'make format' [ci skip] 2026-06-25 02:44:28 +00:00
Wolfgang Mayerwieser 249608a42f Fix performance on large package-scoped structs (#7830) 2026-06-24 19:43:24 -07:00
Ryszard Rozak def1e2ccbc Fix lifetime of expression coverage variable (#7834)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-06-24 09:59:32 -04:00
Yilou Wang 9462c2a910 Fix unclocked concurrent assertion misreported as unsupported (#7831) 2026-06-24 09:44:47 -04:00
Matthew Ballance d456384d39 Support hierarchical reference cross members (#7749) (#7820) 2026-06-24 07:47:36 -04:00
Ryszard Rozak 995534d3ed Fix insertion of expression coverage statement (#7832)
Signed-off-by: Ryszard Rozak <[email protected]>
2026-06-24 07:44:49 -04:00
Artur Bieniek 350158c857 Fix scheduling of virtual interface method writes (#7641)
Fix scheduling of writes in virtual interfaces, there were missing triggers (see added test).

Make V3SchedVirtIface handle writes done inside methods called through a virtual interface. The pass first records direct vif.member writes, VIF method calls, and candidate interface member VarScopes. It then walks the methods reachable from those VIF calls, writes to persistent interface variables in those method bodies are treated as VIF writes, and nested calls are followed with the same interface context. Function locals, temps, and events are ignored because they are not persistent interface storage observable through a later VIF read. Triggers are still created only from the intersection of (interface type, member name) writes and matching VarScopes, so unrelated interface variables and interfaces with no virtual access do not get extra triggers.
2026-06-24 10:51:42 +01:00
github action 84cc08b756 Apply 'make format' [ci skip] 2026-06-24 09:44:11 +00:00
Thomas Santerre bd6b9161dc Optimize bit-scan loops into $mostsetbitp1 / $countones (#7822)
Recognize the common single-bit scan loop idioms in V3Unroll (before it
unrolls) and lower them to bit-reduction primitives, replacing a literal
W-iteration loop with one intrinsic-backed expression:

  target=0; for (i=0;i<W;i++) if (vec[i]) target = i + 1;      -> $mostsetbitp1(vec)
  target=0; for (i=0;i<W;i++) if (vec[i]) target = target + 1; -> $countones(vec)

The leading-one form lowers to a new AstMostSetBitP1 node, emitted as
VL_MOSTSETBITP1_{I,Q,W}; those runtime helpers now use __builtin_clz where
available (same pattern as VL_REDXOR's __builtin_parity), with the existing
bit scan as fallback.  The count-ones form reuses AstCountOnes ($countones,
popcount); as the DFG requires a 32-bit countones result it is built at 32
bits and narrowed to the accumulator width with a select.

Matching is structural to stay sound: the index must start at 0, increment
by exactly 1, and scan all W==width(vec) bits via a single 1-bit select of a
distinct vector, with the target pre-zeroed and no else branch.  The loop
bound is accepted as a strict ascending 'idx < W' written either way and
signed or unsigned (Gt/GtS/Lt/LtS).  Gated by -fbit-scan-loops (on at -O).

Adds t_bit_scan_loops (I/Q/W, count-ones and unsigned-index positives;
step-2, start-1, idx*2+1, vec[idx+1], target=idx and W!=width negatives, all
self-checked and asserted via --stats not to lower) plus t_bit_scan_loops_off
for the disable flag.

Motivated by a transformer inference design whose 80-bit leading-one detector
ran every cycle (~37% of runtime); the lowering is worth ~39% there.
2026-06-24 10:43:05 +01:00
Wilson Snyder 7752625f49 CI: Pin actions to hashes 2026-06-23 21:24:21 -04:00
Wilson Snyder 36d30d8fcb CI: Remove unused passed step 2026-06-23 21:21:07 -04:00
Tom Jackson 2baca68f86 Fix class/var named identically to an enclosing-scope type (#7827) (#7828)
Fixes #7827.
2026-06-23 20:43:31 -04:00
Igor Zaworski 0cd13f80c9 Fix nested class split crash (#7826)
Signed-off-by: Igor Zaworski <[email protected]>
2026-06-23 14:07:15 -04:00
Jakub Wasilewski d5c040d8e6 Fix skewed dist operator for arrays (#7802) 2026-06-23 09:47:55 -04:00
Nick Brereton 6fbc7042a5 Support VPI access to unpacked struct members (#7823) 2026-06-23 07:04:51 -04:00
Geza Lore c76c94ef16 Optimize additional expression patterns in V3Const (#7824)
- Masking that returns known zero
- More general Sel over Extend
2026-06-23 04:22:35 +01:00
Matthew Ballance 756bcf5742 Fix '$' as unsupported coverpoint-bin range bounds (#7750) (#7825) 2026-06-22 22:14:43 -04:00
Artur Bieniek 87bebbb732 Support global $assertcontrol (#7807)
Signed-off-by: Artur Bieniek <[email protected]>
2026-06-22 18:51:41 -04:00
Wilson Snyder c927f05f35 Update fst from upstream (#6771 partial) 2026-06-22 17:25:59 -04:00
dependabot[bot] bf50baefee CI: Bump actions/checkout from 6 to 7 in the everything group (#7821) 2026-06-22 12:48:29 -04:00
github action 515c4282f4 Apply 'make format' [ci skip] 2026-06-22 16:47:50 +00:00
Saksham 729794bc0e Fix CASEINCOMPLETE for all uncovered enum items (#7815) (#7817)
Fixes #7815.
2026-06-22 12:41:48 -04:00
Geza Lore 7765738e11 Internals: Do not generate redundant masking on word selects (#7819)
newAstWordSelClone returns a clean word and these And mask out exactly
the bits that are zero after the shift.
2026-06-22 16:42:22 +01:00
Geza Lore 9670dabcfe Internals: Keep separate stats for constant pool variables 2026-06-22 10:15:49 +01:00
Geza Lore b37c84109d Optimize staticly known oversize shifts (#7806)
The non *Ovr flavours of AstShift* have better downstream constant
folding, so keep using those if proven safe. Fold overshifts explicitly
instead of introducing *Ovr shifts.
2026-06-22 10:06:26 +01:00
Geza Lore fed922a538 Internals: Compact stage statistics table 2026-06-22 09:39:53 +01:00
Geza Lore eafe9636cf Internals: Dump Ast expression pattern statistics like Dfg (#7818)
Remove the expression combination counts from the default stats file,
and add a new `--dump-ast-patterns` option, which will dump new
`*_ast_patterns_*.txt` files. These contain the expression combinations
in a similar S-expression format as Dfg already produces with
`--dump-dfg-stats`. These dumps are not produced by just `--stats` as
they are fairly expensive to compute. Currently the new option will dump
at two points: just before we change to C types via widthMin usage, and
just before emit.
2026-06-21 22:17:36 +01:00
Geza Lore fbea10b427 Internals: Fix dumping of fast-only statistics after emit 2026-06-21 19:10:38 +01:00
Wilson Snyder 78a2dc0738 CI/Makefile: Auto format .rst files (#7816)
Maintainers: Note this requires a `make venv` to get docstrfmt==2.2.0
2026-06-21 13:53:00 -04:00
Geza Lore bcaa110f60 Optimize generated function inlining (#7811)
Previously V3InlineCFuncs inlined call sites but never deleted the now
dead callees. Also missed a lot of opportunities due to evaluation order.

Rewrite using a graph based algorithm, using only a single traversal of
the netlist. This is clearer, more accurate, and faster at compile time.

Also add a clean -fno-inline-cfuncs disable. Setting the limits to 0
still disables inlining, except of empty functions, which can be inlined
with 0 limits (they are no ops). It will also prune unused functions
without -fno-inline-cfuncs.

Pass now also respects `--output-split`
2026-06-21 18:31:56 +01:00
Wilson Snyder 5fc03ae913 Commentary: Make RST documents round-trip clean. No output change intended. 2026-06-21 10:15:47 -04:00
Wilson Snyder b92bf86016 Commentary: Changes update 2026-06-21 10:14:53 -04:00
Geza Lore e1f1a50327 Fix assertion when loop unrolling failed (#7810)
Partial fix for #7810
2026-06-21 10:28:23 +01:00
Igor Zaworski e269b914b2 Support NBAs in initial blocks (#7754) 2026-06-20 17:23:05 -04:00
Wilson Snyder 047d6e03d9 Tests: Add t_sys_file_scan_delay (#4811) 2026-06-20 07:47:44 -04:00
Wilson Snyder 78d96d23ee Commentary (#7809) 2026-06-20 06:45:51 -04:00
Wilson Snyder d66f96e246 Commentary: Changes update 2026-06-20 06:45:04 -04:00
Geza Lore 9a231d254d Optimize Dfg cycle breaking to do less work (#7210)
When a vertex is made acyclic, conservatively update the SCC map to
propagate and mark connected vertices as acyclic as much as possible.
This way we can stop early if the graph becomes acyclic after some
fixups. This can significantly reduce the number of fixups needing to be
applied, avoiding introducing redundancy.
2026-06-19 22:28:50 +01:00
Geza Lore a37e2ee94b Optimize wide decoder case statements into decoder expressions (#7804)
Extend the decoder-pattern case optimization to selectors that are too
wide for a full 2^width lookup table. A decoder-pattern case (where
every case item assigns constants to a fixed set of LHSs) is lowered to
a new AstMachMasked expression. AstMachMasked is emitted as a run-time
VL_MATCHMASKEd_* function call. It contains a packed constant pool table,
'matchp', which is a list of '(mask, bits)' pairs. At runtime, the index of the 
first matching entry is returned, and is used to index a value table. This single
(albeit complicated) expression can replace large if-else trees whole, resulting
in much more compact code with fewer static hard to predict branches. It
is worth about 10% speed and 30% code size in some designs.

Example:

```systemverilog
    logic [39:0] sel;
    always_comb
      casez (sel)
        40'b???????????????????????????????????????1: out = 8'h01;
        40'b??????????????????????????????????????1?: out = 8'h02;
        40'b?????????????????????????????????????1??: out = 8'h03;
        default:                                      out = 8'hff;
      endcase
```

is compiled to:

```c++
    out = TABLE_value[VL_MATCHMASKED_Q(sel, CONST_match)];
```

Where 'CONST_match' contains 4 entries, of a 40-bit mask and 40-bit bit
pattern each, and 'TABLE_value' contains 4 entries of the corresponding
8-bit results. (Entries are aligned to word boundaries to avoid runtime
bit swizzling)
2026-06-19 19:46:13 +01:00
Yilou Wang 59fba72cb6 Support method calls on a sub-interface via a virtual interface (#7800) 2026-06-19 08:41:48 -04:00
Wilson Snyder 749b93e405 Commentary: Use standard multiline rst comments, other cleanups 2026-06-18 21:58:01 -04:00
Wilson Snyder 50c15f3705 Commentary: Changes update 2026-06-18 21:56:02 -04:00
Yilou Wang 129cfc19c0 Fix cross-hierarchy tristate drivers of interface nets (#7339) (#7801)
Closes #7339.
2026-06-18 19:07:37 -04:00
Artur Bieniek 51022d6152 Tests: Fix unstable --vltmt test (#7803)
Fixes #7803.
2026-06-18 14:40:54 -04:00
Yilou Wang a5a16cfbfd Support unbounded always [m:$] and strong s_always liveness (#7798) 2026-06-18 11:17:09 -04:00
Yilou Wang 22b45f0fd7 Fix randomize() with skipping derived pre/post_randomize (#7799) 2026-06-18 11:04:57 -04:00
Geza Lore 5712f9b614 Optimize decoder case statements into lookup tables (#7795)
Recognize "decoder" case statements (where every case item only assigns
constants to a fixed set of left-hand sides) and replace them with a
single packed constant lookup table indexed by the case expression.
Small tables are materialized inline in the generated code, and are
always optimized. Larger ones are placed in the constant pool and only
optimized if deemed beneficial over branches.

While this slightly conflicts with V3Table, and is not worth that much
on it's own, there will be a follow up patch that converts more cases of
this form which will be much more valuable. This patch does the
necessary analysis and the simple table conversion when possible.

Split -fcase into -fcase-table (this new conversion) and -fcase-tree (the
existing bitwise branch-tree conversion); -fno-case is now an alias for
both.

Default branches, assignments preceding the case (used as default values),
casez wildcards, multiple and partial left-hand sides, and both blocking and
non-blocking assignments are handled. Cases that cannot be safely tabled (e.g.
non-exhaustive with no default, overlapping writes to one variable, or mixed
blocking/non-blocking assignments) fall back to the existing if/else lowering.

Consequently disabled re-inlining of constant pool variables in V3Const,
and rebuild the constant pool hash in V3Dead (previously we didn't
create constant pool entries early enough for this to matter)
2026-06-18 09:30:50 +01:00
Yilou Wang 3a4377d39e Support clocking event on a sequence declaration body (#7598) (#7793)
Fixes #7598.
2026-06-17 17:57:18 -04:00
Nick Brereton 26c85d4495 Fix $bits on unpacked structs (#4521) (#7796)
Fixes #4521.
2026-06-17 17:56:48 -04:00
Tracy Narine 4c5e104825 Internals: Remove bad cmake file reference (#7794) 2026-06-17 12:12:25 -04:00
Geza Lore f11c4084d1 Internals: Minor cleanup of case statement lowering
- Factor out match mask construction
- Rename V3Number method to reflect behaviour
2026-06-17 14:39:06 +01:00
Yilou Wang b581f73843 Support $assertcontrol control_type from lock to kill (#7788) 2026-06-17 07:17:39 -04:00
em2machine a534a1d1bc Fix parameter pollution when using class parameters (#7711) (#7763)
Fixes #7711.
2026-06-16 14:03:28 -04:00
Ryszard Rozak 792008514b Fix randomization of dynamic arrs of objects (#7790) 2026-06-16 12:19:00 -04:00
Yilou Wang bec45125bd Fix cover property of an implication counting vacuous matches (#7789) 2026-06-16 11:52:35 -04:00
Jakub Michalski 38fd99b37b Fix out-of-bounds read value for 2-state types (#7785)
Signed-off-by: Jakub Michalski <[email protected]>
2026-06-16 09:21:11 +01:00
Nikolai Kumar a5fad9882f Fix force unpacked bitselect (#7744) (#7745)
Fixes #7744.
2026-06-15 21:57:59 -04:00
Wilson Snyder 0e4a3a92b0 CI: Autoformat markdown files 2026-06-15 17:44:50 -04:00
Wilson Snyder c86816476c Commentary: Changes update 2026-06-15 17:37:49 -04:00
Artur Bieniek 7061c1f04d Fix not failing assertion when RHS of a range window rejects once (#7773) 2026-06-15 15:32:11 -04:00
Yilou Wang 0233e5044c Tests: Restore Antmicro copyright on test files accidentally overwritten (#7786) 2026-06-15 08:56:34 -04:00
Yilou Wang 709c444df3 Internals: Add AGENTS files to guide AI contributions (#7562) (#7765)
Fixes #7562.
2026-06-15 08:42:34 -04:00
Yilou Wang 077558a9b0 Support cover sequence statement (#7764) 2026-06-15 08:36:21 -04:00
Yilou Wang 969a775ae5 Support assertion control system tasks in classes and interfaces (#7761) 2026-06-15 07:33:55 -04:00
Geza Lore a07a980b73 Internals: Do not overload AstVar::isPrimaryIO() for sampled value vars 2026-06-15 09:17:41 +01:00
Geza Lore 5ab2bf1ec4 Optimize input combinational logic by change detection (#7784)
When a lot of combinational logic is driven from top level inputs,
work can be wasted evaluating that logic if the top level inputs don't
change.

This change adds an optimization by performing a change detect on the
top level inputs, and evaluate 'ico' logic only if the top level input
actually changed. This especially helps with --hierarchical/--lib-create
which runs the 'ico' of each sub-model in the eval settle loop.

This was observed to yield 40%+ run-time speedup on some partitioned
designs.

The added change detection is cheap, so it is emitted even if the 'ico'
region is small, and is on by default.

The optimization is only sound if the model itself does not write to the
top level inputs (otherwise the 'previous value' variables would be out
of sync, which are not updated by internal writes.). If we can detect a
top level input is written within the design, then for that input, we
fall back on always running the relevant logic. With --vpi we cannot
prove safety statically, so --vpi will disable this optimisation unless
explicitly enabled. (In which case it's the user's responsibility to not
write to top level inputs via the VPI.)
2026-06-15 05:42:00 +01:00
Wilson Snyder df78db0e73 Fix $fflush and autoflush with --threads (#7782).
Fixes #7782.
2026-06-14 13:36:49 -04:00
Wilson Snyder 12bcf85d33 Internals: Misc V3Life cleanups. No functional change intended. 2026-06-14 13:36:49 -04:00
Geza Lore 77e6a21224 Internals: Inline AstVar::isToggleCoverable()
Inline into the single call site, remove unnecessary isSc() and
isPrimaryIO() guards (these flags are set only in a later pass).

No functional change.
2026-06-14 16:41:13 +01:00
Geza Lore 9a0cd289e8 Fix memory leak in previous patch 2026-06-14 14:53:40 +01:00
Geza Lore b973b1df5a Fix hang in assertion optimization (#7707 repair) 2026-06-14 13:31:59 +01:00
Wilson Snyder c6a5255ea0 Tests: Disable unstable --vltmt tests (#7779) (#7780) (#7781) 2026-06-13 22:07:18 -04:00
Wilson Snyder 44bd8a0c14 Commentary: Changes update 2026-06-13 22:07:14 -04:00
Geza Lore df1b1577d9 Deprecate isolate_assignments attribute (#7774)
As per discussion. Remove the unsound V3SplitAs pass. The
isolate_assignments attribute/directive is now parsed and ignored in the
frontend for compatibility but otherwise have no effect.

Fixes #7144
2026-06-13 19:40:29 +01:00
Wilson Snyder 64d680c9ba CI: Ubuntu 26.04 (#7776) 2026-06-13 08:40:36 -04:00
Geza Lore 7af22422c7 Optimize table lookups in Dfg (#7772) 2026-06-13 08:45:46 +01:00
Geza Lore ba624d7ce1 Optimize away proven redundant case statement assertions (#7771)
This is still mostly refactoring of V3Case, but with functional changes.
Decouple the exhaustiveness/overlap analysis from the decision to
convert the case using the fast bitwise testing method. This enables
dropping the 'notParallel' assertions for those we can prove exhaustive
and unique, even if we decide to convert them using the generic if/else
ladder scheme.
2026-06-13 08:45:26 +01:00
Nick Brereton 87d2610674 Support unpacked struct stream (#7767) 2026-06-12 17:32:01 -04:00
Matthew Ballance e03fa6c783 Support covergroup runtime model Phase A1 (#7728) 2026-06-12 11:40:48 -04:00
Marco Bartoli 5831cc8d46 Fix timed nested fork block with disable (#6720) (#7743)
Fixes #6720.
2026-06-12 10:42:32 -04:00
Nick Brereton 748e48f881 Fix s_eventually in parameterized interfaces (#7741) 2026-06-12 10:41:56 -04:00
Artur Bieniek dab6889f1e Support assert property 'default disable iff` (#4848) (#7723) 2026-06-12 10:40:38 -04:00
Geza Lore e0c4c995b9 Fix crash on overlapping priority case 2026-06-12 14:37:05 +01:00
Geza Lore 279b425a57 Internals: Cleanup V3Case (#7769) 2026-06-12 14:15:41 +01:00
dependabot[bot] 384a63fade CI: Bump codecov/codecov-action from 6 to 7 in the everything group (#7738) 2026-06-12 07:13:57 -04:00
Ryszard Rozak e6ee6dd106 Fix bounds checks in expressions with read/write references (#7694) 2026-06-12 06:55:06 -04:00
Geza Lore 60f729639b Fix 'case (_) inside' with x wildcards (#7766)
Found by inspection, case inside used to threat 'x' as a value, not as a
wildcard. Per the standard it should behave as '==?' which treats both
'x' and 'z' as wildcards.
2026-06-12 07:48:36 +01:00
Geza Lore 4555c8b23c Internals: Cleanup case condition lifting (#7768)
V3Begin used to lift impure case expressions. With V3LiftExpr, this is
now redundant.
2026-06-12 06:38:21 +01:00
Geza Lore 0ee25038ac Optimize V3Gate inlining heuristic (#7716)
V3Gate used to inline too many expensive operations. One particularly
bad example is inlining `{<<{wide}}` (bit-reverse of a wide signal),
which is a single input node, but is quite expensive to compute, which
we always used to inline.

Change the heuristic to only inline single input nodes if they are not
wide, or a cheap wide operation, otherwise treat them the same as
multi-input ops and inline them only if they are used no more than once.
2026-06-11 20:59:18 +01:00
Geza Lore 0ee5cbf502 CI: replace deprecated app-id with client-id 2026-06-11 16:01:16 +01:00
Geza Lore c7a262b05d Optimize bit select removal earlier in Dfg (#7762)
Add a simple Dfg pass that removes redundant bit selects early. This
can significantly cut down on downstream work and remove some temporary
variables introduced during synthesis.
2026-06-11 16:00:30 +01:00
Kornel Uriasz 4c92c035e7 Support reduction XOR/AND operations in constraints (#7753) 2026-06-11 09:43:18 -04:00
Yilou Wang c6caa94fe0 Fix no-scope internal error on virtual interface method calls (#7759) 2026-06-11 09:04:06 -04:00
Adam Kostrzewski 394c9bc9b2 Fix FSM detect unchecked casts and variable redeclaration (#7758) 2026-06-11 08:37:23 -04:00
Geza Lore 901909d3c7 Optimize conditional patterns sharing common MBSs/LSBs in DfgPeephole (#7760)
Replace 3 DfgCond patterns with 2 more general ones that convert DfgCond
with common MSBs/LSBs in both branches into a DfgConcat with a narrower
DfgCond. This pattern arises frequently with Dfg synthesis.
2026-06-11 10:52:43 +01:00
Shashvat e2e1bfe8dd Internals: Remove unused V3TSP (#7194) (#7757) 2026-06-10 18:48:38 +01:00
github action 48008a2fc9 Apply 'make format' [ci skip] 2026-06-10 16:19:51 +00:00
Tracy Narine dc1e9a8ec6 Internals: Fix gcc bison warnings (#7719) (#7756)
Fixes #7719.
2026-06-10 09:18:48 -07:00
Geza Lore d84af81a11 Optimize Dfg with relaxed live variable analysis (#7739)
Relax the live variable analysis performed by Dfg to bail on fewer
cases. This analysis was already conservative (meaning it might think
variables are live when they are not), which is good enough for Dfg use.
This change in particular enables synthesizing more complex logic
involving arrays, e.g. those introduce by V3Table creating lookup
tables.
2026-06-10 15:59:44 +01:00
pawelktk 75993ca9ea Support assoc array methods with wide value types (#7680) 2026-06-10 09:39:43 -04:00
Yilin Li d1319cf81e Fix dpi export pointers (#7742) (#7751)
Fixes #7742.
2026-06-10 09:38:41 -04:00
Geza Lore de0236be2f Tests: Fix race condition in t_udp_nonsequential 2026-06-09 13:07:21 +01:00
Geza Lore 4f134c514b Testing: Rename UDP test to fix typo 2026-06-09 09:53:37 +01:00
Artur Bieniek 1d29f65eae Support property case (#7721) 2026-06-08 15:16:30 -07:00
Geza Lore 85348e3979 CI: Attempt to skip RTLMeter run jobs properly 2026-06-08 22:42:53 +01:00
Geza Lore c5945021c1 CI: Improve RTLMeter PR report (#7740)
- If any simulated cycle counts mismatch, report them and fail the job
- Keep "Elapsed" only in cppbuild
- Ignore "Elapsed" and "CPU" samples less than 30 seconds - too noisy
- Widen acceptable ranges on "Elapsed" and "Memory"
- Add badge legend
2026-06-08 22:22:52 +01:00
Artur Bieniek a3827182c0 Support s_until and s_until_with (IEEE1800-2023 16.12.12) (#7722)
Signed-off-by: Artur Bieniek <[email protected]>
2026-06-08 14:08:04 -04:00
Geza Lore 96336395d6 Internals: Simplify V3CfgLiveVariables to work only in scoped mode
No functional change
2026-06-08 17:06:45 +01:00
Geza Lore ece4d71e5b Optimize CReset in Dfg (#7737)
Teach DFG about CReset. This is not so much to optimize CReset itself, but to enable synthesizing logic involving CReset, which does appear with automatic variables used only in certain branches
2026-06-08 17:01:50 +01:00
Geza Lore e6a070b93b CI: Turn off bash tracing in pages.yml - missed 2026-06-08 16:47:37 +01:00
Geza Lore 487437f87d CI: Turn off bash tracing in pages.yml 2026-06-08 16:45:40 +01:00
Geza Lore e8489cd38b CI: Fix max-parallel factor for RTLMeter runs
The intention was to run scheduled with max 2 parallel jobs, however,
due to a bug they were run with 7 just like PR runs. This didn't seem to
cause problems, so change it all to 7, except for the hierarchical,
which runs on 6, for a total of a maximum 20 parallel RTLMeter run jobs
per workflow run.
2026-06-08 13:18:01 +01:00
Geza Lore 8fef7989d7 CI: Fail RTLMeter runs fast for PRs 2026-06-08 13:17:50 +01:00
Geza Lore 20e72ae0d0 Configure: Fall back on dynamic malloc libraries if static not available (#7736)
When configured with --enable-partial-static (default on), only the
availability of static libraries were checked. Some platform only
package dynamic libs. If the static library is not found, fall back on
trying the dynamic one.
2026-06-08 11:55:38 +01:00
Wilson Snyder 57c9f22e3c Tests: Enforce 2-space indents on Verilog 2026-06-07 22:00:24 -04:00
Wilson Snyder 96630cee5a Verilog format 2026-06-07 21:55:43 -04:00
Wilson Snyder 53cb913ab6 Internals: Fix lint-py warning 2026-06-07 21:37:16 -04:00
Marco Bartoli 2db34818b3 Fix parameter values in coverage bins widths (#7732) (#7734)
Fixes #7732.
2026-06-07 20:47:43 -04:00
Marco Bartoli 4d556dfcc7 Fix s_eventually on interface (#7731) (#7733)
Fixes #7731.
2026-06-07 20:46:00 -04:00
Wilson Snyder 4e49941b39 CI: Skip later CI on reformat
Small chance a bug gets through, but this will avoid multiple runs on the
common case of reformatting users' pull requests, and related run
cancellation problems.
2026-06-07 16:02:29 -04:00
Geza Lore 5cb8d8291a CI: Load RTLMeter cases to run from separate file (#7730)
Add a script that prints the job matrix of cases to run with RTLMeter.
This enables running different sets based on parameters. It will run
everything on scheduled nightly runs, but only a subset on PRs (to reduce
time and variance due to short cases).

Also prints the job matrix in descending duration order, which
effectively makes GitHub actions schedule longest jobs first to reduce
total workflow latency.
2026-06-07 20:50:31 +01:00
Geza Lore 220e46994c CI: Combine RTLMeter collate step to reduce job count (#7729) 2026-06-07 20:30:57 +01:00
Geza Lore 83ef69d866 CI: Run RTLMeter on the same machine with target commit (#7726) 2026-06-07 15:36:34 +01:00
Wilson Snyder d9cbc27902 Disable blank github issues 2026-06-07 08:47:00 -04:00
Wilson Snyder d62ebf9e6d Update github issue templates 2026-06-07 08:40:07 -04:00
Wilson Snyder f20076c4a3 Commentary: Changes update 2026-06-07 08:34:17 -04:00
Geza Lore 4e3be56415 CI: Improve RTLMeter reports (#7725) 2026-06-07 11:50:02 +01:00
Geza Lore 4ee19c4065 CI: Generate whole RTLMeter report in ci-rtlmeter-report.bash 2026-06-07 09:54:40 +01:00
Geza Lore 067cd6c9c6 CI: Show summary tables in 'pr: rtlmeter' results 2026-06-06 19:10:27 +01:00
em2machine 680ef8dda9 Fix for HIERPARAM - relax checking (#7570) (#7690) 2026-06-06 11:55:47 -04:00
Wilson Snyder 85d9c38ebf Commentary: Changes update 2026-06-06 10:46:18 -04:00
Wilson Snyder 629266a988 Fix whitespace 2026-06-06 10:46:02 -04:00
Geza Lore e35b2429ff Optimize $countones constant in Dfg 2026-06-06 06:11:13 +01:00
Geza Lore ca376d681a Optimize $onehot in Dfg 2026-06-06 06:11:13 +01:00
Geza Lore e53d6d9006 Improve procedural loop unrolling
- Enable unrolling of nested loops when the inner loop updates the
  outer loop condition
- Enable unrolling 'for' loops with break statements
2026-06-06 06:11:13 +01:00
github action e9274be247 Apply 'make format' 2026-06-06 00:44:02 +00:00
Nikolai Kumar bc86701bec Support forceable on unpacked array variables (#7677) (#7678)
Fixes #7677.
2026-06-05 20:43:06 -04:00
Wilson Snyder 816ab67826 Commentary: Changes update 2026-06-05 18:36:55 -04:00
Ryszard Rozak 0851d1fbe5 Fix optimizations of assignments with timing controls (#7718) 2026-06-05 12:21:21 -04:00
Matthew Ballance 2886291eba Support covergroups, coverpoints, and bins (#784) (#7117)
Fixes #784.
2026-06-05 09:35:01 -04:00
Mateusz Gancarz 7e2fe64ae2 Fix splitting functions containing fork logic (#7717) 2026-06-05 09:32:52 -04:00
Larry Doolittle 99f62fca62 Adjust installredirect Makefile action to not write to ${srcdir} (#7715) 2026-06-05 06:53:50 -04:00
Yogish Sekhar 947a08965e Add hierarchy-aware reporting to verilator_coverage (#7657) 2026-06-04 09:32:19 -04:00
Geza Lore 14cf611c72 Internals: Factor out inlining predicate in V3Gate
No functional change.
2026-06-04 09:33:24 +01:00
Nick Brereton 81282c3d57 Fix (const) ref default task argument handling (#7698) 2026-06-03 22:31:21 -04:00
Nick Brereton 4d5393c191 Fix tristate lowering for interface inout ports (#7134 repair) (#7708) (#7710)
Fixes #7708.
2026-06-03 19:51:49 -04:00
Todd Strader 7bd41bfbb9 Fix MULTIDRIVEN in generates (#7709) 2026-06-03 19:50:56 -04:00
Artur Bieniek 72db0b575e Support if/if-else in properties (#7692) 2026-06-03 15:54:15 -04:00
Nick Brereton bbd8d927ee Support printing enum names for %p and %s (#5523) (#7338 repair) (#7521) (#7527) 2026-06-03 14:55:00 -04:00
Geza Lore 41811d436f Optimize runtime assertOn() checks (#7707)
Combine consecutive assertOn() checks into one, and hoist past enclosing
'if' statements if possible. This enables combining a lot of them, which
can be worth 10% performance on some assertion heavy designs depending
on how the assertions are written.
2026-06-03 18:09:49 +01:00
Nick Brereton 1af9c39759 Fix ref-arg type check for packed arrays with differing range directions (#7700) 2026-06-03 12:49:14 -04:00
Igor Zaworski bbf8471c2a Fix of ignoring not found pruned modules with encoded names (#7706) 2026-06-03 12:19:33 -04:00
Geza Lore c878a7e735 Optimize VL_ONEHOT
Equivalent to `__builtin_popcount(_) == 1` and a few instructions
shorter.
2026-06-03 11:24:34 +01:00
Geza Lore 7b45b3ee8a Optimize string formatting runtime functions
Add an overload that takes `const char*` format string. This avoids
having to construct/destruct a temporary `std::string` at the call site
when calling these functions with a string literal, which is fairly
common. This is worth 25% code size on some assertion heavy design.

Also use `std::string::clear()` instead of assigning an empty string
which is more efficient.
2026-06-03 11:18:38 +01:00
Geza Lore 715f5f0c13 Optimize $sformatf into $sformat (#7701)
Turn `x = $sformatf(...)` into `$sformat(x, ...)`. The former requires
checking and running a destructor for `x` at the call site, the later
does it in the callee VL_SFORMAT. This reduces the size of the call
site, which can be significant e.g. in the presence of many assertions.

Also added a rewrite of `$sformat(x, "const-string")` back into `x =
"const-string"` for the cases where the `$sformatf` would have been
folded into a constant string.
2026-06-03 08:43:05 +01:00
Geza Lore efb83c55de Optimize VL_SFORMAT when result is string (#7702)
Omit unused bit width parameter. Emit rule is simple enough to change
and the unused parameter just bloats code size.
2026-06-03 08:42:48 +01:00
Geza Lore 970e7983d3 Optimize $sformat in V3Life (#7703)
Treat AstSFormat as a special form of assignment in V3Life. This allows
eliminating earlier redundant assignments to strings when an $sformat
later sets the string. UVM has lot of these.
2026-06-03 08:41:58 +01:00
Geza Lore 0026a73ca0 Optimize DPI import argument passing (#7704)
Pass inputs to DPI import wrappers by reference (unless fits in a
register). This eliminates a lot of temporary constructors/destructors.
2026-06-03 08:41:33 +01:00
Krzysztof Bieganski 7664bbb3ef Support generic interface arrays (#7604) 2026-06-02 22:28:50 -04:00
github action 0c9448dadd Apply 'make format' 2026-06-02 20:47:02 +00:00
Tracy Narine ee793669c5 Support MacOS lldb (#7697) 2026-06-02 16:42:42 -04:00
Igor Zaworski fe4adfe273 Support process::self().srand() (#7695) 2026-06-02 12:00:27 -04:00
Kamil Danecki 802efd579a Fix t_class_param type invalid array access (#7615 repair) (#7653) (#7693) 2026-06-02 09:01:05 -04:00
Geza Lore c079aa0b17 Optimize wide conditional expansion in V3Premit (#7691)
V3Premit extracts wide sub-expressions via temporaries, which is needed
for emitting wide operations to C++ (calls to `VL_*_W`). The previous
version used to extract both branches of an AstCond unconditionally,
meaning both branches were fully evaluated. Rewriting the AstCond into
an AstIf instead enables evaluating only the required branch. While
this does limit V3Subst, overall the resulting code is ~3% faster,
and contains ~25% fewer branches on a large design.
2026-06-01 20:25:41 +01:00
Yilou Wang 39b9901032 Support weak until / until_with property operators (#7290) (#7548) (#7685)
Fixes #7290. Fixes #7685.
2026-06-01 14:50:13 -04:00
Wilson Snyder e965fb92de Fix skipping nulls in $sscanf (#7689).
Fixes #7689.
2026-05-31 17:25:28 -04:00
Wilson Snyder 72ed55b180 Support strength on buf/not 2026-05-31 08:54:29 -04:00
Wilson Snyder 5def7c2b5d Commentary: Changes update 2026-05-31 07:16:30 -04:00
Paul Swirhun 1eb12685a7 Support streaming into 2-D unpacked arrays (#7686) (#7687)
Fixes #7686.
2026-05-30 22:08:32 -04:00
github action e2063e7ac0 Apply 'make format' 2026-05-30 19:36:22 +00:00
Muzaffer Kal 57fa98e52c Fix TSP variable ordering for mtasks (#5342) (#7610)
Fixes #5342
2026-05-30 15:35:12 -04:00
Wilson Snyder 2ccaae77ae Fix CONTASSINIT false positive on wire inside two different instantiations
Fixes #7640.
2026-05-30 15:23:02 -04:00
Wilson Snyder 99a24c7f39 Commentary: Changes update 2026-05-30 15:16:41 -04:00
Wilson Snyder 2d16ca375d Tests: Rename t_lint_contassinit 2026-05-30 14:48:01 -04:00
Yilou Wang fa0f814686 Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684)
Fixes #7563
2026-05-30 13:00:35 -04:00
Nick Brereton 125bdb45f5 Support pre/post increment/decrement inside && and || (#7683) 2026-05-29 19:51:27 -04:00
Geza Lore 9455dddab4 Optimize if branches with same trailing statements (#7674)
If the same statements appears in both branches of an 'if', put a single
copy after the 'if', apply recursively. This also has the effect of
getting rid of conditionals with identical branches, but is more widely
applicable.
2026-05-29 11:26:07 +01:00
Nick Brereton 5d344ab8ff Fix parameter read through locally-declared interface instance (#7679) 2026-05-28 21:20:49 -04:00
em2machine 3d126b77cd Fix for access to parameters via class::localparam (#7609) (#7671) 2026-05-28 17:40:18 -04:00
Zubin Jain 77f0883b06 Fix forceable signal with a procedural continuous assign (#7638) (#7639) 2026-05-28 16:03:27 -04:00
Geza Lore 557dda3396 Fix AstNodeFTaskRef equivalence check (#7673) 2026-05-28 20:33:41 +01:00
Artur Bieniek 45fae00064 Fix width of unsized literal in property expression (#7668) 2026-05-28 15:10:25 -04:00
Geza Lore 55d78b225d Fix signing off new MULTIDRIVEN warnigns on variable (#7672) 2026-05-28 13:34:36 -04:00
Artur Bieniek 3a91b333c3 Fix loss of events due to bit shift (#7670) 2026-05-28 12:45:18 -04:00
Tracy Narine f52fb1f1db Tests: Simplify t_runflag_logfile_open_bad.py (#7669)
Fixes #7667
2026-05-28 12:43:07 -04:00
Pawel Kojma 70045433c9 Fix reserved keywords reaching emitter (#7666) 2026-05-28 10:04:14 -04:00
github action 3bc7021211 Apply 'make format' 2026-05-28 11:21:07 +00:00
Cookie b5555a032e Internals: clean up for redundant m_alwCombFileLinep and m_nodeFileLinep variables (#7665) 2026-05-28 07:20:06 -04:00
Geza Lore cd83e40be5 Fix runtime speed summary report
Repost speed as 'simtime'/'walltime' instead of dividing by 'cputime'
('cputime' is ~ 'threads * walltime' in multi-threaded mode)
2026-05-28 07:20:54 +01:00
em2machine 29d2f522bf Fix internal error when handling typedefs containing parameterized class type members (#7635) (#7661)
Fixes #7635.
2026-05-27 12:17:49 -07:00
Tracy Narine a2fae5eb4b Add +verilator+log+file (#4505) (#7645)
Fixes #4505.
2026-05-27 14:33:19 -04:00
github action 62f475709f Apply 'make format' 2026-05-27 12:35:09 +00:00
Cookie 8ae0e48103 Fix false MULTIDRIVEN warning on always_ff variables (#7351) (#7621) 2026-05-27 08:34:11 -04:00
Bartłomiej Chmiel c9e012ba9a Internals: Suppress clang-tidy warnings in macros (#7656) 2026-05-27 05:16:49 -07:00
github action 291141777e Apply 'make format' 2026-05-27 07:26:42 +00:00
Nikolai Kumar cd532e0e79 Fix dropped iff guard on clocking inside task (#7658) (#7659)
Fixes #7658
2026-05-27 00:24:54 -07:00
github action 99a35fee83 Apply 'make format' 2026-05-26 16:21:12 +00:00
Cookie 9460501221 Add NOTREDOP error on reduction and negation operators (#7417) (#7623) (#7624) 2026-05-26 12:20:15 -04:00
Cookie 9e2fedee6f Fix ALWCOMBORDER on variable ordering (#7350) (#7608) 2026-05-26 06:40:55 -04:00
em2machine a2d4b90b52 Fix dearray varref scope error (#7530) (#7602)
Fixes #7530.
2026-05-25 17:48:31 -04:00
Yogish Sekhar 8872908704 Tests: Update tests to include parameterized modules (#7655) 2026-05-25 17:46:54 -04:00
Yilou Wang 86799ace5d Fix wrong false assert for property local variables with cycle-delayed consequents (#7587) (#7651)
* Fix wrong false assert in property local variable with cycle-delayed consequent

* factor helper for 100 line cov

* add return, should be 100 line cov now
2026-05-25 20:13:27 +08:00
github action be783e5574 Apply 'make format' 2026-05-24 22:09:56 +00:00
Yogish Sekhar cf8713aebc Add --coverage-per-instance 2026-05-24 18:08:55 -04:00
github action 6b48b772d3 Apply 'make format' 2026-05-24 15:43:38 +00:00
Yogish Sekhar 4fbb8bf43b Fix hierarchical coverage counts for duplicate no-inline module instances (#7649) 2026-05-24 11:42:42 -04:00
Yilou Wang 6c96ce4b40 Fix inherited rand array with .size + foreach constraint (#7650)
Fixes #7558.
2026-05-24 09:02:01 -04:00
Geza Lore f93b4bbd05 Internals: Remove 'VlWide::operator bool()' (#7652)
This was a fudge to work around using VlWide in `if` conditions without
a `_ != 0` check. That check is actually inserted by V3Width (or an
equivalent reduction), so the offending code was only generated
internally. Hopefully fixed the single instance where this really
happened. (If not, C++ will fail to compile with "cannot convert VlWide
to bool in 'if (__HERE__)'" errors, still better than the old version
which used to silently not do the right test due to incorrect implicit
conversions.)
2026-05-24 13:09:31 +01:00
Geza Lore bd4bd82d4b Optimize primitive runtime functions
These were a victim of recent refactor but are actually important
(#4733). It also helps in debug builds not to use -O0 memcpy/memset.
2026-05-24 11:39:39 +01:00
Wilson Snyder f0c569ab0d Fix CASEINCOMPLETE to not warn on unique0 case (#7647).
Fixes #7647.
2026-05-23 20:04:54 -04:00
Geza Lore adddec6547 Tests: Reduce peak memory use of UVM tests (#7648) 2026-05-23 19:36:25 -04:00
Yogish Sekhar 7935321b25 Fix FSM thread nondeterminism (#7644) (#7646) 2026-05-22 22:30:01 -04:00
Wilson Snyder c507dcf610 Internals: Enforce types on C++ enums. No functional change intended. 2026-05-22 17:59:57 -04:00
Wilson Snyder c0dc77c908 Commentary: Changes update 2026-05-22 17:57:11 -04:00
Geza Lore c99aa8ede5 Fix erroneous implicit conversions of VlWide (#7642)
Change WDataInP/WDataOutP to be opaque handles types instead of aliases
to raw pointers. This subsequently eliminates needing an implicit cast
operator in VlWide, which is replaced with implicit constructors of
WDataInP/WDataOutP that can create a handle from a VlWide. This
eliminates some unsafe conversions that the previous implicit cast
operator unintentionally enabled (e.g. #7618). It also eliminates
having to insert ".data()" in various places int he generated code, which
simplifies internals (the only place ".data()" should be needed is in
calls to variadic functions where the expected type of the argument is
not WDataInP/WDataOutP).

The handles otherwise behave like pointers, implementing the minimal
amount of operators required to code the runtime. The handle is still
only a single pointer, and will be passed in registers as before, so
this patch should be performance neutral.

As part of this removed WData, which used to be an alias for EData.
All uses are now either EData*, WDataInP, WDataOutP, or VlWide directly.
2026-05-22 20:05:08 +01:00
Geza Lore ef72b2fabb Tests: Disable t_fsm_register_wrapper_noinline --vltmt (#7644) 2026-05-22 14:27:40 +01:00
Lucas Amaral 20f4eca646 Support busses with mix of pullup/pulldown (#7632) 2026-05-21 14:45:40 -04:00
github action a208d17939 Apply 'make format' 2026-05-21 17:51:28 +00:00
Yogish Sekhar f282335600 Support FSM detection in primitive wrappers (#7607) 2026-05-21 13:50:31 -04:00
Artur Bieniek 6a74112f0b Fix V3Force deterministism (#7620) (#7637)
Fixes #7620.
2026-05-21 11:04:17 -04:00
Benjamin Collier 69b3c5f6d1 Support streaming on queues (#7597) 2026-05-20 19:14:02 -04:00
Nick Brereton c5798f902b Fix reference counting for modport task references (#7628) 2026-05-20 14:24:56 -04:00
github action d874d2fd06 Apply 'make format' 2026-05-20 11:11:52 +00:00
Yogish Sekhar 9e4863589e Fix non-determinism in FSM detection (#7619)
Fixes #7619
2026-05-20 12:10:53 +01:00
Wilson Snyder daa4a108de Commentary: Debugging non-determinism 2026-05-19 21:51:12 -04:00
Wilson Snyder f3a86bacdd Commentary: Changes update 2026-05-19 21:40:08 -04:00
Geza Lore afad8db672 Fix VlWide equality comparion in unpacked structs (#7618) 2026-05-20 00:57:33 +01:00
Michael Rogenmoser cb3b9c7c43 Fix nested parameterized class typedef chain (#7538) 2026-05-19 14:12:24 -04:00
Kamil Danecki b06ea01afb Fix type parameters order (#7615) 2026-05-19 09:52:09 -04:00
Pawel Klopotek efdc8d1cbf Fix unique_index method on assoc arrays with values differing from the keys (#7616)
Signed-off-by: Pawel Klopotek <[email protected]>
2026-05-19 09:51:23 -04:00
github action 662cd43348 Apply 'make format' 2026-05-19 01:41:54 +00:00
Nikolai Kumar a67c5f81f3 Fix clocking-block sample of unpacked array (#7612) (#7613)
Fixes #7612.
2026-05-18 21:40:54 -04:00
dependabot[bot] 2ebb99aaa2 CI: Bump actions/create-github-app-token in the everything group (#7611) 2026-05-18 20:48:53 -04:00
Krzysztof Bieganski eb258d7df7 IEEE-compliant, fair std::semaphore (#7435) (#7605)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2026-05-18 11:11:42 +02:00
Yilou Wang 00c9e58006 Fix internal error on consecutive repetition with N > 256 (#7552) (#7603) 2026-05-17 21:54:10 -04:00
Greg Davill 57ce373e99 Fix array pattern concatenation (#7401) (#7402) 2026-05-17 09:49:32 -04:00
github action 7f520ff1a2 Apply 'make format' 2026-05-17 11:35:24 +00:00
Muzaffer Kal 9fe058677b Support NBAs in initial blocks with delay/event controls (#7566) (#7600)
Fixes #7566.
2026-05-17 07:34:29 -04:00
Wilson Snyder c1ab369da2 Fix process comparison compile error with --public-flat-rw (#7592).
Fixes #7592.
2026-05-15 18:22:46 -04:00
Wilson Snyder 349dd546e7 Internals: Rename stdPackageProcessp etc. No functional change. 2026-05-15 17:33:19 -04:00
Geza Lore 4e853d8cb6 Fix cpu pinning when no 'core id' present in /proc/cpuinfo (#7599) 2026-05-15 14:45:39 -04:00
Geza Lore 8c8d9b4f4c Internals: Sign off pylint warnings 2026-05-15 17:39:48 +01:00
Yilou Wang f9427c6d5f Support property abort operators (accept_on, reject_on) (#7578) 2026-05-15 08:38:38 -04:00
github action 442dd91683 Apply 'make format' 2026-05-15 11:53:21 +00:00
Stuart MorrisandLeela Pakanati 67e74c5ce4 Fix interface instance name collision (#7591) (#7593)
Fixes #7591.

Co-authored-by: Leela Pakanati <[email protected]>
2026-05-15 07:52:26 -04:00
Krzysztof Bieganski a42c8587cb Optimize force read return values (#7596) 2026-05-14 20:26:02 -04:00
Wilson Snyder d66733aeb8 Fix process comparison compile error with --public-flat-rw (#7592).
Fixes #7592.
2026-05-14 17:52:28 -04:00
Wilson Snyder dff2606c0c Commentary: Changes update 2026-05-14 17:38:11 -04:00
Artur Bieniek fb617e49dd Optimize read selects with no overlapping forces with regular reads (#7594) 2026-05-14 16:46:57 -04:00
Zubin Jain 4a1f17e75f Fix force of unpacked arrays (#7579) (#7580)
Fixes #7579.
2026-05-14 10:58:16 -04:00
Krzysztof Bieganski c518abd22a Optimize reading selected words on forced wide (#7391 repair) (#7554 partial) (#7572) 2026-05-14 07:38:42 -04:00
Geza Lore de4f743d0e Internals: Use /bin/sh to test gdb (#7586) 2026-05-14 04:29:24 -04:00
Wilson Snyder a3da587fc3 Internals: Show operator in assert 2026-05-13 21:02:45 -04:00
Wilson Snyder 83b1dacce1 CI: Use windows-2025-vs2026 2026-05-13 21:02:05 -04:00
Wilson Snyder 1653b982b9 Verilog format 2026-05-13 21:00:34 -04:00
Thomas Brown 1c3ee7ce4c Support expression coverage on assign statements (#7543) 2026-05-13 13:59:29 -04:00
Geza Lore e485dfe48c Fix NBA to whole arrays (#7583)
Fixes #7575
2026-05-13 13:20:22 +01:00
Krzysztof Bieganski 3381d656c7 Support calling interface functions without parens (#7584)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2026-05-13 08:15:32 -04:00
Yilou Wang 05302080a9 Support procedural concurrent assertions with inferred clock (#7581) 2026-05-13 07:42:28 -04:00
Jakub Michalski 1ffa6b277d Fix property argument retaining type of the previous variable (#7582)
Signed-off-by: Jakub Michalski <[email protected]>
2026-05-13 07:41:35 -04:00
Yogish Sekhar 8312e9d901 Extend FSM Detect to support 'Wide State Encodings' (#7573) 2026-05-13 06:59:22 -04:00
Nick Brereton 9588e67ca9 V3Timing: pre-clear destructive event state before dynamic waits (#7340)
When lowering dynamic event controls, destructive pre-clear updates were inserted with addHereThisAsNext() on the original node and then that node was replaced. This could leave leaked/orphaned nodes under leak-checking runs.

Build an explicit replacement stmt chain instead:
  [pre-clear stmts] -> trigger loop -> awaitResumption,
and replace the original control with the chain head. Keep the loop-only path unchanged when no destructive pre-clear is needed.
2026-05-12 19:01:37 +01:00
anonkey 67b21e4c62 Fix segmentation fault when using --trace with --lib-create (#7299) (#7518) 2026-05-12 10:16:47 -04:00
Wilson Snyder 831396f848 Commentary: Changes update 2026-05-12 09:52:18 -04:00
Jakub Michalski 05f6db7970 Optimize emitting to_string() for compiler speedup (#7468)
Signed-off-by: Jakub Michalski <[email protected]>
2026-05-12 09:49:21 -04:00
github action a5a1ed55d3 Apply 'make format' 2026-05-12 11:40:38 +00:00
Yu-Sheng Lin 0ebe01a778 Support new FST writer API (#6871) (#6992) 2026-05-12 07:39:43 -04:00
Wilson Snyder bdcdc10966 Fix floating point compile warning on min/max delays. 2026-05-11 19:50:48 -04:00
Wilson Snyder b27e7c02ee Tests: Prefer --binary over timing multipliers 2026-05-11 19:50:48 -04:00
Wilson Snyder d2047e5bad Commentary: Changes update 2026-05-11 19:50:48 -04:00
github action edab09333c Apply 'make format' 2026-05-11 22:33:56 +00:00
Cookie cf9334f2c1 Fix error on mixed-initialization (#7352) (#7357) 2026-05-11 18:32:55 -04:00
Wilson Snyder 18e06b1e7d Fix display of %m in non-first argument (#7574).
Fixes #7574.
2026-05-11 08:18:34 -04:00
Yilou Wang b0d58bbcef Support SVA goto repetition with range [->M:N] (#7569) 2026-05-11 07:07:51 -04:00
github action 485c0e746c Apply 'make format' 2026-05-10 17:13:56 +00:00
Yogish Sekhar f67159de30 Extend FSM coverage detection to case-free FSMs - Use - if/else chains (#7561) 2026-05-10 13:12:58 -04:00
Wilson Snyder 303615bb37 Support TERMUX (#7559). [Laurent CHARRIER]
Fixes #7559.
2026-05-10 08:20:32 -04:00
Wilson Snyder 2bc294ccad Commentary: Add AI policy (#7215) 2026-05-09 19:23:17 -04:00
Wilson Snyder 1630a2724b Commentary: Changes update 2026-05-09 19:22:47 -04:00
Artur Bieniek c69c11b2db Support procedural continuous assign/deassign (#7493) 2026-05-08 19:01:11 -04:00
Yilou Wang 8eca6b8fe7 Fix regression rejecting boolean !x inside sequence expressions (#7549) (#7551)
Fixes #7549.
2026-05-08 18:34:28 -04:00
Kamil Danecki 5820d2936c Support writing to inout in fork after timing (#7345) 2026-05-08 16:35:34 -04:00
Todd Strader f85641e40d Tests: Use top shell w/ xrun (#7556) 2026-05-08 16:03:45 -04:00
Varun Koyyalagunta a3003a2d0f Add 15 new DFG peephole optimizations (#7553)
- FOLD_SELF_SUB: x - x -> 0
- REMOVE_DIV_ONE / REMOVE_DIVS_ONE: x / 1 -> x (unsigned and signed)
- REMOVE_MUL_ZERO / REMOVE_MUL_ONE / REMOVE_MULS_ZERO / REMOVE_MULS_ONE:
  0 * x -> 0 and 1 * x -> x (unsigned and signed)
- REPLACE_NOT_LT/GTE/GT/LTE and their signed counterparts: eliminate a
  Not vertex by flipping the comparison operator

Test signals for the NOT-of-comparison GT/GTE variants use unique shift
amounts to prevent intra-pass CSE from merging their DfgGt/DfgGte vertices
with those produced when the complementary LT/LTE patterns fire, which
would otherwise trigger the !hasMultipleSinks() guard.
2026-05-08 12:39:33 -05:00
Todd Strader aa68ae953e Tests: Make xrun fail on stop (#7547) 2026-05-08 07:39:38 -04:00
Geza Lore 7c5069c7df Fix exponential expansion in V3Gate (#7550)
Unfortunate constellation of combinational assignments could be inlined
by V3Gate yielding an exponential expansion (added test used to consume
4GB+ memory and generate 3GB+ code).
2026-05-07 22:01:08 -05:00
Geza Lore db8b6ce26d Add peak memory usage to --stats 2026-05-07 20:28:47 -05:00
Todd Strader 752b77ea77 Fix events in observed region (#7546) 2026-05-07 17:02:41 -04:00
Kamil Danecki 1a367a13fc Fix side effect internal error (#7519) (#7540) (#7544) 2026-05-07 09:21:04 -04:00
Yogish Sekhar ce34f1a070 Improve FSM Detection when state variables are non-enums (#7529) 2026-05-07 06:53:19 -04:00
em2machine d5f9385e9c Fix class::localparam during elaboration (#7524) (#7534) 2026-05-06 11:46:33 -04:00
github action 252afef499 Apply 'make format' 2026-05-06 11:26:07 +00:00
Yogish Sekhar 22db9d2c66 Add mnemonic to parameter constants in JSON for FSM Coverage (#7531) 2026-05-06 07:25:03 -04:00
Jakub Michalski 227812ecce Internals: Fix unused variables (#7539) 2026-05-06 06:51:05 -04:00
Michael Rogenmoser a2874b324a Tests: Add virtual interface scheduling convergence tests (#7323 test) (#7536) 2026-05-05 19:17:53 -04:00
Miguel 0e423a4b39 Fix +verilator+seed to default to 1, and 0 to randomly select (#7325) (#7516) 2026-05-05 12:10:51 -04:00
Wilson Snyder d2ae094d43 Commentary (#7532) (#7533) 2026-05-04 18:01:55 -04:00
Wilson Snyder 9a24b3d7ba Commentary: Changes update 2026-05-04 18:00:37 -04:00
Yilou Wang fc49811fd7 Support randsequence production function ports (#7522) 2026-05-04 11:28:17 -04:00
Bartłomiej Chmiel 4e349971d3 Support s_eventually (#7291) (#7508) 2026-05-04 09:57:03 -04:00
Yilou Wang bc1acc8aa3 Support followed-by operators #-# and #=# in properties (#7523) 2026-05-04 08:10:37 -04:00
Geza Lore ddcb04b921 CI: Run Servant in RTLMeter jobs 2026-05-03 20:19:15 -04:00
24bit-xjkp 082847a1a2 Fix std::unique_ptr with incomplete type for clang (#7501) (#7526)
Fixes #7501.
2026-05-02 12:14:54 -04:00
Yilou Wang 8011f9a796 Internals: V3AssertNfa: hoist sampled(propp) into a per-property temp (#7502) (#7525)
Fixes #7502.
2026-05-02 12:13:58 -04:00
Kamil Danecki 659274e45d Fix array indexing side effects in compound assignments (#7519) 2026-05-01 20:35:51 -04:00
Igor Zaworski 25d4827bd5 Internals: Four state pre-pull (types) (#7520) 2026-04-30 16:56:15 -04:00
Artur Bieniek ec03edcddd Support functions on RHS of force (#7491)
Signed-off-by: Artur Bieniek <[email protected]>
2026-04-30 10:38:07 -04:00
Wilson Snyder dd75c4cd1b Revert: 21020ea2: Support printing enum names for %p and %s (#5523 revert) (#7338 revert) (#7521 test) 2026-04-30 10:29:47 -04:00
github action 021f5f7d02 Apply 'make format' 2026-04-30 11:23:36 +00:00
Yogish Sekhar 7f01806e15 Improve FSM coverage detection (#7490) 2026-04-30 07:22:34 -04:00
Nick Brereton 21020ea2d1 Support printing enum names for %p and %s (#5523) (#7338) 2026-04-30 07:15:38 -04:00
em2machine d15b1fba94 Fix $bits on local struct with chained-interface (#7515) (#7517) 2026-04-30 07:12:11 -04:00
Yilou Wang 4befec4463 Support rand_mode() on static rand class members (#7484) (#7510) 2026-04-29 17:07:27 -04:00
Wilson Snyder 30edb987d2 CI: Add automatic code coverage references 2026-04-29 07:52:43 -04:00
Nikolai Kumar 4ebc4f1eee Fix V3Assert stale failsp after recursive iteration (#7500) (#7513)
Fixes #7500.
2026-04-29 05:18:12 -04:00
Wilson Snyder 8f18f0cf22 Fix internal error instead of missing prototype error (#7485). [Alex Solomatnikov]
Fixes #7485.
2026-04-28 17:59:18 -04:00
Wilson Snyder 6aebcd2b1c Commentary: Changes update 2026-04-28 17:56:24 -04:00
Todd Strader 0188679631 Fix expression coverage in loops (#7511) 2026-04-28 15:33:41 -04:00
Yilou Wang 76c1b26e3b Support obj.randomize(null) (#7487) (#7509) 2026-04-28 15:31:08 -04:00
Nikolai Kumar 93c594e18a Fix mailbox#(packed_struct) type mismatch with parameterized class (#7494) (#7495) 2026-04-28 15:25:37 -04:00
Yilou Wang bb1bfabab3 Fix internal error on multi-cycle SVA under default clocking (#7472) (#7506) 2026-04-28 06:50:16 -04:00
Yilou Wang 327fc4ffbe Support randomize() with (identifier_list) {constraint_block} (#7486) (#7507)
Fixes #7486.
2026-04-28 06:10:53 -04:00
Yilou Wang 5d1b4fe8a8 Fix generic interface port forwarded to a nested instance (#7454) (#7457)
Fixes #7454.
2026-04-27 21:15:25 -04:00
github action c460f0e6a0 Apply 'make format' 2026-04-27 21:05:49 +00:00
Nikolay Puzanov 4437ae79e7 Fix virtual interface method call inlining and IMPURE suppression (#7505) 2026-04-27 16:58:30 -04:00
Geza Lore cee174c4b6 Fix inlining static initializer in V3Gate (#7503)
V3Gate could incorrectly inline a non-constant static initializer of
a variable into the use site if there are no other drivers. Disabling.

Fixes #5381
2026-04-27 16:58:38 +01:00
Yilou Wang c8893b64de Support always / always[m:n] / s_always[m:n] property operators (#7482) 2026-04-27 08:20:34 -04:00
github action e4803f29b6 Apply 'make format' 2026-04-26 10:29:56 +00:00
hjsanjana 982b9ee219 Fix std::randomize internal error on static member of different class (#7498) (#7499)
Fixes #7498.
2026-04-26 06:24:40 -04:00
Wilson Snyder 2875ec8655 Commentary: Version release process 2026-04-26 02:00:32 -04:00
Wilson Snyder 74ae91a6d0 devel release 2026-04-26 01:58:27 -04:00
2943 changed files with 263004 additions and 45407 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance,-llvmlibc-*,-altera-*,-boost-use-ranges'
Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-do-while,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-macro-usage,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance,-llvmlibc-*,-altera-*,-boost-use-ranges'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
+2
View File
@@ -0,0 +1,2 @@
---
blank_issues_enabled: false
+18 -2
View File
@@ -7,18 +7,34 @@ assignees: ''
---
<!--
Thanks for taking the time to report this.
Can you please attach an example that shows the issue or missing feature? (Must be openly licensed, completely self-contained so can directly run what you provide. Ideally use test_regress format, see https://veripool.org/guide/latest/contributing.html?highlight=test_regress#reporting-bugs)
Please avoid attaching screenshots that show text - you can convert images to text using e.g. https://ocr.space
Please remove this block when composing, and all other blocks starting with < !--.
-->
Can you please attach an example that shows the issue or missing feature?
<!-- Please replace this with your answer. Examples must be openly licensed, completely self-contained so can directly run what you provide. Ideally use test_regress format, see https://veripool.org/guide/latest/contributing.html?highlight=test_regress#reporting-bugs -->
What output from that test indicates it is wrong, and what is the correct or expected output? (Or, please make test self-checking if possible.)
<!-- Please replace this with your answer -->
What 'verilator' command line do we use to run your example?
<!-- Please replace this with your answer -->
What 'verilator --version' are you using? Did you try it with the git master version? Did you try it with other simulators?
<!-- Please replace this with your answer -->
What OS and distribution are you using?
<!-- Please replace this with your answer -->
May we assist you in trying to fix this in Verilator yourself?
(Please avoid attaching screenshots that show text - you can convert images to text using e.g. https://ocr.space)
<!-- Please replace this with your answer - then hit "Preview" to see the formatted result before submitting. -->
+9 -1
View File
@@ -7,6 +7,14 @@ assignees: ''
---
<!--
Thanks for taking the time to report this.
If reporting a bug or requesting a feature please hit BACK on your browser and use a different issue templates.
Please remove this block when composing, and all other blocks starting with < !--.
-->
How may we help - what is your question?
(If reporting a bug or requesting a feature please hit BACK on your browser and use a different issue templates.)
<!-- Please replace this with your answer - then hit "Preview" to see the formatted result before submitting. -->
+165
View File
@@ -0,0 +1,165 @@
---
# DESCRIPTION: Github actions composite action
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Artifact cache
description: >-
Cache a directory across workflow runs using a GitHub Actions artifact instead
of actions/cache (useful where artifacts are preferable, e.g. no 10 GB limit
on public repos). The base 'key' is scoped automatically: per pull request
(<key>-pr-<N>) or per branch (<key>-branch-<name>), and on a PR restore falls
back to the target branch's cache. Call once with mode=restore before the work
and once with mode=save after, passing the same 'key' and 'path'.
Branch-scoped restores are provenance-checked (the artifact must come from a
same-repo push to that branch) - artifact names are a global, unauthenticated
namespace, so otherwise a fork PR could forge one.
mode=restore calls the GitHub API via 'gh', so the caller's job must grant
'actions: read'.
inputs:
mode:
description: "'restore' or 'save'"
required: true
path:
description: "Directory to cache (archived on save, extracted into on restore)"
required: true
key:
description: "Base artifact name; scoped per PR/branch automatically"
required: true
retention-days:
description: "Artifact retention in days (mode=save)"
required: false
default: '3'
token:
description: "Token for the GitHub API (mode=restore); defaults to the job's GITHUB_TOKEN"
required: false
default: ''
outputs:
key:
description: "Echoes the input 'key', so a later save can reuse it without repeating the expression"
value: ${{ inputs.key }}
cache-hit:
description: "'true' if an artifact was restored (mode=restore)"
value: ${{ steps.restore.outputs.cache-hit }}
runs:
using: composite
steps:
- name: Check mode
shell: bash
env:
MODE: ${{ inputs.mode }}
run: |
case "$MODE" in
restore|save) ;;
*) echo "::error::artifact-cache: 'mode' must be 'restore' or 'save' (got '$MODE')"; exit 1 ;;
esac
# Scope the base key: <key>-pr-<N> for pull requests (with the target branch
# as fallback), else <key>-branch-<name>. Refs come via env, not ${{ }}
# interpolation, so a branch name with shell metacharacters can't inject.
- name: Compute artifact name
id: name
shell: bash
env:
BASE_KEY: ${{ inputs.key }}
EVENT_NAME: ${{ github.event_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
REF_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
sanitize() { printf '%s' "$1" | tr '/' '-'; } # artifact names cannot contain '/'
if [ "$EVENT_NAME" = pull_request ]; then
{
echo "primary=${BASE_KEY}-pr-${PR_NUMBER}"
echo "primary-branch="
echo "fallback=${BASE_KEY}-branch-$(sanitize "$BASE_REF")"
echo "fallback-branch=$BASE_REF"
} >> "$GITHUB_OUTPUT"
else
{
echo "primary=${BASE_KEY}-branch-$(sanitize "$REF_NAME")"
echo "primary-branch=$REF_NAME"
echo "fallback="
echo "fallback-branch="
} >> "$GITHUB_OUTPUT"
fi
- name: Restore artifact cache
id: restore
if: ${{ inputs.mode == 'restore' }}
continue-on-error: true # a cold start is fine; a restore failure must not fail the caller
shell: bash
env:
GH_TOKEN: ${{ inputs.token || github.token }}
CACHE_PATH: ${{ inputs.path }}
PRIMARY: ${{ steps.name.outputs.primary }}
PRIMARY_BRANCH: ${{ steps.name.outputs.primary-branch }}
FALLBACK: ${{ steps.name.outputs.fallback }}
FALLBACK_BRANCH: ${{ steps.name.outputs.fallback-branch }}
run: |
set -euo pipefail
mkdir -p "$CACHE_PATH"
# Newest non-expired artifact named $1 (empty if none). With a non-empty
# $2 (branch), require provenance: a same-repo run (head_repository_id ==
# repository_id) whose head branch is $2, so a fork cannot forge it.
newest_run_id() {
want="$1" br="$2" gh api \
"/repos/$GITHUB_REPOSITORY/actions/artifacts?name=$1&per_page=100" \
--jq '.artifacts[]
| select(.expired == false and .name == env.want)
| select(env.br == ""
or (.workflow_run.head_branch == env.br
and .workflow_run.head_repository_id == .workflow_run.repository_id))
| [.created_at, (.workflow_run.id | tostring)] | @tsv' \
| sort | tail -n1 | cut -f2
}
restore() { # $1=name $2=branch(empty ok); returns 0 on a successful restore
local name="$1" br="$2" rid tarball
[ -n "$name" ] || return 1
rid="$(newest_run_id "$name" "$br")" || return 1
[ -n "$rid" ] || return 1
echo "Restoring '$CACHE_PATH' from artifact '$name' (run $rid)"
gh run download "$rid" -R "$GITHUB_REPOSITORY" --name "$name" --dir "$RUNNER_TEMP/artifact-cache-dl" || return 1
# Each artifact holds a single tarball; match by extension so the inner
# filename is not part of the contract.
tarball="$(find "$RUNNER_TEMP/artifact-cache-dl" -name '*.tar.zst' -print -quit)"
[ -n "$tarball" ] || return 1
tar -I zstd -x -f "$tarball" -C "$CACHE_PATH"
}
if restore "$PRIMARY" "$PRIMARY_BRANCH"; then
echo "Restored from primary key"
echo "cache-hit=true" >> "$GITHUB_OUTPUT"
elif restore "$FALLBACK" "$FALLBACK_BRANCH"; then
echo "Restored from fallback key"
echo "cache-hit=true" >> "$GITHUB_OUTPUT"
else
echo "No matching artifact found; starting cold"
echo "cache-hit=false" >> "$GITHUB_OUTPUT"
fi
- name: Pack artifact cache
id: pack
if: ${{ inputs.mode == 'save' }}
shell: bash
env:
CACHE_PATH: ${{ inputs.path }}
run: |
set -euo pipefail
packdir="$(mktemp -d)" # unique dir so concurrent saves cannot collide
tar -I 'zstd -T0' -cf "$packdir/cache.tar.zst" -C "$CACHE_PATH" .
echo "tarball=$packdir/cache.tar.zst" >> "$GITHUB_OUTPUT"
- name: Upload artifact cache
if: ${{ inputs.mode == 'save' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ${{ steps.name.outputs.primary }}
path: ${{ steps.pack.outputs.tarball }}
retention-days: ${{ inputs.retention-days }}
overwrite: true
compression-level: 0 # tarball is already zstd-compressed
+109
View File
@@ -0,0 +1,109 @@
---
# DESCRIPTION: Github actions composite action
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Install dependencies
description: >-
Install the dependencies of a CI stage with 'ci/ci-install.bash', caching the
'.deb' files apt downloads for that stage, so a package is fetched from the
network at most once per runner image. On hosts that do not use apt this is
just the install, there is nothing to cache.
inputs:
repo:
description: "Verilator checkout holding the ci/ scripts"
required: false
default: repo
stage:
description: "CI stage to install the dependencies of, e.g. 'build'"
required: true
runs:
using: composite
steps:
- name: Compute apt cache key
id: cachekey
if: ${{ runner.os == 'Linux' }}
shell: bash
working-directory: ${{ inputs.repo }}
env:
STAGE: ${{ inputs.stage }}
run: |
source ci/ci-common.bash
host="${DISTRO_ID:-$HOST_OS}${DISTRO_VERSION:+-$DISTRO_VERSION}"
echo "key=apt-${host}-${STAGE}" >> "$GITHUB_OUTPUT"
- name: Restore apt downloads
if: ${{ runner.os == 'Linux' }}
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ runner.temp }}/apt-cache
key: ${{ steps.cachekey.outputs.key }}
restore-keys: |
${{ steps.cachekey.outputs.key }}-
- name: Seed apt archive from cache
if: ${{ runner.os == 'Linux' }}
shell: bash
env:
APT_CACHE_DIR: ${{ runner.temp }}/apt-cache
run: |
set -euo pipefail
# Ask apt where it keeps its downloads, rather than assume
eval "$(apt-config shell ARCHIVES Dir::Cache::archives/d)"
ARCHIVES=${ARCHIVES%/} # '/d' yields a trailing slash
# Wipe the archive first, so that whatever the runner image left behind is not stored
sudo apt-get -o DPkg::Lock::Timeout=60 clean
# The directory is absent when nothing was restored, e.g. on a cold start
if [ -d "$APT_CACHE_DIR" ] &&
[ -n "$(find "$APT_CACHE_DIR" -maxdepth 1 -name '*.deb' -print -quit)" ]; then
sudo cp "$APT_CACHE_DIR"/*.deb "$ARCHIVES"
fi
- name: Install dependencies
shell: bash
working-directory: ${{ inputs.repo }}
env:
STAGE: ${{ inputs.stage }}
run: ./ci/ci-install.bash "$STAGE"
- name: Collect apt downloads
id: collect
if: ${{ runner.os == 'Linux' }}
shell: bash
env:
APT_CACHE_DIR: ${{ runner.temp }}/apt-cache
run: |
set -euo pipefail
# Ask apt where it keeps its downloads, rather than assume
eval "$(apt-config shell ARCHIVES Dir::Cache::archives/d)"
ARCHIVES=${ARCHIVES%/} # '/d' yields a trailing slash
# Sorted names of the '.deb' files in a directory, empty if it has none
list-debs() {
[ -d "$1" ] || return 0
find "$1" -maxdepth 1 -name '*.deb' -printf '%f\n' | sort
}
# Superseded downloads can no longer be fetched, so drop them
sudo apt-get -o DPkg::Lock::Timeout=60 autoclean
downloaded=$(list-debs "$ARCHIVES")
if [ -z "$downloaded" ]; then
echo "Apt kept no '.deb' files, nothing to cache"
exit 0
fi
if [ "$downloaded" = "$(list-debs "$APT_CACHE_DIR")" ]; then
echo "Downloads unchanged, keeping the restored cache entry"
exit 0
fi
# Mirror the archive, rather than add to it, so that the cache cannot
# grow without bound as package versions churn
mkdir -p "$APT_CACHE_DIR"
rm -f "$APT_CACHE_DIR"/*.deb
sudo cp "$ARCHIVES"/*.deb "$APT_CACHE_DIR"
echo "changed=true" >> "$GITHUB_OUTPUT"
- name: Save apt downloads
if: ${{ steps.collect.outputs.changed == 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ runner.temp }}/apt-cache
key: ${{ steps.cachekey.outputs.key }}-${{ github.run_id }}
+56
View File
@@ -0,0 +1,56 @@
---
# DESCRIPTION: Github actions composite action
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Set up Python venv
description: >-
Restore, create, and optionally save the make-managed Python venv in a GitHub
Actions cache. The cache key combines the venv path (venvs are not
relocatable), the host OS and version, the Python major.minor version, and
the python-dev-requirements.txt hash, so any of those changing invalidates
it. Requires the already-configured Verilator tree to be present in 'repo'.
inputs:
repo:
description: "Verilator checkout holding the Makefile and .venv"
required: false
default: repo
save:
description: "Save the cache on a miss (set true only on trusted branches)"
required: false
default: 'false'
runs:
using: composite
steps:
- name: Compute Python venv cache key
id: cachekey
shell: bash
working-directory: ${{ inputs.repo }}
run: |
source ci/ci-common.bash
host="${DISTRO_ID:-$HOST_OS}${DISTRO_VERSION:+-$DISTRO_VERSION}"
pyver="$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
reqs="$(sha256sum python-dev-requirements.txt | cut -d' ' -f1)"
venv="${PWD#/}/.venv" # absolute venv path (leading '/' trimmed)
echo "key=venv-${host}-py${pyver}-${reqs}-${venv//\//-}" >> "$GITHUB_OUTPUT"
- name: Restore Python venv
id: venv
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ inputs.repo }}/.venv
key: ${{ steps.cachekey.outputs.key }}
- name: Create Python venv
if: ${{ steps.venv.outputs.cache-hit != 'true' }}
shell: bash
working-directory: ${{ inputs.repo }}
run: make venv
- name: Save Python venv
if: ${{ inputs.save == 'true' && steps.venv.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ inputs.repo }}/.venv
key: ${{ steps.venv.outputs.cache-primary-key }}
@@ -0,0 +1,62 @@
---
# DESCRIPTION: Github actions composite action
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Update PR label
description: >-
Add or remove a label on a pull request. Does nothing unless the pull
request is still open and still at the commit the result is for, so that a
result superseded by a push does not label/unlabel the work that replaced it.
inputs:
token:
description: "Token to label with"
required: true
pr-number:
description: "Number of the pull request"
required: true
head-sha:
description: "Commit the result is for"
required: true
label:
description: "Label to set"
required: true
set:
description: "'true' to add the label, 'false' to remove it"
required: true
runs:
using: composite
steps:
- name: Set the label
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
REPO: ${{ github.repository }}
PR: ${{ inputs.pr-number }}
SHA: ${{ inputs.head-sha }}
LABEL: ${{ inputs.label }}
SET: ${{ inputs.set }}
run: |-
# The state and head of the pull request as they are now, and whether
# it carries the label already
read -r STATE HEAD LABELLED < <(gh pr view "${PR}" \
--repo "${REPO}" \
--json state,headRefOid,labels \
--jq '"\(.state) \(.headRefOid) \(any(.labels[]; .name == env.LABEL))"')
# Only act on a change, so a run does not reapply what is already set
if [ "${STATE}" != OPEN ]; then
# Only label open PRs
echo "PR #${PR} is ${STATE}"
elif [ "${HEAD}" != "${SHA}" ]; then
# Pushed to since, so this result is stale and a new run will decide
echo "PR #${PR} has moved on from ${SHA}"
elif [ "${SET}" = true ] && [ "${LABELLED}" = false ]; then
echo "Adding '${LABEL}' to PR #${PR}"
gh pr edit "${PR}" --repo "${REPO}" --add-label "${LABEL}"
elif [ "${SET}" = false ] && [ "${LABELLED}" = true ]; then
echo "Removing '${LABEL}' from PR #${PR}"
gh pr edit "${PR}" --repo "${REPO}" --remove-label "${LABEL}"
else
echo "No change to PR #${PR}"
fi
@@ -0,0 +1,74 @@
---
# DESCRIPTION: Github actions composite action
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Upload PR notification
description: >-
Upload the 'pr-notification' artifact, holding a comment for 'pages.yml' to
post on a pull request. The given directory must hold the content of the
comment in 'body.txt', and its single line summary in 'hist.txt'.
inputs:
path:
description: "Directory holding the notification contents"
required: true
key:
description: "Unique key for combining comments"
required: true
runs:
using: composite
steps:
- name: Validate
shell: bash
env:
NOTIFICATION_DIR: ${{ inputs.path }}
EVENT_NAME: ${{ github.event_name }}
run: |
# The notification is posted on the pull request of the triggering event
if [ "${EVENT_NAME}" != "pull_request" ]; then
echo "This action can only be used on a 'pull_request' run, but event is '${EVENT_NAME}'" >&2
exit 1
fi
# The content of the comment, and its single line summary
for f in body.txt hist.txt; do
if [ ! -f "${NOTIFICATION_DIR}/${f}" ]; then
echo "No '${f}' in '${NOTIFICATION_DIR}'" >&2
exit 1
fi
done
# Nothing else, so the artifact holds only what this action puts in it
EXTRA=$(find "${NOTIFICATION_DIR}" -mindepth 1 -not -name body.txt -not -name hist.txt)
if [ -n "${EXTRA}" ]; then
echo "Unexpected content in '${NOTIFICATION_DIR}':" >&2
echo "${EXTRA}" >&2
exit 1
fi
# 'ci-pages-notify.bash' stashes 'hist.txt' in an HTML comment, and later
# shows it in the history of the notifications superseding this one, so
# it must be a single line, and must neither open nor close an HTML comment
if [ $(wc -l < "${NOTIFICATION_DIR}/hist.txt") -ne 1 ]; then
echo "'hist.txt' must hold exactly one line" >&2
exit 1
fi
if grep -q -e '<!--' -e '-->' "${NOTIFICATION_DIR}/hist.txt"; then
echo "'hist.txt' must not contain '<!--' or '-->'" >&2
exit 1
fi
- name: Add metadata
shell: bash
env:
NOTIFICATION_DIR: ${{ inputs.path }}
NOTIFICATION_KEY: ${{ inputs.key }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "${NOTIFICATION_KEY}" > "${NOTIFICATION_DIR}/key.txt"
echo "${PR_NUMBER}" > "${NOTIFICATION_DIR}/pr-number.txt"
ls -lsha "${NOTIFICATION_DIR}"
- name: Upload notification
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: ${{ inputs.path }}
name: pr-notification
-286
View File
@@ -1,286 +0,0 @@
---
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: build-test
on:
push:
branches-ignore:
- 'dependabot/**' # Avoid duplicates: only run the PR, not the push
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
permissions:
contents: read
defaults:
run:
working-directory: repo
concurrency:
# At most 1 job per branch. Auto cancel on pull requests and on all forks
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'verilator/verilator' }}
jobs:
build-2404-gcc:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: linux
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-24.04, cc: gcc, asan: 0}
build-2404-clang:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: linux
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-24.04, cc: clang, asan: 1}
build-2204-gcc:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: linux
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: gcc, asan: 0}
build-2204-clang:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: linux
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: clang, asan: 0}
build-osx-gcc:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: osx
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: macos-15, cc: gcc, asan: 0}
build-osx-clang:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}${{ matrix.asan && ' | asan' || '' }}
uses: ./.github/workflows/reusable-build.yml
with:
sha: ${{ github.sha }}
os: ${{ matrix.os }}
os-name: osx
cc: ${{ matrix.cc }}
dev-asan: ${{ matrix.asan }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
- {os: macos-15, cc: clang, asan: 0}
build-windows:
name: Build | ${{ matrix.os }} | ${{ matrix.cc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: windows-2025, cc: msvc}
env:
CI_OS_NAME: win
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
steps:
- uses: actions/checkout@v6
with:
path: repo
- name: Cache $CCACHE_DIR
uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: msbuild-msvc-cmake
- name: compile
env:
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
run: ./ci/ci-win-compile.ps1
- name: test build
run: ./ci/ci-win-test.ps1
- name: Zip up repository
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
- name: Upload zip archive
uses: actions/upload-artifact@v7
with:
path: ${{ github.workspace }}/repo/verilator.zip
name: verilator-win.zip
test-2404-gcc:
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
needs: build-2404-gcc
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2404-gcc.outputs.archive }}
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
reloc: ${{ matrix.reloc }}
suite: ${{ matrix.suite }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 24.04 gcc
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: dist-vlt-0}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: dist-vlt-1}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: dist-vlt-2}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: dist-vlt-3}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-0}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-1}
- {os: ubuntu-24.04, cc: gcc, reloc: 0, suite: vltmt-2}
test-2404-clang:
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
needs: build-2404-clang
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2404-clang.outputs.archive }}
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
reloc: ${{ matrix.reloc }}
suite: ${{ matrix.suite }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 24.04 clang
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: dist-vlt-0}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: dist-vlt-1}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: dist-vlt-2}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: dist-vlt-3}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: vltmt-0}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: vltmt-1}
- {os: ubuntu-24.04, cc: clang, reloc: 0, suite: vltmt-2}
test-2204-gcc:
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
needs: build-2204-gcc
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2204-gcc.outputs.archive }}
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
reloc: ${{ matrix.reloc }}
suite: ${{ matrix.suite }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 22.04 gcc
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: dist-vlt-0}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: dist-vlt-1}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: dist-vlt-2}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: dist-vlt-3}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: vltmt-0}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: vltmt-1}
- {os: ubuntu-22.04, cc: gcc, reloc: 0, suite: vltmt-2}
test-2204-clang:
name: Test | ${{ matrix.os }} | ${{ matrix.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
needs: build-2204-clang
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2204-clang.outputs.archive }}
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
reloc: ${{ matrix.reloc }}
suite: ${{ matrix.suite }}
dev-gcov: 0
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 22.04 clang, also test relocation
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: dist-vlt-0}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: dist-vlt-1}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: dist-vlt-2}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: dist-vlt-3}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: vltmt-0}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: vltmt-1}
- {os: ubuntu-22.04, cc: clang, reloc: 1, suite: vltmt-2}
lint-py:
name: Lint Python
uses: ./.github/workflows/reusable-lint-py.yml
passed:
name: Test suite passed
if: always()
needs:
- build-2404-gcc
- build-2404-clang
- build-2204-gcc
- build-2204-clang
- build-osx-gcc
- build-osx-clang
- build-windows
- test-2404-gcc
- test-2404-clang
- test-2204-gcc
- test-2204-clang
- lint-py
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
+1 -1
View File
@@ -16,5 +16,5 @@ jobs:
name: "'docs/CONTRIBUTORS' was signed"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- run: test_regress/t/t_dist_contributors.py
+101 -67
View File
@@ -13,40 +13,88 @@ on:
permissions:
contents: read
actions: read
defaults:
run:
shell: bash
concurrency:
# At most 1 job per branch. Auto cancel all but scheduled jobs
group: ${{ github.workflow }}-${{ github.ref }}
# At most 1 job per branch. Auto cancel all but scheduled jobs.
# Of the pull request events, only one that starts a run, or that removes the
# 'pr: dev-coverage' label to cancel one, shares the group. The rest are
# skipped (a change of another label, or a payload that does not carry the
# label, like an 'opened' delivered after it was added), and a skipped run
# must not cancel the one in progress, so they are given a unique group.
# This way adding the label starts a run, removing it cancels the in-progress
# run, and anything else has no effect. Note such an event still creates a
# run of this workflow, which is skipped, and would then hide the one in
# progress on the pull request. 'pr-run-cleanup.yml' deletes those.
# Key pull request runs on the number: 'github.ref' is the base branch once
# the pull request is closed, so unlabel events would cancel base runs.
# NOTE: The last part of the group expression must be kept in sync with the
# 'start' job condition below: it maps to 'shared' exactly those events that
# satisfy that condition, plus the 'unlabeled' event of the gating label.
group: |-
${{
github.workflow
}}-${{
(github.event_name == 'pull_request')
&& format('pr-{0}', github.event.number) || github.ref
}}-${{
(github.event_name == 'pull_request'
&& (((github.event.action == 'labeled' || github.event.action == 'unlabeled')
&& github.event.label.name != 'pr: dev-coverage')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& !contains(github.event.pull_request.labels.*.name, 'pr: dev-coverage'))))
&& github.run_id || 'shared'
}}
cancel-in-progress: ${{ github.event_name != 'schedule' }}
jobs:
build:
name: Build
start:
name: Start
# Only run scheduled jobs if explicitly enabled for that repo (e.g.: not on forks)
# Only run pull request jobs if labelled as needing an coverage run
# Only run pull request jobs if labelled as needing a coverage run
# Always run workflow dispatch jobs
if: |
(github.event_name == 'schedule'
&& vars.ENABLE_SCHEDULED_JOBS == 'true') ||
(github.event_name == 'pull_request'
&& contains(github.event.pull_request.labels.*.name, 'pr: dev-coverage')) ||
&& ((github.event.action == 'labeled'
&& github.event.label.name == 'pr: dev-coverage')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& contains(github.event.pull_request.labels.*.name, 'pr: dev-coverage')))) ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-slim
steps:
- name: Save the pull request number
if: ${{ github.event_name == 'pull_request' }}
run: echo "${{ github.event.number }}" > pr-number.txt
- name: Upload the pull request number
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: pr-number
path: pr-number.txt
overwrite: true
build:
name: Build
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: gcc
dev-gcov: true
runs-on: ubuntu-26.04
# For pull requests, build the head of the pull request branch, not the
# merge commit, otherwise patch coverage would include the changes
# between the root of the pull request and the target branch
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
os: ubuntu-24.04
os-name: linux
cc: gcc
dev-asan: 0
dev-gcov: 1
test:
name: Test | ${{ matrix.test }}${{ matrix.num }}
@@ -54,11 +102,10 @@ jobs:
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build.outputs.archive }}
os: ubuntu-24.04
cc: gcc
reloc: 0
dev-gcov: true
runs-on: ubuntu-26.04
suite: ${{ matrix.test }}${{ matrix.num }}
dev-gcov: 1
strategy:
fail-fast: false
matrix:
@@ -71,13 +118,13 @@ jobs:
name: Publish results to codecov.io
needs: test
if: ${{ contains(needs.*.result, 'success') && !cancelled() }}
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Download code coverage data
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: code-coverage-*
path: obj_coverage
@@ -90,7 +137,7 @@ jobs:
find obj_coverage -type f | paste -sd, | sed "s/^/files=/" >> "$GITHUB_OUTPUT"
- name: Upload to codecov.io
uses: codecov/codecov-action@v6
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7
with:
disable_file_fixes: true
disable_search: true
@@ -104,28 +151,26 @@ jobs:
name: Prepare HTML report
needs: [build, test]
if: ${{ contains(needs.*.result, 'success') && !cancelled() }}
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
- name: Install dependencies
run: |
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
sudo dpkg-reconfigure man-db
sudo apt install lcov || \
sudo apt install lcov
- name: Download repository archive
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ${{ needs.build.outputs.archive }}
path: ${{ github.workspace }}
- name: Unpack repository archive
run: |
tar -x -z -f ${{ needs.build.outputs.archive }}
tar --zstd -x -f ${{ needs.build.outputs.archive }}
ls -lsha
- name: Install dependencies
uses: ./repo/.github/actions/install-deps
with:
stage: coverage
- name: Download code coverage data
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: code-coverage-*
path: repo/obj_coverage
@@ -136,51 +181,40 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
ls -lsha obj_coverage
# Combine reports from test jobs
nodist/fastcov.py -C obj_coverage/verilator-*.info --lcov -o obj_coverage/verilator.info
# For a PR, report patch coverage against the merge-base between the head of the PR and the target branch
ci/ci-coverage-report.bash \
${{ github.run_id }} \
"${{ github.event_name == 'pull_request' && github.event.number || '' }}" \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}"
# Create the report artifact. Note there is no report if the patch is empty.
mkdir ../report-artifact
[ ! -d obj_coverage/report ] || mv obj_coverage/report ../report-artifact/
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
COVERAGE_BASE=$(git rev-parse --short $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}))
make coverage-report COVERAGE_BASE=${COVERAGE_BASE} |& tee ${{ github.workspace }}/make-coverage-report.log
else
make coverage-report
fi
# Remove data files
rm -f obj_coverage/verilator*.info
# Some extra work for PRs only
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# Save PR number in report
echo ${{ github.event.number }} > obj_coverage/pr-number.txt
# Generate notification comment content
mkdir -p notification
echo ${{ github.event.number }} > notification/pr-number.txt
NUM=$(gh run view ${{ github.run_id }} --json number --jq ".number")
URL=$(gh run view ${{ github.run_id }} --json url --jq ".url")
echo "Patch coverage from PR workflow [#$NUM]($URL) (code coverage of lines changed relative to ${COVERAGE_BASE}):" > notification/body.txt
if [[ ! -f obj_coverage/empty-patch ]]; then
echo "<pre>" >> notification/body.txt
grep -E "(lines|branches)\.*:" ${{ github.workspace }}/make-coverage-report.log | sed "s/\.*:/:/" >> notification/body.txt || true
echo "</pre>" >> notification/body.txt
echo "Report: [${{ github.run_id }}](https://${{ github.repository_owner }}.github.io/verilator/coverage-reports/${{ github.run_id }}/index.html)" >> notification/body.txt
else
echo "Patch contains no code changes" >> notification/body.txt
fi
cat notification/body.txt
echo ${{ github.event.number }} > ../report-artifact/pr-number.txt
fi
- name: Upload report
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: repo/obj_coverage
path: report-artifact
name: coverage-report
- name: Upload notification
- name: Upload coverage status
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: repo/coverage-status.txt
name: coverage-status
overwrite: true
# Not written if the coverage could not be read, see the script above
if-no-files-found: ignore
- name: Upload PR notification
if: ${{ github.event_name == 'pull_request' }}
uses: ./repo/.github/actions/upload-pr-notification
with:
path: repo/notification
name: coverage-pr-notification
key: coverage
# Create GitHub issue for failed scheduled jobs
# This should always be the last job (we want an issue if anything breaks)
@@ -188,14 +222,14 @@ jobs:
name: Create issue on failure
needs: [publish-codecov, prepare-report]
if: ${{ github.event_name == 'schedule' && github.repository == 'verilator/verilator' && github.run_attempt == 1 && failure() && !cancelled() }}
runs-on: ubuntu-24.04
runs-on: ubuntu-slim
steps:
# Creating issues requires elevated privilege
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.VERILATOR_CI_ID }}
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
owner: verilator
repositories: verilator
+6 -6
View File
@@ -39,7 +39,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Extract context variables
run: |
@@ -54,7 +54,7 @@ jobs:
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
with:
images: |
${{ vars.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
@@ -64,21 +64,21 @@ jobs:
type=raw,value=latest,enable=${{ inputs.add_latest_tag == true }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push to Docker
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
with:
context: ${{ env.build_context }}
+56 -15
View File
@@ -11,35 +11,76 @@ on:
permissions:
contents: write
defaults:
run:
working-directory: repo
concurrency:
# At most 1 run per branch: the job pushes what 'make format' changed, so
# concurrent runs on the same branch race on that push. Cancel the run in
# progress, as the newer one formats a tree that already holds its commits.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-24.04
name: Ubuntu 24.04 | format
env:
CI_OS_NAME: linux
CI_RUNS_ON: ubuntu-24.04
CI_COMMIT: ${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v6
# On the main repository, push as the Verilator CI app.
# Forks do not have the app, so fall back to GITHUB_TOKEN there.
- name: Generate access token
id: generate-token
if: ${{ github.repository == 'verilator/verilator' }}
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
owner: verilator
repositories: verilator
permission-contents: write
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: repo
token: ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
- name: Install packages for build
uses: ./repo/.github/actions/install-deps
with:
stage: format
- name: Configure git identity
env:
CI_BUILD_STAGE_NAME: build
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_SLUG: ${{ steps.generate-token.outputs.app-slug }}
run: |
sudo apt install clang-format-18 || \
sudo apt install clang-format-18
git config --global user.email "action@example.com"
git config --global user.name "github action"
- name: Format code
if [ -n "$APP_SLUG" ]; then
user_id=$(gh api "/users/${APP_SLUG}[bot]" --jq .id)
git config --global user.email "${user_id}+${APP_SLUG}[bot]@users.noreply.github.com"
git config --global user.name "${APP_SLUG}[bot]"
else
git config --global user.email "[email protected]"
git config --global user.name "github action"
fi
- name: Configure
run: |
autoconf
./configure
make venv
- name: Set up Python venv
uses: ./repo/.github/actions/setup-venv
with:
save: ${{ github.ref == 'refs/heads/master' }}
- name: Format code
run: |
source .venv/bin/activate
make -j 2 format CLANGFORMAT=clang-format-18
make -j 4 format CLANGFORMAT=clang-format-18
git status
- name: Push
run: |-
if [ -n "$(git status --porcelain)" ]; then
+30 -16
View File
@@ -7,10 +7,10 @@ name: Pages
on:
push:
branches: [master]
paths: ["ci/**", ".github/workflows"]
paths: ["ci/**", ".github/workflows/**"]
workflow_dispatch:
workflow_run:
workflows: ["Code coverage"]
workflows: ["Code coverage", "RTLMeter"]
types: [completed]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
@@ -22,8 +22,11 @@ permissions:
# Allow only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
# want to allow these deployments to complete.
# A skipped-upstream run does no work (see the build job's if:), so put it in its
# own throwaway group: otherwise, as the newest queued run, it would cancel a
# pending real run and then deploy nothing.
concurrency:
group: "pages"
group: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'skipped') && format('pages-skip-{0}', github.run_id) || 'pages' }}
cancel-in-progress: false
defaults:
@@ -34,21 +37,23 @@ jobs:
build:
name: Build content
runs-on: ubuntu-24.04
# A skipped upstream run (e.g. Code coverage / RTLMeter on a branch push)
# still fires workflow_run; don't rebuild and redeploy for it. deploy and
# notify need this job, so they cascade-skip too.
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion != 'skipped' }}
outputs:
coverage-pr-run-ids: ${{ steps.build.outputs.coverage-pr-run-ids }}
pr-run-ids: ${{ steps.build.outputs.pr-run-ids }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Build pages
id: build
env:
GH_TOKEN: ${{ github.token }}
run: |
bash -x ./ci/ci-pages.bash
ls -lsha
tree -L 3 pages
./ci/ci-pages.bash
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: pages
@@ -58,10 +63,17 @@ jobs:
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
url: ${{ steps.deploy-2.outputs.page_url || steps.deploy-1.outputs.page_url }}
steps:
# GitHub's Pages backend intermittently fails a deployment mid-sync, retry
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v5
id: deploy-1
continue-on-error: true
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5
- name: Deploy to GitHub Pages (retry)
id: deploy-2
if: steps.deploy-1.outcome == 'failure'
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5
notify:
name: Notify
@@ -70,18 +82,20 @@ jobs:
if: ${{ github.repository == 'verilator/verilator' }}
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
# Use the Verilator CI app to post the comment
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.VERILATOR_CI_ID }}
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-actions: write
permission-pull-requests: write
- name: Comment on PR
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
COVERAGE_PR_RUN_IDS: ${{ needs.build.outputs.coverage-pr-run-ids }}
run: bash -x ./ci/ci-pages-notify.bash
# Slug of the app the above token belongs to, see 'ci-pages-notify.bash'
GH_AUTHOR: ${{ steps.generate-token.outputs.app-slug }}
PR_RUN_IDS: ${{ needs.build.outputs.pr-run-ids }}
run: ./ci/ci-pages-notify.bash
+281
View File
@@ -0,0 +1,281 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# Drives the automation of a pull request.
name: Maintenance - PR automation
on:
pull_request_target: # 'pull_request' can have no write permissions
types: [opened, synchronize, reopened, closed]
workflow_run: # To react to the result of a workflow on a pull request
workflows: ["Code coverage", "RTLMeter", "Regression"]
types: [completed]
push: # A pull request can start conflicting when its base branch moves
branches: [master]
permissions:
contents: read # To check out the local action, everything else uses the CI app token
defaults:
run:
shell: bash
# One job per event source, to avoid startup churn. Use separate gated steps for actions
jobs:
pr-event:
name: PR event
if: |
github.repository == 'verilator/verilator'
&& github.event_name == 'pull_request_target'
runs-on: ubuntu-slim
steps:
# Label as the CI app, and not with 'github.token', as events from the
# latter do not create workflow runs, so the labels would drive nothing
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-pull-requests: write
- name: "Add 'pr: regression' label on open"
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
run: |-
gh pr edit "${{ github.event.number }}" \
--repo "${{ github.repository }}" \
--add-label 'pr: regression'
- name: "Optionally add 'pr: dev-coverage' label on open"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# Grab changed files
FILES=$(gh api --paginate \
"repos/${{ github.repository }}/pulls/${{ github.event.number }}/files" \
--jq '.[].filename')
echo "Files changed:"
echo "${FILES}"
# Add label if src or include chagned
if grep -q -E '^(src|include)/' <<< "${FILES}"; then
gh pr edit "${{ github.event.number }}" \
--repo "${{ github.repository }}" \
--add-label 'pr: dev-coverage'
fi
- name: "Remove all 'pr*' labels on close"
if: ${{ github.event.action == 'closed' }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# Filter in 'jq', so an empty result is not an error, as it is with 'grep'
LABELS=$(gh api \
"repos/${{ github.repository }}/issues/${{ github.event.number }}/labels?per_page=100" \
--jq '[.[].name | select(startswith("pr"))] | join(",")')
if [ -n "${LABELS}" ]; then
echo "Removing labels: ${LABELS}"
gh pr edit "${{ github.event.number }}" \
--repo "${{ github.repository }}" \
--remove-label "${LABELS}"
fi
conflicting:
name: Conflict check
# A pull request can start conflicting when its own head moves, or when the
# base branch moves under it, so sweep the open pull requests on both.
if: |
github.repository == 'verilator/verilator'
&& (github.event_name == 'push'
|| (github.event_name == 'pull_request_target'
&& github.event.action == 'synchronize'))
runs-on: ubuntu-slim
steps:
# Label as the CI app, and not with 'github.token', as events from the
# latter do not create workflow runs, so the labels would drive nothing
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-pull-requests: write
- name: "Update the 'pr-blocked: needs-rebase' label"
uses: eps1lon/actions-label-merge-conflict@0273be72a0bbd58fcd71d0d6c02c209b50d1e5e1 # 3.1.0
with:
dirtyLabel: "pr-blocked: needs-rebase"
repoToken: ${{ steps.generate-token.outputs.token }}
regression-complete:
name: Regression complete
if: |
github.repository == 'verilator/verilator'
&& github.event_name == 'workflow_run'
&& github.event.workflow_run.name == 'Regression'
&& github.event.workflow_run.event == 'pull_request'
&& (github.event.workflow_run.conclusion == 'success'
|| github.event.workflow_run.conclusion == 'failure')
runs-on: ubuntu-slim
steps:
# Label as the CI app, and not with 'github.token', as events from the
# latter do not create workflow runs, so the labels would drive nothing
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-actions: read
permission-pull-requests: write
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
sparse-checkout: .github/actions/update-pr-label
- name: Get the pull request number
id: pr
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# The run tells us which pull request it was for
if ! gh run download "${{ github.event.workflow_run.id }}" --name pr-number; then
echo "Run has no 'pr-number' artifact"
exit 0
fi
echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
- name: "Update the 'pr-blocked: fix-regression' label"
if: ${{ steps.pr.outputs.number }}
uses: ./.github/actions/update-pr-label
with:
token: ${{ steps.generate-token.outputs.token }}
pr-number: ${{ steps.pr.outputs.number }}
head-sha: ${{ github.event.workflow_run.head_sha }}
label: "pr-blocked: fix-regression"
set: ${{ github.event.workflow_run.conclusion == 'failure' }}
rtlmeter-complete:
name: RTLMeter complete
if: |
github.repository == 'verilator/verilator'
&& github.event_name == 'workflow_run'
&& github.event.workflow_run.name == 'RTLMeter'
&& github.event.workflow_run.event == 'pull_request'
&& (github.event.workflow_run.conclusion == 'success'
|| github.event.workflow_run.conclusion == 'failure')
runs-on: ubuntu-slim
steps:
# Label as the CI app, and not with 'github.token', as events from the
# latter do not create workflow runs, so the labels would drive nothing
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-actions: read
permission-pull-requests: write
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
sparse-checkout: .github/actions/update-pr-label
- name: Get the pull request number
id: pr
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# The run tells us which pull request it was for
if ! gh run download "${{ github.event.workflow_run.id }}" --name pr-number; then
echo "Run has no 'pr-number' artifact"
exit 0
fi
echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
- name: "Update the 'pr-blocked: fix-rtlmeter' label"
if: ${{ steps.pr.outputs.number }}
uses: ./.github/actions/update-pr-label
with:
token: ${{ steps.generate-token.outputs.token }}
pr-number: ${{ steps.pr.outputs.number }}
head-sha: ${{ github.event.workflow_run.head_sha }}
label: "pr-blocked: fix-rtlmeter"
set: ${{ github.event.workflow_run.conclusion == 'failure' }}
coverage-complete:
name: Coverage complete
if: |
github.repository == 'verilator/verilator'
&& github.event_name == 'workflow_run'
&& github.event.workflow_run.name == 'Code coverage'
&& github.event.workflow_run.event == 'pull_request'
&& (github.event.workflow_run.conclusion == 'success'
|| github.event.workflow_run.conclusion == 'failure')
runs-on: ubuntu-slim
steps:
# Label as the CI app, and not with 'github.token', as events from the
# latter do not create workflow runs, so the labels would drive nothing
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-actions: read
permission-pull-requests: write
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
sparse-checkout: .github/actions/update-pr-label
- name: Get the pull request number
id: pr
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# The run tells us which pull request it was for
if ! gh run download "${{ github.event.workflow_run.id }}" --name pr-number; then
echo "Run has no 'pr-number' artifact"
exit 0
fi
echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
- name: "Update the 'pr-blocked: fix-dev-coverage' label"
if: ${{ steps.pr.outputs.number }}
uses: ./.github/actions/update-pr-label
with:
token: ${{ steps.generate-token.outputs.token }}
pr-number: ${{ steps.pr.outputs.number }}
head-sha: ${{ github.event.workflow_run.head_sha }}
label: "pr-blocked: fix-dev-coverage"
set: ${{ github.event.workflow_run.conclusion == 'failure' }}
- name: Get the line coverage
id: coverage
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
# Whether every line the patch touches is covered
if ! gh run download "${{ github.event.workflow_run.id }}" --name coverage-status; then
echo "Run has no 'coverage-status' artifact"
exit 0
fi
echo "covered=$(cat coverage-status.txt)" >> "$GITHUB_OUTPUT"
- name: "Update the 'pr-blocked: improve-coverage' label"
if: ${{ steps.pr.outputs.number && steps.coverage.outputs.covered }}
uses: ./.github/actions/update-pr-label
with:
token: ${{ steps.generate-token.outputs.token }}
pr-number: ${{ steps.pr.outputs.number }}
head-sha: ${{ github.event.workflow_run.head_sha }}
label: "pr-blocked: improve-coverage"
set: ${{ steps.coverage.outputs.covered != 'true' }}
+52
View File
@@ -0,0 +1,52 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# Fails while a pull request carries a 'pr-blocked:*' label, so that it can be
# used as a required status check to hold up the merge. The labels themselves
# are set by hand, or by 'pr-automation.yml'.
#
# Note this runs from the pull request's own merge commit, so a pull request
# can change the check itself, but any such change shows up in its review.
#
# It also runs on a push, and not only on a label change, as a check run is
# reported against the head commit, and so every head needs one of its own.
name: Maintenance - PR blocked
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
pull-requests: read
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
not-blocked:
name: Not blocked
runs-on: ubuntu-slim
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: "Check for 'pr-blocked:*' labels"
run: |-
# Note these are the labels the pull request has now, and not the ones
# in 'github.event', which is a snapshot that can be stale when
# several are changed in one go
BLOCKED=$(gh pr view "${{ github.event.number }}" \
--repo "${{ github.repository }}" \
--json labels \
--jq '[.labels[].name | select(startswith("pr-blocked:"))] | join(", ")')
if [ -n "${BLOCKED}" ]; then
echo "::error::${BLOCKED}"
exit 1
fi
echo "Not blocked"
+42
View File
@@ -0,0 +1,42 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# Deletes the skipped runs of the label gated workflows on pull requests.
#
# GitHub shows only the latest run of a workflow on a pull request, so a run
# that was skipped hides an earlier run that is actually still in progress, and
# the pull request then reads as though that workflow had finished and
# everything is green. Every label change creates a run of every workflow that
# triggers on label events, and label events cannot be filtered by label name
# under 'on', so these runs cannot be prevented. Deleting them restores the
# in-progress run in the UI.
name: Maintenance - PR run cleanup
on:
workflow_run:
workflows: ["Code coverage", "Regression", "RTLMeter"]
types: [completed]
permissions:
actions: write
defaults:
run:
shell: bash
jobs:
delete-skipped-run:
name: Delete skipped run
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'skipped'
runs-on: ubuntu-slim
steps:
- name: Delete run
env:
GH_TOKEN: ${{ github.token }}
run: |-
echo "Deleting skipped '${{ github.event.workflow_run.name }}' run #${{ github.event.workflow_run.run_number }}"
gh api --method DELETE "repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}"
+265
View File
@@ -0,0 +1,265 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: Regression
on:
push:
branches-ignore:
- 'dependabot/**' # Avoid duplicates: only run the PR, not the push
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
permissions:
contents: read
actions: read
defaults:
run:
working-directory: repo
concurrency:
# At most 1 job per branch. Auto cancel on pull requests and on all forks.
# Of the pull request events, only one that starts a run, or that removes the
# 'pr: regression' label to cancel one, shares the group. The rest are
# skipped (a change of another label, or a payload that does not carry the
# label, like an 'opened' delivered after it was added), and a skipped run
# must not cancel the one in progress, so they are given a unique group.
# This way adding the label starts a run, removing it cancels the in-progress
# run, and anything else has no effect. Note such an event still creates a
# run of this workflow, which is skipped, and would then hide the one in
# progress on the pull request. 'pr-run-cleanup.yml' deletes those.
# Key pull request runs on the number: 'github.ref' is the base branch once
# the pull request is closed, so unlabel events would cancel base runs.
# NOTE: The last part of the group expression must be kept in sync with the
# 'start' job condition below: it maps to 'shared' exactly those events that
# satisfy that condition, plus the 'unlabeled' event of the gating label.
group: |-
${{
github.workflow
}}-${{
(github.event_name == 'pull_request')
&& format('pr-{0}', github.event.number) || github.ref
}}-${{
(github.event_name == 'pull_request'
&& (((github.event.action == 'labeled' || github.event.action == 'unlabeled')
&& github.event.label.name != 'pr: regression')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& !contains(github.event.pull_request.labels.*.name, 'pr: regression'))))
&& github.run_id || 'shared'
}}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'verilator/verilator' }}
jobs:
start:
name: Start
# Only run pull request jobs if labelled as needing a regression run.
# Always run push, workflow dispatch and scheduled jobs
if: |
(github.event_name == 'pull_request'
&& ((github.event.action == 'labeled'
&& github.event.label.name == 'pr: regression')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& contains(github.event.pull_request.labels.*.name, 'pr: regression')))) ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'schedule')
runs-on: ubuntu-slim
defaults:
run:
working-directory: . # The workflow default is not checked out here
steps:
- name: Enabled
run: echo "Regression is enabled for this run"
- name: Save the pull request number
if: ${{ github.event_name == 'pull_request' }}
run: echo "${{ github.event.number }}" > pr-number.txt
- name: Upload the pull request number
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: pr-number
path: pr-number.txt
overwrite: true
build-2604-gcc:
name: Build | 26.04 | gcc
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: gcc
runs-on: ubuntu-26.04
sha: ${{ github.sha }}
build-2604-clang:
name: Build | 26.04 | clang
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: clang
dev-asan: true # Build (and run) with address sanitizer
runs-on: ubuntu-26.04
sha: ${{ github.sha }}
build-2404-gcc:
name: Build | 24.04 | gcc
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: gcc
runs-on: ubuntu-24.04
sha: ${{ github.sha }}
build-2404-clang:
name: Build | 24.04 | clang
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: clang
runs-on: ubuntu-24.04
sha: ${{ github.sha }}
build-2204-gcc:
name: Build | 22.04 | gcc
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: gcc
runs-on: ubuntu-22.04
sha: ${{ github.sha }}
build-macos-26-clang:
name: Build | macos-26 | clang
needs: start
uses: ./.github/workflows/reusable-build.yml
with:
cc: clang
runs-on: macos-26
sha: ${{ github.sha }}
build-windows:
name: Build | windows-2025-vs2026 | msvc
needs: start
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: repo
- name: Cache win_flex_bison
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ github.workspace }}/win_flex_bison
key: win_flex_bison
- name: compile
run: ./ci/ci-win-compile.ps1
- name: test build
run: ./ci/ci-win-test.ps1
test-2604-gcc:
name: Test | 26.04 | gcc | ${{ matrix.suite }}
needs: build-2604-gcc
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2604-gcc.outputs.archive }}
cc: gcc
runs-on: ubuntu-26.04
suite: ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1, vltmt-2]
test-2604-clang:
name: Test | 26.04 | clang | ${{ matrix.suite }}
needs: build-2604-clang
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2604-clang.outputs.archive }}
cc: clang
runs-on: ubuntu-26.04
suite: ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1, vltmt-2]
test-2404-gcc:
name: Test | 24.04 | gcc | ${{ matrix.suite }}
needs: build-2404-gcc
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2404-gcc.outputs.archive }}
cc: gcc
runs-on: ubuntu-24.04
suite: ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1, vltmt-2]
test-2404-clang:
name: Test | 24.04 | clang | ${{ matrix.suite }}
needs: build-2404-clang
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2404-clang.outputs.archive }}
cc: clang
reloc: true # Test with relocated installation
runs-on: ubuntu-24.04
suite: ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1, vltmt-2]
test-2204-gcc:
name: Test | 22.04 | gcc | ${{ matrix.suite }}
needs: build-2204-gcc
uses: ./.github/workflows/reusable-test.yml
with:
archive: ${{ needs.build-2204-gcc.outputs.archive }}
cc: gcc
runs-on: ubuntu-22.04
suite: ${{ matrix.suite }}
strategy:
fail-fast: false
matrix:
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1, vltmt-2]
lint-py:
name: Lint Python
needs: start
uses: ./.github/workflows/reusable-lint-py.yml
passed:
name: Regression tests passed # This job is used as a required status check on PRs
if: ${{ !cancelled() && needs.start.result != 'skipped' }}
needs:
- start
- build-2604-gcc
- build-2604-clang
- build-2404-gcc
- build-2404-clang
- build-2204-gcc
- build-macos-26-clang
- build-windows
- test-2604-gcc
- test-2604-clang
- test-2404-gcc
- test-2404-clang
- test-2204-gcc
- lint-py
runs-on: ubuntu-slim
steps:
- name: Check all needed jobs succeeded
working-directory: .
run: jq -e 'all(.result == "success")' <<< '${{ toJSON(needs) }}'
+75 -42
View File
@@ -7,37 +7,47 @@ name: reusable-build
on:
workflow_call:
inputs:
cc:
description: "Compiler to use: 'gcc' or 'clang'"
required: true
type: string
ccwarn:
description: "Build Verilator with warnings treated as errors (--enable-ccwarn)"
required: false
default: true
type: boolean
dev-asan:
description: "Build Verilator with the address sanitizer (--enable-dev-asan)"
required: false
default: false
type: boolean
dev-gcov:
description: "Build Verilator with gcov instrumentation (--enable-dev-gcov)"
required: false
default: false
type: boolean
install:
description: "Archive the Verilator installation, not the repo tree"
required: false
default: false
type: boolean
runs-on:
description: "Runner to build on, e.g. ubuntu-24.04"
required: true
type: string
sha:
description: "Commit SHA to build"
required: true
type: string
os: # e.g. ubuntu-24.04
required: true
type: string
cc: # 'clang' or 'gcc'
required: true
type: string
os-name: # 'linux' or 'osx'
required: true
type: string
dev-asan:
required: true
type: number
dev-gcov:
required: true
type: number
outputs:
archive:
description: "Name of the built repository archive artifact"
description: "Name of the built archive artifact"
value: ${{ jobs.build.outputs.archive }}
env:
CI_OS_NAME: ${{ inputs.os-name }}
CCACHE_COMPRESS: 1
CACHE_BASE_KEY: build-${{ inputs.runs-on }}-${{ inputs.cc }}${{ inputs.ccwarn && '-ccwarn' || '' }}${{ inputs.dev-asan && '-asan' || '' }}${{ inputs.dev-gcov && '-gcov' || '' }}
CCACHE_COMPILERCHECK: content
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
INSTALL_DIR: ${{ github.workspace }}/install
RELOC_DIR: ${{ github.workspace }}/relloc
defaults:
run:
@@ -48,52 +58,75 @@ jobs:
build:
name: Build
runs-on: ${{ inputs.os }}
runs-on: ${{ inputs.runs-on }}
outputs:
archive: ${{ steps.create-archive.outputs.archive }}
env:
CI_BUILD_STAGE_NAME: build
CI_DEV_ASAN: ${{ inputs.dev-asan }}
CI_DEV_GCOV: ${{ inputs.dev-gcov }}
CI_RUNS_ON: ${{ inputs.os }}
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
CACHE_BASE_KEY: build-${{ inputs.os }}-${{ inputs.cc }}
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total)
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: repo
ref: ${{ inputs.sha }}
fetch-depth: ${{ inputs.dev-gcov && '0' || '1' }} # Coverage flow needs full history
# Coverage needs full history; install needs it for the 'git describe'
# behind 'verilator --version'
fetch-depth: ${{ (inputs.install || inputs.dev-gcov) && '0' || '1' }}
- name: Configure ccache
run: |
# ccache is unreliable on macOS, and does nothing with 'gcc --coverage'
if [ "${{ startsWith(inputs.runs-on, 'macos') }}" = true ] || [ "${{ inputs.dev-gcov }}" = true ]; then
echo "CCACHE_DISABLE=1" >> "$GITHUB_ENV"
fi
- name: Cache $CCACHE_DIR
uses: actions/cache@v5
if: ${{ env.CCACHE_DISABLE != '1' }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ inputs.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
${{ env.CACHE_KEY }}
- name: Install packages for build
run: ./ci/ci-install.bash
uses: ./repo/.github/actions/install-deps
with:
stage: build
- name: Build
run: ./ci/ci-script.bash
run: |
./ci/ci-build.bash \
--prefix ${{ github.workspace }}/install \
--compiler ${{ inputs.cc }} \
--light-debug \
${{ inputs.ccwarn && '--ccwarn' || '' }} \
${{ inputs.dev-asan && '--asan' || '' }} \
${{ inputs.dev-gcov && '--gcov' || '' }}
- name: Create repository archive
- name: Install
if: ${{ inputs.install }}
run: make install
- name: Create archive
id: create-archive
working-directory: ${{ github.workspace }}
run: |
# Name of the archive must be unique based on the build parameters
ARCHIVE=verilator-${{ inputs.sha }}-${{ inputs.os }}-${{ inputs.cc }}-${{ inputs.dev-asan }}-${{ inputs.dev-gcov }}.tar.gz
tar --posix -c -z -f $ARCHIVE repo
# Archive name, unique per build; flavour tags mark non-default builds
ARCHIVE="verilator-${{ inputs.sha }}-${{ inputs.runs-on }}-${{ inputs.cc }}"
ARCHIVE="$ARCHIVE${{ inputs.ccwarn && '-ccwarn' || '' }}"
ARCHIVE="$ARCHIVE${{ inputs.dev-asan && '-asan' || '' }}"
ARCHIVE="$ARCHIVE${{ inputs.dev-gcov && '-gcov' || '' }}"
ARCHIVE="$ARCHIVE.tar.zst"
# zstd compresses faster than gzip and decompresses far faster in the many downstream jobs
ZSTD_NBTHREADS=0 tar --posix --zstd -c -f "$ARCHIVE" ${{ inputs.install && 'install' || 'repo' }}
echo "archive=$ARCHIVE" >> "$GITHUB_OUTPUT"
- name: Upload repository archive
uses: actions/upload-artifact@v7
- name: Upload archive
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: ${{ github.workspace }}/${{ steps.create-archive.outputs.archive }}
name: ${{ steps.create-archive.outputs.archive }}
overwrite: true
# Archive is already zstd-compressed; skip upload-artifact's zip pass
compression-level: 0
+10 -16
View File
@@ -7,14 +7,6 @@ name: reusable-lint-py
on:
workflow_call:
env:
CI_OS_NAME: linux
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ubuntu-22.04
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
defaults:
run:
shell: bash
@@ -27,23 +19,25 @@ jobs:
name: Sub-lint | Python
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: repo
- name: Install packages for build
run: ./ci/ci-install.bash
- name: Install dependencies
uses: ./repo/.github/actions/install-deps
with:
stage: lint-py
- name: Configure
run: |
autoconf
./configure --enable-longtests --enable-ccwarn
- name: Install python dependencies
run: |
sudo apt install python3-clang || \
sudo apt install python3-clang
make venv
- name: Set up Python venv
uses: ./repo/.github/actions/setup-venv
with:
# Check the event too: 'github.ref' is the base branch on a closed pull request
save: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
- name: Lint
run: |-
@@ -1,77 +0,0 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: reusable-rtlmeter-build
on:
workflow_call:
inputs:
runs-on:
description: "Runner to use, e.g.: ubuntu-24.04"
type: string
required: true
cc:
description: "Compiler to use: 'gcc' or 'clang'"
type: string
required: true
defaults:
run:
shell: bash
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 512M
jobs:
build:
runs-on: ${{ inputs.runs-on }}
name: Build
steps:
- name: Install dependencies
run: |
echo "path-exclude /usr/share/doc/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/info/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
sudo apt update || \
sudo apt update
sudo apt install ccache mold help2man libfl-dev libjemalloc-dev libsystemc-dev || \
sudo apt install ccache mold help2man libfl-dev libjemalloc-dev libsystemc-dev
- name: Use saved ccache
uses: actions/cache@v5
with:
path: ccache
key: rtlmeter-build-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: rtlmeter-build-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}
- name: Checkout
uses: actions/checkout@v6
with:
path: repo
fetch-depth: 0 # Required for 'git describe' used for 'verilator --version'
- name: Configure
working-directory: repo
run: |
autoconf
./configure --prefix=${{ github.workspace }}/install CXX=${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
- name: Make
working-directory: repo
run: make -j $(nproc)
- name: Install
working-directory: repo
run: make install
- name: Tar up installation
run: tar --posix -c -z -f verilator-rtlmeter.tar.gz install
- name: Upload Verilator installation archive
uses: actions/upload-artifact@v7
with:
path: verilator-rtlmeter.tar.gz
name: verilator-rtlmeter-${{ inputs.runs-on }}-${{ inputs.cc }}
overwrite: true
+106 -35
View File
@@ -19,6 +19,15 @@ on:
description: "Compiler to use: 'gcc' or 'clang'"
type: string
required: true
verilator-archive-new:
description: "Name of the installation archive artifact from reusable-build, new version"
type: string
required: true
verilator-archive-old:
description: "Name of the installation archive artifact from reusable-build, old version"
type: string
required: false
default: ""
# Note: The combination of 'cases' and 'run-name' must be unique for all
# invocations of this workflow within a run of the parent workflow.
# These two are used together to generate a unique results file name.
@@ -44,8 +53,8 @@ defaults:
shell: bash
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 512M
# RTLMeter measures compile/execute times, so caching must stay off to keep
# timings representative; ccache is still on PATH but acts as a pass-through
CCACHE_DISABLE: 1
jobs:
@@ -53,36 +62,21 @@ jobs:
runs-on: ${{ inputs.runs-on }}
name: Run
steps:
- name: Checkout Verilator CI scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
path: repo
sparse-checkout: |
.github/actions
ci
- name: Install dependencies
run: |
echo "path-exclude /usr/share/doc/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/info/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
sudo apt update || \
sudo apt update
sudo apt install ccache mold libfl-dev libjemalloc-dev libsystemc-dev || \
sudo apt install ccache mold libfl-dev libjemalloc-dev libsystemc-dev
- name: Download Verilator installation archive
uses: actions/download-artifact@v8
uses: ./repo/.github/actions/install-deps
with:
name: verilator-rtlmeter-${{ inputs.runs-on }}-${{ inputs.cc }}
- name: Unpack Verilator installation archive
run: |
tar -x -z -f verilator-rtlmeter.tar.gz
echo "${{ github.workspace }}/install/bin" >> $GITHUB_PATH
- name: Use saved ccache
if: ${{ env.CCACHE_DISABLE == 0 }}
uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: rtlmeter-run-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ inputs.cases }}-${{ inputs.compileArgs }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: rtlmeter-run-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ inputs.cases }}-${{ inputs.compileArgs }}
stage: rtlmeter-run
- name: Checkout RTLMeter
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: "verilator/rtlmeter"
path: rtlmeter
@@ -91,40 +85,117 @@ jobs:
working-directory: rtlmeter
run: make venv
- name: Compile cases
########################################################################
# Run with new Verilator
########################################################################
- name: Download Verilator installation archive - new
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ${{ inputs.verilator-archive-new }}
- name: Unpack Verilator installation archive - new
run: |
tar --zstd -x -f ${{ inputs.verilator-archive-new }}
mv install verilator-new
- name: Compile cases - new
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-new/bin:$PATH"
./rtlmeter run --timeout 60 --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}' --nExecute=0
ccache -svv
- name: Execute cases
- name: Execute cases - new
working-directory: rtlmeter
continue-on-error: true # Do not fail on error, so we can at least save the successful results
run: |
export PATH="${{ github.workspace }}/verilator-new/bin:$PATH"
./rtlmeter run --timeout 60 --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}'
- name: Collate results
- name: Collate results - new
id: results
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-new/bin:$PATH"
# Use 'inputs.cases' and 'inputs.run-name' to generate a unique file name
hash=$(md5sum <<< '${{ inputs.cases }} ${{ inputs.run-name }}' | awk '{print $1}')
echo "hash=${hash}" >> $GITHUB_OUTPUT
./rtlmeter collate --runName "${{ inputs.run-name }}" > ../results-${hash}.json
- name: Report results
- name: Report results - new
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-new/bin:$PATH"
./rtlmeter report --steps '*' --metrics '*' ../results-${{ steps.results.outputs.hash }}.json
- name: Upload results
uses: actions/upload-artifact@v7
- name: Upload results - new
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: results-${{ steps.results.outputs.hash }}.json
name: rtlmeter-${{ inputs.tag }}-results-${{ steps.results.outputs.hash }}
overwrite: true
retention-days: 2
- name: Report status
- name: Report status - new
working-directory: rtlmeter
run: |- # This will fail the job if any of the runs failed
export PATH="${{ github.workspace }}/verilator-new/bin:$PATH"
./rtlmeter run --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}'
# Clean up for run with old version
rm -rf work
rm -rf ${{ github.workspace }}/verilator-new
########################################################################
# Run with old Verilator **on same machine for consistency**
########################################################################
- name: Download Verilator installation archive - old
if: ${{ inputs.verilator-archive-old != '' }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ${{ inputs.verilator-archive-old }}
- name: Unpack Verilator installation archive - old
if: ${{ inputs.verilator-archive-old != '' }}
run: |
tar --zstd -x -f ${{ inputs.verilator-archive-old }}
mv install verilator-old
- name: Compile cases - old
if: ${{ inputs.verilator-archive-old != '' }}
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-old/bin:$PATH"
./rtlmeter run --timeout 60 --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}' --nExecute=0
ccache -svv
- name: Execute cases - old
if: ${{ inputs.verilator-archive-old != '' }}
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-old/bin:$PATH"
./rtlmeter run --timeout 60 --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}'
- name: Collate results - old
if: ${{ inputs.verilator-archive-old != '' }}
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-old/bin:$PATH"
./rtlmeter collate --runName "${{ inputs.run-name }}" > ../reference-${{ steps.results.outputs.hash }}.json
- name: Report results - old
if: ${{ inputs.verilator-archive-old != '' }}
working-directory: rtlmeter
run: |
export PATH="${{ github.workspace }}/verilator-old/bin:$PATH"
./rtlmeter report --steps '*' --metrics '*' ../reference-${{ steps.results.outputs.hash }}.json
- name: Upload results - old
if: ${{ inputs.verilator-archive-old != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: reference-${{ steps.results.outputs.hash }}.json
name: rtlmeter-${{ inputs.tag }}-reference-${{ steps.results.outputs.hash }}
overwrite: true
retention-days: 2
+64 -40
View File
@@ -11,29 +11,37 @@ on:
description: "Name of the repository archive artifact from reusable-build"
required: true
type: string
os: # e.g. ubuntu-24.04
required: true
type: string
cc: # gcc or clang
required: true
type: string
reloc: # 0 or 1
required: true
type: number
suite: # e.g. dist-vlt-0
cc:
description: "Compiler to use: 'gcc' or 'clang'"
required: true
type: string
dev-gcov:
description: "Collect gcov coverage data from the test run"
required: false
default: false
type: boolean
reloc:
description: "Relocate the installation before testing"
required: false
default: false
type: boolean
runs-on:
description: "Runner to test on, e.g. ubuntu-24.04"
required: true
type: number
type: string
suite:
description: "Test suite to run, e.g. dist-vlt-0"
required: true
type: string
permissions:
contents: read
actions: read
env:
CI_OS_NAME: linux
CCACHE_COMPRESS: 1
CCACHE_COMPILERCHECK: content
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
INSTALL_DIR: ${{ github.workspace }}/install
RELOC_DIR: ${{ github.workspace }}/relloc
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
defaults:
run:
@@ -43,19 +51,12 @@ defaults:
jobs:
test:
runs-on: ${{ inputs.os }}
runs-on: ${{ inputs.runs-on }}
name: Test
env:
CI_BUILD_STAGE_NAME: test
CI_RUNS_ON: ${{ inputs.os }}
CI_RELOC: ${{inputs.reloc }}
CXX: ${{ inputs.cc == 'clang' && 'clang++' || 'g++' }}
CACHE_BASE_KEY: test-${{ inputs.os }}-${{ inputs.cc }}-${{inputs.reloc }}-${{ inputs.suite }}
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total)
steps:
- name: Download repository archive
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ${{ inputs.archive }}
path: ${{ github.workspace }}
@@ -63,32 +64,45 @@ jobs:
- name: Unpack repository archive
working-directory: ${{ github.workspace }}
run: |
tar -x -z -f ${{ inputs.archive }}
tar --zstd -x -f ${{ inputs.archive }}
ls -lsha
- name: Cache $CCACHE_DIR
uses: actions/cache@v5
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache2
- name: Configure ccache
run: |
# ccache is unreliable on macOS, and does nothing with 'gcc --coverage'
if [ "${{ startsWith(inputs.runs-on, 'macos') }}" = true ] || [ "${{ inputs.dev-gcov }}" = true ]; then
echo "CCACHE_DISABLE=1" >> "$GITHUB_ENV"
fi
# Test-job ccache is stored as an artifact, not actions/cache
- name: Restore ccache
id: ccache
if: ${{ env.CCACHE_DISABLE != '1' }}
uses: ./repo/.github/actions/artifact-cache
with:
mode: restore
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
key: ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ inputs.suite }}
- name: Install test dependencies
run: |
./ci/ci-install.bash
make venv
uses: ./repo/.github/actions/install-deps
with:
stage: test
- name: Set up Python venv
uses: ./repo/.github/actions/setup-venv
with:
# Check the event too: 'github.ref' is the base branch on a closed pull request
save: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
- name: Test
id: run-test
continue-on-error: true
env:
TESTS: ${{ inputs.suite }}
run: |
source .venv/bin/activate
./ci/ci-script.bash
./ci/ci-test.bash \
--suite ${{ inputs.suite }} \
${{ inputs.reloc && format('--reloc {0}/reloc', github.workspace) || '' }}
- name: Combine code coverage data
if: ${{ inputs.dev-gcov }}
@@ -99,11 +113,21 @@ jobs:
- name: Upload code coverage data
if: ${{ inputs.dev-gcov }}
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: ${{ github.workspace }}/repo/obj_coverage/verilator-${{ inputs.suite }}.info
name: code-coverage-${{ inputs.suite }}
- name: Save ccache
if: ${{ env.CCACHE_DISABLE != '1' && !cancelled() }}
uses: ./repo/.github/actions/artifact-cache
with:
mode: save
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache.outputs.key }}
# Keep master's cache around longer; PR/branch caches churn faster
retention-days: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && 7 || 3 }}
- name: Fail job if a test failed
if: ${{ steps.run-test.outcome == 'failure' && !cancelled() }}
run: |-
-48
View File
@@ -1,48 +0,0 @@
---
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
name: RTLMeter PR results
on:
workflow_run:
workflows: [RTLMeter]
types: [completed]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
pull-requests: write
steps:
- name: Download report
uses: actions/download-artifact@v8
with:
name: rtlmeter-pr-results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download PR number
uses: actions/download-artifact@v8
with:
name: pr-number
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Use the Verilator CI app to post the comment
- name: Generate access token
id: generate-token
uses: actions/[email protected]
with:
app-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
permission-pull-requests: write
- name: Comment on PR
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |-
ls -la
cat report.txt
gh pr --repo ${{ github.repository }} comment $(cat pr-number.txt) --body-file report.txt
+255 -209
View File
@@ -22,8 +22,36 @@ defaults:
shell: bash
concurrency:
# At most 1 job per branch. Auto cancel all but scheduled jobs
group: ${{ github.workflow }}-${{ github.ref }}
# At most 1 job per branch. Auto cancel all but scheduled jobs.
# Of the pull request events, only one that starts a run, or that removes the
# 'pr: rtlmeter' label to cancel one, shares the group. The rest are
# skipped (a change of another label, or a payload that does not carry the
# label, like an 'opened' delivered after it was added), and a skipped run
# must not cancel the one in progress, so they are given a unique group.
# This way adding the label starts a run, removing it cancels the in-progress
# run, and anything else has no effect. Note such an event still creates a
# run of this workflow, which is skipped, and would then hide the one in
# progress on the pull request. 'pr-run-cleanup.yml' deletes those.
# Key pull request runs on the number: 'github.ref' is the base branch once
# the pull request is closed, so unlabel events would cancel base runs.
# NOTE: The last part of the group expression must be kept in sync with the
# 'start' job condition below: it maps to 'shared' exactly those events that
# satisfy that condition, plus the 'unlabeled' event of the gating label.
group: |-
${{
github.workflow
}}-${{
(github.event_name == 'pull_request')
&& format('pr-{0}', github.event.number) || github.ref
}}-${{
(github.event_name == 'pull_request'
&& (((github.event.action == 'labeled' || github.event.action == 'unlabeled')
&& github.event.label.name != 'pr: rtlmeter')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& !contains(github.event.pull_request.labels.*.name, 'pr: rtlmeter'))))
&& github.run_id || 'shared'
}}
cancel-in-progress: ${{ github.event_name != 'schedule' }}
jobs:
@@ -36,179 +64,257 @@ jobs:
(github.event_name == 'schedule'
&& vars.ENABLE_SCHEDULED_JOBS == 'true') ||
(github.event_name == 'pull_request'
&& contains(github.event.pull_request.labels.*.name, 'pr: rtlmeter')) ||
&& ((github.event.action == 'labeled'
&& github.event.label.name == 'pr: rtlmeter')
|| (github.event.action != 'labeled'
&& github.event.action != 'unlabeled'
&& contains(github.event.pull_request.labels.*.name, 'pr: rtlmeter')))) ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'push')
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
outputs:
old-sha: ${{ steps.start.outputs.old-sha }}
cases: ${{ steps.cases.outputs.cases }}
steps:
- name: Save the pull request number
if: ${{ github.event_name == 'pull_request' }}
run: echo "${{ github.event.number }}" > pr-number.txt
- name: Upload the pull request number
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: pr-number
path: pr-number.txt
overwrite: true
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Startup
run: echo
id: start
env:
GH_TOKEN: ${{ github.token }}
run: |
[[ "${{ github.event_name }}" == 'pull_request' ]] || exit 0
# For a pull request, 'github.sha' is the test merge commit. Its
# first parent is the target branch commit it was merged with for this run.
OLD_SHA="$(gh api "repos/${{ github.repository }}/commits/${{ github.sha }}" --jq '.parents[0].sha')"
echo "old-sha=$OLD_SHA" >> "$GITHUB_OUTPUT"
build-gcc:
name: Build GCC
- name: Load RTLMeter cases
id: cases
run: echo "cases=$(ci/ci-rtlmeter-cases.py --event-name ${{ github.event_name }})" >> "$GITHUB_OUTPUT"
build-gcc-new:
name: Build New Verilator - GCC
needs: start
uses: ./.github/workflows/reusable-rtlmeter-build.yml
uses: ./.github/workflows/reusable-build.yml
with:
runs-on: ubuntu-24.04
cc: gcc
ccwarn: false
install: true
runs-on: ubuntu-26.04
sha: ${{ github.sha }}
build-clang:
name: Build Clang
build-clang-new:
name: Build New Verilator - Clang
needs: start
uses: ./.github/workflows/reusable-rtlmeter-build.yml
uses: ./.github/workflows/reusable-build.yml
with:
runs-on: ubuntu-24.04
cc: clang
ccwarn: false
install: true
runs-on: ubuntu-26.04
sha: ${{ github.sha }}
build-gcc-old:
name: Build Old Verilator - GCC
needs: start
if: ${{ needs.start.outputs.old-sha != '' }}
uses: ./.github/workflows/reusable-build.yml
with:
cc: gcc
ccwarn: false
install: true
runs-on: ubuntu-26.04
sha: ${{ needs.start.outputs.old-sha }}
build-clang-old:
name: Build Old Verilator - Clang
needs: start
if: ${{ needs.start.outputs.old-sha != '' }}
uses: ./.github/workflows/reusable-build.yml
with:
cc: clang
ccwarn: false
install: true
runs-on: ubuntu-26.04
sha: ${{ needs.start.outputs.old-sha }}
run-gcc:
name: Run GCC | ${{ matrix.cases }}
needs: build-gcc
needs:
- start
- build-gcc-new
- build-gcc-old
# Run even if 'build-*-old' was skipped (no old SHA), but not if any
# dependency failed, the workflow was cancelled, or 'start' was skipped
# (e.g. the workflow was not enabled, so there is nothing to run against).
if: ${{ !failure() && !cancelled() && needs.start.result == 'success' }}
uses: ./.github/workflows/reusable-rtlmeter-run.yml
with:
tag: gcc
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
cc: gcc
verilator-archive-new: ${{ needs.build-gcc-new.outputs.archive }}
verilator-archive-old: ${{ needs.build-gcc-old.outputs.archive }}
cases: ${{ matrix.cases }}
run-name: "gcc"
compileArgs: ""
executeArgs: ""
strategy:
fail-fast: false
max-parallel: ${{ github.event == 'schedule' && 2 || 7 }}
fail-fast: ${{ github.event_name == 'pull_request' }}
max-parallel: 7
matrix:
cases:
- "BlackParrot:1x1:*"
- "BlackParrot:4x4:*"
- "Caliptra:default:*"
- "NVDLA:*"
- "OpenPiton:1x1:*"
- "OpenPiton:4x4:*"
- "OpenTitan:*"
- "VeeR-EH1:asic*"
- "VeeR-EH1:default*"
- "VeeR-EH1:hiperf*"
- "VeeR-EH2:asic*"
- "VeeR-EH2:default*"
- "VeeR-EH2:hiperf*"
- "VeeR-EL2:asic*"
- "VeeR-EL2:default*"
- "VeeR-EL2:hiperf*"
- "Vortex:mini:*"
- "Vortex:sane:*"
- "XiangShan:default-chisel3:* !*:linux"
- "XiangShan:default-chisel6:* !*:linux"
- "XiangShan:mini-chisel3:* !*:linux"
- "XiangShan:mini-chisel6:* !*:linux"
- "XuanTie-E902:*"
- "XuanTie-E906:*"
- "XuanTie-C906:*"
- "XuanTie-C910:*"
cases: ${{ fromJSON(needs.start.outputs.cases)['gcc'] }}
run-clang:
name: Run Clang | ${{ matrix.cases }}
needs: build-clang
needs:
- start
- build-clang-new
- build-clang-old
# Run even if 'build-*-old' was skipped (no old SHA), but not if any
# dependency failed, the workflow was cancelled, or 'start' was skipped
# (e.g. the workflow was not enabled, so there is nothing to run against).
if: ${{ !failure() && !cancelled() && needs.start.result == 'success' }}
uses: ./.github/workflows/reusable-rtlmeter-run.yml
with:
tag: clang
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
cc: clang
verilator-archive-new: ${{ needs.build-clang-new.outputs.archive }}
verilator-archive-old: ${{ needs.build-clang-old.outputs.archive }}
cases: ${{ matrix.cases }}
run-name: "clang --threads 4"
compileArgs: "--threads 4"
executeArgs: ""
strategy:
fail-fast: false
max-parallel: ${{ github.event == 'schedule' && 2 || 7 }}
fail-fast: ${{ github.event_name == 'pull_request' }}
max-parallel: 7
matrix:
cases:
- "BlackParrot:1x1:*"
- "BlackParrot:4x4:*"
- "Caliptra:default:*"
- "NVDLA:*"
- "OpenPiton:1x1:*"
- "OpenPiton:4x4:*"
- "OpenTitan:*"
- "VeeR-EH1:asic*"
- "VeeR-EH1:default*"
- "VeeR-EH1:hiperf*"
- "VeeR-EH2:asic*"
- "VeeR-EH2:default*"
- "VeeR-EH2:hiperf*"
- "VeeR-EL2:asic*"
- "VeeR-EL2:default*"
- "VeeR-EL2:hiperf*"
- "Vortex:mini:*"
- "Vortex:sane:*"
- "XiangShan:default-chisel3:* !*:linux"
- "XiangShan:default-chisel6:* !*:linux"
- "XiangShan:mini-chisel3:* !*:linux"
- "XiangShan:mini-chisel6:* !*:linux"
- "XuanTie-E902:*"
- "XuanTie-E906:*"
- "XuanTie-C906:*"
- "XuanTie-C910:*"
cases: ${{ fromJSON(needs.start.outputs.cases)['clang'] }}
run-gcc-hier:
name: Run GCC hier | ${{ matrix.cases }}
needs: build-gcc
needs:
- start
- build-gcc-new
- build-gcc-old
# Run even if 'build-*-old' was skipped (no old SHA), but not if any
# dependency failed, the workflow was cancelled, or 'start' was skipped
# (e.g. the workflow was not enabled, so there is nothing to run against).
if: ${{ !failure() && !cancelled() && needs.start.result == 'success' }}
uses: ./.github/workflows/reusable-rtlmeter-run.yml
with:
tag: gcc-hier
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
cc: gcc
verilator-archive-new: ${{ needs.build-gcc-new.outputs.archive }}
verilator-archive-old: ${{ needs.build-gcc-old.outputs.archive }}
cases: ${{ matrix.cases }}
run-name: "gcc --hierarchical"
compileArgs: "--hierarchical"
executeArgs: ""
strategy:
fail-fast: false
max-parallel: ${{ github.event == 'schedule' && 2 || 7 }}
fail-fast: ${{ github.event_name == 'pull_request' }}
max-parallel: 6
matrix:
cases:
- "BlackParrot:1x1:* !-hier"
- "BlackParrot:4x4:* !-hier"
- "NVDLA:* !-hier"
- "OpenPiton:1x1:* !-hier"
- "OpenPiton:4x4:* !-hier"
- "OpenPiton:8x8:* !-hier"
- "OpenPiton:16x16:dhry !-hier"
- "XuanTie-C910:* !-hier"
cases: ${{ fromJSON(needs.start.outputs.cases)['gcc-hier'] }}
combine-results:
name: Combine results
needs: [run-gcc, run-clang, run-gcc-hier]
# Run if any of the dependencies have run, even if failed.
# That is: do not run if all skipped, or the workflow was cancelled.
if: ${{ (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) && !cancelled() }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
tag: [gcc, clang, gcc-hier]
# Skip if cancelled.
# On PRs, run if something succeeded and nothing failed.
# On non-PRs, run if anything succeeded or failed (so partial results are still published).
if: >-
${{ !cancelled() && (
(github.event_name == 'pull_request' && (contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure')))
|| (github.event_name != 'pull_request' && (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')))
)}}
runs-on: ubuntu-26.04
outputs:
# The run tags, derived from the 'run-*' dependency job names
run-tags: ${{ steps.tags.outputs.tags }}
env:
GH_TOKEN: ${{ github.token }}
# 'gh' resolves the repo from git otherwise, but this job has no checkout
# of this repo at the workspace root
GH_REPO: ${{ github.repository }}
steps:
# Derive the run tags from the dependency job names ('run-<tag>')
- name: Determine run tags
id: tags
run: echo "tags=$(jq -r 'keys | map(sub("^run-"; "")) | join(" ")' <<< '${{ toJSON(needs) }}')" >> "$GITHUB_OUTPUT"
- name: Checkout RTLMeter
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: "verilator/rtlmeter"
path: rtlmeter
- name: Setup RTLMeter venv
working-directory: rtlmeter
run: make venv
- name: Download all results
uses: actions/download-artifact@v8
with:
pattern: rtlmeter-${{ matrix.tag }}-results-*
path: all-results-${{ matrix.tag }}
merge-multiple: true
run: |
for tag in ${{ steps.tags.outputs.tags }}; do
mkdir artifacts all-results-$tag
gh run download ${{ github.run_id }} --pattern "rtlmeter-$tag-results-*" --dir artifacts
mv $(find artifacts -name "*.json") all-results-$tag/
rm -rf artifacts
done
- name: Combine results
working-directory: rtlmeter
run: |
./rtlmeter collate ../all-results-${{ matrix.tag }}/*.json > ../all-results-${{ matrix.tag }}.json
for tag in ${{ steps.tags.outputs.tags }}; do
./rtlmeter collate ../all-results-$tag/*.json > ../all-results-$tag.json
done
- name: Upload combined results
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: all-results-${{ matrix.tag }}.json
name: all-results-${{ matrix.tag }}
path: all-results-*.json
name: all-results
overwrite: true
retention-days: 30
# The reference (old) results only exist for pull requests, where the
# 'build-*-old' jobs run and the run jobs produce '*-reference-*' artifacts.
- name: Download reference results
if: ${{ github.event_name == 'pull_request' }}
run: |
for tag in ${{ steps.tags.outputs.tags }}; do
mkdir artifacts all-reference-$tag
gh run download ${{ github.run_id }} --pattern "rtlmeter-$tag-reference-*" --dir artifacts
mv $(find artifacts -name "*.json") all-reference-$tag/
rm -rf artifacts
done
- name: Combine reference results
if: ${{ github.event_name == 'pull_request' }}
working-directory: rtlmeter
run: |
for tag in ${{ steps.tags.outputs.tags }}; do
./rtlmeter collate ../all-reference-$tag/*.json > ../all-reference-$tag.json
done
- name: Upload reference results
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: all-reference-*.json
name: all-reference
overwrite: true
retention-days: 30
@@ -221,31 +327,30 @@ jobs:
# dashboard UI currently assumes there is only one data point per
# calendar day. Results from reruns can be imported manually if needed.
if: ${{ github.event_name == 'schedule' && github.repository == 'verilator/verilator' && github.run_attempt == 1 && contains(needs.*.result, 'success') && !cancelled() }}
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
- name: Download combined results
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: all-results-*
name: all-results
path: results
merge-multiple: true
- name: Upload published results
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: results/*.json
name: published-results
# Pushing to verilator/verilator-rtlmeter-results requires elevated permissions
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.VERILATOR_CI_ID }}
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
owner: verilator
repositories: verilator-rtlmeter-results
permission-contents: write
- name: Checkout verilator-rtlmeter-results
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: "verilator/verilator-rtlmeter-results"
token: ${{ steps.generate-token.outputs.token }}
@@ -272,116 +377,57 @@ jobs:
prepare-pr-results:
name: Prepare Pull Request results
needs: combine-results
if: ${{ github.event_name == 'pull_request' && github.repository == 'verilator/verilator' && contains(needs.*.result, 'success') && !cancelled() }}
runs-on: ubuntu-24.04
if: ${{ github.event_name == 'pull_request' && github.repository == 'verilator/verilator' && needs.combine-results.result == 'success' }}
runs-on: ubuntu-26.04
permissions:
actions: read
steps:
- name: Checkout RTLMeter
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: "verilator/rtlmeter"
path: rtlmeter
- name: Setup RTLMeter venv
working-directory: rtlmeter
run: make venv
- name: Download combined results
uses: actions/download-artifact@v8
- name: Checkout Verilator
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
pattern: all-results-*
path: all-results
merge-multiple: true
- name: Get scheduled run info
id: scheduled-info
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ID=$(gh run --repo ${{ github.repository }} list --workflow RTLMeter --event schedule --status success --limit 1 --json databaseId --jq ".[0].databaseId")
echo "id=$ID" >> $GITHUB_OUTPUT
URL=$(gh run --repo ${{ github.repository }} view $ID --json url --jq ".url")
echo "url=$URL" >> $GITHUB_OUTPUT
NUM=$(gh run --repo ${{ github.repository }} view $ID --json number --jq ".number")
echo "num=$NUM" >> $GITHUB_OUTPUT
DATE=$(gh run --repo ${{ github.repository }} view $ID --json createdAt --jq ".createdAt")
echo "date=$DATE" >> $GITHUB_OUTPUT
- name: Download scheduled run results
uses: actions/download-artifact@v8
with:
name: published-results
path: nightly-results
run-id: ${{ steps.scheduled-info.outputs.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compare results
working-directory: rtlmeter
run: |
for tag in gcc clang gcc-hier; do
ADATA=../nightly-results/all-results-${tag}.json
BDATA=../all-results/all-results-${tag}.json
touch ../verilate-${tag}.txt
touch ../execute-${tag}.txt
touch ../cppbuild-${tag}.txt
if [[ ! -e $ADATA ]]; then
continue
fi
./rtlmeter compare --cases '* !Example:* !*:hello' --steps "verilate" --metrics "elapsed memory" $ADATA $BDATA > ../verilate-${tag}.txt
cat ../verilate-${tag}.txt
./rtlmeter compare --cases '* !Example:* !*:hello' --steps "execute" --metrics "speed memory elapsed" $ADATA $BDATA > ../execute-${tag}.txt
cat ../execute-${tag}.txt
./rtlmeter compare --cases '* !Example:* !*:hello' --steps "cppbuild" --metrics "elapsed memory cpu codeSize" $ADATA $BDATA > ../cppbuild-${tag}.txt
cat ../cppbuild-${tag}.txt
done
path: verilator
- name: Create report
id: report
working-directory: verilator
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
NUM=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json number --jq ".number")
URL=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json url --jq ".url")
echo -n "Performance metrics for PR workflow [#$NUM]($URL) (B) compared to scheduled run" > report.txt
echo -n " [#${{ steps.scheduled-info.outputs.num }}](${{ steps.scheduled-info.outputs.url }}) (A)" >> report.txt
echo " from ${{ steps.scheduled-info.outputs.date }}" >> report.txt
for tag in gcc clang gcc-hier; do
echo "" >> report.txt
if [[ $tag == "gcc" ]]; then
echo "<details open>" >> report.txt
else
echo "<details>" >> report.txt
fi
echo -n "<summary><strong><em>" >> report.txt
jq -rj ".[0].runName" all-results/all-results-${tag}.json >> report.txt
echo "</em></strong></summary>" >> report.txt
awk -v RS= -v tag=${tag} '{print > sprintf("frag-%02d-verilate-%s.txt",NR,tag)}' verilate-${tag}.txt
awk -v RS= -v tag=${tag} '{print > sprintf("frag-%02d-execute-%s.txt" ,NR,tag)}' execute-${tag}.txt
awk -v RS= -v tag=${tag} '{print > sprintf("frag-$02d-cppbuild-%s.txt",NR,tag)}' cppbuild-${tag}.txt
for f in $(ls -1 frag-*-verilate-${tag}.txt | sort) $(ls -1 frag-*-execute-${tag}.txt | sort) $(ls -1 frag-*-cppbuild-${tag}.txt | sort); do
if [[ $f == frag-01-verilate-${tag}.txt || $f == frag-01-execute-${tag}.txt ]]; then
echo "<details open>" >> report.txt
else
echo "<details>" >> report.txt
fi
echo -n "<summary>" >> report.txt
head -n 1 $f | tr -d '\n' >> report.txt
echo "</summary>" >> report.txt
echo '<pre>' >> report.txt
tail -n +2 $f >> report.txt
echo '</pre>' >> report.txt
echo "</details>" >> report.txt
done
echo "</details>" >> report.txt
done
cat report.txt
ln -s ../rtlmeter rtlmeter
gh repo set-default ${{ github.repository }}
# Create run report - save status to fail job if the script did
STATUS=0
ci/ci-rtlmeter-report.bash ${{ github.run_id }} ${{ github.sha }} ${{ needs.combine-results.outputs.run-tags }} || STATUS=$?
echo "status=$STATUS" >> "$GITHUB_OUTPUT"
# Create the report artifact
mkdir ../report-artifact
mv rtlmeter-report/report ../report-artifact/
echo ${{ github.event.number }} > ../report-artifact/pr-number.txt
- name: Upload report
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: report.txt
name: rtlmeter-pr-results
- name: Save PR number
run: echo ${{ github.event.number }} > pr-number.txt
- name: Upload PR number
uses: actions/upload-artifact@v7
path: report-artifact
name: rtlmeter-report
- name: Upload PR notification
uses: ./verilator/.github/actions/upload-pr-notification
with:
path: pr-number.txt
name: pr-number
path: verilator/rtlmeter-report/notification
key: rtlmeter
- name: Report status
run: exit ${{ steps.report.outputs.status }}
# Create GitHub issue for failed scheduled jobs
# This should always be the last job (we want an issue if anything breaks)
@@ -389,14 +435,14 @@ jobs:
name: Create issue on failure
needs: publish-scheduled-results
if: ${{ github.event_name == 'schedule' && github.repository == 'verilator/verilator' && github.run_attempt == 1 && failure() && !cancelled() }}
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
# Creating issues requires elevated privilege
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.VERILATOR_CI_ID }}
client-id: ${{ vars.VERILATOR_CI_ID }}
private-key: ${{ secrets.VERILATOR_CI_KEY }}
owner: verilator
repositories: verilator
+149
View File
@@ -0,0 +1,149 @@
<!-- DESCRIPTION: Verilator: Repository-wide guidelines for AI coding agents
SPDX-FileCopyrightText: 2026-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -->
# Verilator Guidelines for AI Coding Agents
These files are the general layer an agent loads first -- nearest file wins, so
you read this repository-root file plus the one for the directory you are
editing. They stay deliberately high-level: where to start, how the tree is laid
out, and the conventions reviewers otherwise enforce by hand. They are an index,
not the architecture reference -- for depth (how a pass works internally, the
algorithms, node lifetime) they point you to `docs/internals.rst`. When the
guidance here is not enough, that is where to look next.
This file has two parts. **Orientation** gets you productive in the codebase from
a cold start. **Before you open a PR** is the checklist of conventions reviewers
otherwise have to enforce by hand -- read it before submitting any change.
Then read the directory guide for the area you are editing:
- [src/AGENTS.md](src/AGENTS.md) -- compiler C++ sources: AST, visitors, passes, parser, style
- [include/AGENTS.md](include/AGENTS.md) -- runtime library (`verilated*`): C++14, MT-safety, fixed-width types
- [test_regress/AGENTS.md](test_regress/AGENTS.md) -- regression tests: harness, drivers, golden files
- [docs/AGENTS.md](docs/AGENTS.md) -- documentation (`*.rst`)
______________________________________________________________________
# Orientation
## What Verilator is
Verilator is a *compiler*, not an interpreter. It translates synthesizable (and
much behavioral) SystemVerilog into a cycle-accurate C++ model that you then
compile and run. Almost every decision is made at compile ("verilation") time;
the generated C++ just advances state each evaluation. Optimize for verilation-
time work over runtime work.
## The pipeline is the spine
A run is an ordered sequence of passes over one shared AST (abstract syntax
tree). In source order:
| Stage | What it does | Key files |
|---|---|---|
| Preprocess + parse | Lex and parse text into a raw AST -- builds nodes only, no semantic checks | `verilog.l`, `verilog.y` |
| Link / elaborate | Resolve names, scopes, parameters; instantiate the hierarchy | `V3LinkParse`, `V3LinkDot`, `V3Param` |
| Width / type | Assign and check data types and bit widths | `V3Width` |
| Transform / optimize / schedule | Constant fold, lower language features, schedule events | `V3Const`, `V3Randomize`, `V3Assert*`, `V3Sched`, `V3Timing`, `V3Dfg` |
| Emit | Lower the final AST to generated C++ | `V3EmitC*` |
| Runtime | Library the generated model links against | `include/verilated*` |
This table is the map; `docs/internals.rst` has the detail behind each stage.
## Where to make a change
Map the symptom to the pass that owns it, then start by reading that pass's
top-of-file comment.
| Symptom or feature area | Start in |
|---|---|
| Type/width error, "what type is this", implicit conversion | `V3Width` |
| Name/scope/parameter resolution ("Can't find...", hierarchy) | `V3LinkDot`, `V3Param` |
| `randomize` / `constraint` / `rand` / `randc` | `V3Randomize` |
| `assert` / `property` / `sequence` / `cover` | `V3Assert`, `V3AssertPre`, `V3AssertNfa` |
| `fork` / timing / `#delay` / NBA / event scheduling | `V3Sched`, `V3Timing`, `V3Fork` |
| Syntax wrongly accepted or rejected | `verilog.y`, `verilog.l` |
| Wrong generated C++ | `V3EmitC*` |
| Runtime model behavior | `include/verilated*` |
## Build and run a test
- Build in the source tree: `autoconf && ./configure && make -j8`. Configure with
`--enable-ccwarn` so a new compiler warning stops the build.
- Run one test from the repository root: `test_regress/t/t_<name>.py`.
- Run the full regression tests with `make test`. The complete suite requires
configuring with `--enable-longtests` (works on every OS, including macOS).
______________________________________________________________________
# Before you open a PR
## Scope and process
- [ ] Searched open PRs and issues -- duplicating in-flight work wastes review time.
- [ ] Fixed the general root cause, not just the reported case -- if it also
affects other modules/classes/interfaces, cover them or expect rejection.
- [ ] PR is single-purpose. Refactors, drive-by fixes found along the way, and new
features each go in separate PRs; land standalone cleanups first.
- [ ] Every bug fix has a test that fails *without* the fix; include the issue's
own reproducer when possible.
- [ ] New code aims for 100% line coverage; branch coverage far below line coverage
signals guards callers never violate -- justify or remove them.
- [ ] Ran `make format` (clang-format), `make cppcheck`, and `make lint-py`;
self-reviewed the diff for leftover debug code, stale comments, and
copy-paste errors.
- [ ] Ran the full regression tests on at least one OS before submitting. Partial
runs are fine during development, but the submitted PR is expected to pass every
test.
- [ ] Validated the code changes against recommendations in the AGENTS.md files.
- [ ] Did not edit `docs/CONTRIBUTORS` (humans only) or `Changes` (maintainer
updates it near release).
## Drafting a PR
- [ ] When creating a pull request message, omit itemized lists of changed
files and changes, since reviewers already have access to the diff.
## Pick the right diagnostic (and its required test)
The API you choose determines which test must accompany the change.
| API | Output | Meaning | Required test |
|---|---|---|---|
| `v3error("...")` | `%Error:` | User wrote invalid SystemVerilog | `t_*_bad*.v` + `.out` golden |
| `v3error("Unsupported: ...")` | `%Error-UNSUPPORTED:` | Legal SV that Verilator does not yet support | `t_*_unsup*.v` + `.out` golden |
| `v3warn(CODE, "...")` | `%Warning-CODE:` | Legal but suspicious code | warning test + `.out` golden |
| `v3fatalSrc("...")` | `%Error: Internal Error` | Should-never-happen internal assertion | none -- not user-triggerable |
- Every `v3error`/`v3warn` needs a test in `test_regress/t/` -- enforced by the
warn-coverage distribution test. `v3fatalSrc` is exempt.
- Reserve "Unsupported:" for not-yet-implemented features, never for user mistakes.
- When an error enforces a spec-defined restriction, cite the clause
(`IEEE 1800-2023 11.4.7`) so it is verifiable. Update `docs/guide/warnings.rst`
when adding or changing a warning.
- On error paths, clean up or replace invalid AST (e.g. `AstConst::BitFalse`) so
later passes do not crash after the error.
## Cross-cutting code rules
- [ ] No non-ASCII characters in C++ sources or headers: write `--` (two ASCII
hyphens) rather than a Unicode em-dash, and a plain `'` rather than a smart
quote. At write time, not when CI complains.
- [ ] Lists stay sorted: lexer/parser tokens, option declarations, enum values,
configure feature lists, documented option lists.
- [ ] `bin/` scripts are Python (distributed cross-platform); `nodist/` may use
bash and platform-specific code (developer-only, not packaged).
- [ ] Runtime code in `include/` targets C++14 (`--no-timing` builds must work);
C++20 only in timing code paths.
- [ ] In `include/` public headers, prefix public classes with `Verilated`/`Vl`
and document the API with `///` comments.
- [ ] A new code pattern is applied globally or not at all -- no one-off
convention in a single file.
## Commits
- Subject line is short and imperative and conventionally ends with the
issue number being fixed. No need for the PR number this will be added
during git squash. e.g `Support property case (#7721)`. The commit body message is
optional and common for non-trivial changes.
+35 -5
View File
@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
project(
Verilator
VERSION 5.048
VERSION 5.053
HOMEPAGE_URL https://verilator.org
LANGUAGES CXX
)
@@ -93,7 +93,36 @@ if(OBJCACHE_ENABLED)
endif()
find_package(BISON)
find_package(FLEX)
# Prefer the header installed with the selected generator, including through
# symlinks such as Homebrew's bin/flex. Explicit cache entries take precedence.
find_program(
FLEX_EXECUTABLE
NAMES flex win-flex win_flex
DOC "Path to the flex executable"
)
if(NOT FLEX_EXECUTABLE)
message(
FATAL_ERROR
"Cannot find Flex; set FLEX_EXECUTABLE to its executable path"
)
endif()
get_filename_component(flex_real_executable "${FLEX_EXECUTABLE}" REALPATH)
get_filename_component(flex_bin_dir "${flex_real_executable}" DIRECTORY)
find_path(
FLEX_INCLUDE_DIR
FlexLexer.h
PATHS "${flex_bin_dir}/../include" "${flex_bin_dir}"
NO_DEFAULT_PATH
DOC "Path to the flex headers"
)
find_path(FLEX_INCLUDE_DIR FlexLexer.h)
if(NOT FLEX_INCLUDE_DIR)
message(
FATAL_ERROR
"Cannot find FlexLexer.h; set FLEX_INCLUDE_DIR to its directory"
)
endif()
mark_as_advanced(FLEX_EXECUTABLE FLEX_INCLUDE_DIR)
# Build
#set_property(GLOBAL PROPERTY JOB_POOLS one_job=1)
@@ -155,11 +184,12 @@ install(
foreach(
program
verilator
verilator_gantt
verilator_ccache_report
verilator_coverage
verilator_difftree
verilator_profcfunc
verilator_gantt
verilator_includer
verilator_profcfunc
)
install(PROGRAMS bin/${program} TYPE BIN)
endforeach()
@@ -182,6 +212,6 @@ install(
PATTERN "include/*.cpp"
PATTERN "include/*.vlt"
PATTERN "include/*.sv"
PATTERN "include/gtkwave/*.[chv]*"
PATTERN "include/fstcpp/*.[chv]*"
PATTERN "include/vltstd/*.[chv]*"
)
+534 -11
View File
@@ -1,5 +1,7 @@
.. for github, vim: syntax=reStructuredText
.. Maintainers and agents, do not edit this file, it will be updated for you post- PR-merge.
===============================
Revision History and Change Log
===============================
@@ -8,6 +10,530 @@ The changes in each Verilator version are described below. The
contributors that suggested or implemented a given issue are shown in []. Thanks!
Verilator 5.053 devel
==========================
**Other:**
* Add covergroup runtime registry (#8134). [Matthew Ballance]
* Add initial support for solo `binsof` (#8298). [Marco Bartoli]
* Add `-fno-dead-members` and optimize dead class member functions (#8830).
* Add `--coverage-max-bins` and `--coverage-max-real-bins` (#8499). [Marco Bartoli]
* Remove deprecated `--structs-packed`.
* Change internal module inlining to after V3Scope (#1539) (#8453). [Geza Lore, Testorrent USA, Inc.]
* Change JSON dumps to suppress empty strings, etc.
* Change `--protect` to use SHA512 per IEEE 1735.
* Support multi-dimensional module instance arrays (#2675) (#8476). [Geza Lore, Testorrent USA, Inc.]
* Support VPI interface references (#8081). [Todd Strader]
* Support nested array and associative array element member access in constraint 1/4 - pre-cleanup (#8237). [Kamil Danecki, Antmicro Ltd.]
* Support unique constraint inside std::randomize (#8241). [Kornel Uriasz, Antmicro Ltd.]
* Support nested array and associative array element member access in constraint (#8244). [Kamil Danecki, Antmicro Ltd.]
* Support rand dynamic arrays used inside `with` clause of randomize (#8246). [Kamil Danecki, Antmicro Ltd.]
* Support multiplicity in SVA shapes that use NFA rings (#8267). [Artur Bieniek, Antmicro Ltd.]
* Support non-overlapped property implications correctly (#8268). [Artur Bieniek, Antmicro Ltd.]
* Support logic and set operations on binsof (#8306). [Marco Bartoli]
* Support `illegal_bins` and `ignore_bins` for cross bins (#8372). [Marco Bartoli]
* Support `iff` in covergroup bins (#8406) (#8407). [Marco Bartoli]
* Support enclosing cross identifiers in bin selections (#8416). [Marco Bartoli]
* Support dynamic cross layouts and fix covergroup bin exclusions priority (#8424). [Marco Bartoli]
* Support automatic bins for enum coverpoints (#8462) (#8464). [David Harris]
* Support empty queue literals as function and task arguments (#8501) (#8502). [Francesco Urbani]
* Support covergroup fixed-size bin arrays (#8514). [Marco Bartoli]
* Support wildcard bins (#8516). [Marco Bartoli]
* Support coverpoint bin `with` filters (#8518). [Marco Bartoli]
* Support waiting on clocking block event through modport (#8403) (#8530). [Saqib Khan]
* Optimize NBA shadow copies for partial writes (#8266). [Artur Bieniek, Antmicro Ltd.]
* Optimize recursion depth in DFG circular driver tracing (#8272). [Drew Risinger]
* Optimize DFG synthesis symbol table ordering (#8282). [Geza Lore, Testorrent USA, Inc.]
* Optimize redundant vertex cache lookups in DFG peephole (#8283). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG vertex iteration callbacks (#8284). [Geza Lore, Testorrent USA, Inc.]
* Optimize redundant memoization in DFG CSE (#8285). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG synthesis of simple continuous assignments (#8286). [Geza Lore, Testorrent USA, Inc.]
* Optimize more selects in DFG (#8292). [Geza Lore, Testorrent USA, Inc.]
* Optimize netlist teardown when about to exit (#8294). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG algorithms with an open addressing hash table (#8307). [Geza Lore, Testorrent USA, Inc.]
* Optimize data-type type chain recursion (#8310). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG vertex input edge storage (#8313). [Geza Lore, Testorrent USA, Inc.]
* Optimize successive whole-element array assignments (#8316). [Patrick Creighton]
* Optimize unnecessary per-vertex allocations in NFA lowering (#8319). [Artur Bieniek, Antmicro Ltd.]
* Optimize duplicate lookup in NFA property recursion guard (#8321). [Artur Bieniek, Antmicro Ltd.]
* Optimize NBA assertions by keeping all writers before readers (#8326). [Artur Bieniek, Antmicro Ltd.]
* Optimize wide four-state constant operations in V3Number (#8333). [CatalpaEel]
* Optimize split pass (#8385). [Geza Lore, Testorrent USA, Inc.]
* Optimize covergroup bin metadata lookup (#8404). [Marco Bartoli]
* Optimize dead ports (#8426). [Geza Lore, Testorrent USA, Inc.]
* Optimize instance port connections by aliasing rather than by assignment (#8427). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG temporary sharing across module instances (#8456). [Michael Bedford Taylor]
* Optimize modport resolution with many interface instances (#8496) (#8497). [Deanyone Su]
* Optimize covergroup bin generation (#8499). [Marco Bartoli]
* Optimize through-package variables in DFG. [Geza Lore, Testorrent USA, Inc.]
* Optimize assertion control queries (#8547). [Artur Bieniek, Antmicro Ltd.]
* Optimize sched-initial/static/final split to once per sub-function (#8549). [Krzysztof Bieganski, Antmicro Ltd.]
* Optimize exhaustive case if-chains with an unconditional else (#8554). [Nick Brereton]
* Move module inlining after V3Scope (#8453) (#1539). [Geza Lore, Testorrent USA, Inc.]
* Fix array slice crash when used as a bare value (#5132) (#8262). [Marco Frank]
* Fix function reference into generate case block (#5312) (#8532). [Hongseok Choi]
* Fix pattern type matching against nested aggregates (#7304).
* Fix covergroup-internal references multi-threaded ordering (#7779) (#8255). [Matthew Ballance]
* Fix typedef through a parameterized sub-interface (#7943 repair) (#8124) (#8128). [em2machine]
* Fix detecting non-inlined awaits in V3Delayed.cpp (#7982). [Igor Zaworski, Antmicro Ltd.]
* Fix phased `solve...before` diversity (#8189) (#8194). [Aditya Shevade]
* Fix array-size constraint on arrays inside base class (#8219). [Kornel Uriasz, Antmicro Ltd.]
* Fix multidimensional packed array type handling (#8235). [Artur Bieniek, Antmicro Ltd.]
* Fix library method argument references (#8252). [Geza Lore, Testorrent USA, Inc.]
* Fix CMake to call Verilator Perl wrapper (#8269) (#8270) (#8311). [Drew Risinger]
* Fix real values and unenforced rand/randc type-eligibility rules in constraints (#8273) (#8275) (#8276). [Aditya Shevade]
* Fix assignment pattern default fill of an array of unpacked structs (#8289). [Nick Brereton]
* Fix escape strings in pattern formatting (#8297). [Marco Bartoli]
* Fix DECLFILENAME warning on nested declarations (#8302). [Martijn Wobbes]
* Fix cache of boundary vertices in DFG cycle-breaking (#8308). [Shriyans Sahoo]
* Fix property and sequence line coverage (#8314). [Andrii, Antmicro Ltd.]
* Fix wide typed pattern formatting primitives (#8325). [Marco Bartoli]
* Fix circular class inheritance hang (#8324) (#8545). [Saqib Khan]
* Fix V3InstrCount with recursive functions (#8327) (#8361). [Geza Lore, Testorrent USA, Inc.]
* Fix parameterized class nested in a parameterized interface (#8328) (#8329). [Kristof Marien]
* Fix printing signed enums and wide enum names (#8338). [Marco Bartoli]
* Fix ignoring cross_auto_bin_max instead of hard error (#8340). [Marco Bartoli]
* Fix wide enum names (#8344) (#8362) (#8365) (#8366). [Marco Bartoli]
* Fix class-qualified self reference to a typedef in a parameterized class (#8348) (#8349). [Dragon-Git]
* Fix crash when elaborating a covergroup option through a forward class (#8351) (#8352). [Kristof Marien]
* Fix missing implicit net for bufif/notif/nmos/pmos data input (#8353) (#8354). [Mike Murunov]
* Fix %p format on class members (#8360). [Marco Bartoli]
* Fix Docker compilation with --trace-fst (#8370). [Giuseppe Manzoni]
* Fix NFA rings for bounded SVA delays (#8371). [Artur Bieniek, Antmicro Ltd.]
* Fix DFG driver tracing of partial assignments (#8377) (#8397). [Geza Lore, Testorrent USA, Inc.]
* Fix unique constraint with multiple arrays (#8378). [Kornel Uriasz, Antmicro Ltd.]
* Fix access types of refs and inouts (#8380). [Igor Zaworski, Antmicro Ltd.]
* Fix copy constructor of classes with constraints (#8381). [Ryszard Rozak, Antmicro Ltd.]
* Fix C++ clang 18 compiler with -fno-slp-vectorize (#8383). [Geza Lore, Testorrent USA, Inc.]
* Fix reevaluation of method calls in wait conditions (#8391). [Jesús Alberto López Soto]
* Fix weighted dist constraints in presence of other constraints (#8392). [Kornel Uriasz, Antmicro Ltd.]
* Fix error on non-existent interface ports (#8393). [Andrii Andrieiev, Antmicro Ltd.]
* Fix compile-time blowup forcing large unpacked arrays (#8395). [Jonathan Drolet]
* Fix false MULTIDRIVEN for writes in tasks never executed (#8401). [Artur Bieniek, Antmicro Ltd.]
* Fix $c() inside a DPI export (#8402). [Nazar Zibilyuk]
* Fix covergroup constructor initialization (#8410). [Marco Bartoli]
* Fix issues with configuring flex during build on MacOS (#8412). [Kaleb Barrett]
* Fix interface modport resolution against non-scope symbol tables (#8420). [Geza Lore, Testorrent USA, Inc.]
* Fix FSM coverage hierarchy being emitted as an absolute path (#8421). [Geza Lore, Testorrent USA, Inc.]
* Fix MSYS header include search to be after toolchain headers (#8422). [Kaleb Barrett]
* Fix losing coverage declarations if first in a module body (#8425). [Geza Lore, Testorrent USA, Inc.]
* Fix force read update sensitivity performance (#8431) (#8433). [Jonathan Drolet]
* Fix streaming dynamic arrays with different element types failing to compile (#8434) (#8435). [Kristof Marien]
* Fix internal error when task without C function is left in the tree (#8437). [Artur Bieniek, Antmicro Ltd.]
* Fix nested random dynamic arrays internal error (#8438) (#8439). [Kristof Marien]
* Fix elaboration of classes reached through deferred references (#8440) (#8510). [Ethan Sifferman]
* Fix VPI discoverability of forceable unpacked struct members (#8445). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix compound types in anonymous structs (#8449). [Artur Bieniek, Antmicro Ltd.]
* Fix internal error on covergroup in a specialized parameterized class (#8450) (#8452). [David Harris]
* Fix data race in type handling (#8451). [Tynan McAuley]
* Fix $sscanf/$fscanf returning -1 after a partial match (#8457) (#8459). [David Harris]
* Fix covergroup '0/'1 bin values not filling to coverpoint width (#8458) (#8460). [David Harris]
* Fix embedded covergroup calling an enclosing class method (#8461) (#8463). [David Harris]
* Fix unsized condition not reduced to one bit (#8465) (#8466). [David Harris]
* Fix comma emission for nested JSON scopes (#8469) (#8474). [Noam Gallmann]
* Fix model failing when host has fewer cores than --threads (#8475). [Artur Bieniek, Antmicro Ltd.]
* Fix `##0` synchronous drive overriding later drives (#8482). [Marco Bartoli]
* Fix disable fork and wait fork affecting pending NBA updates (#8483). [Marco Bartoli]
* Fix nonblocking event trigger never firing in suspendable processes (#8485). [Marco Bartoli]
* Fix setting status of finished process immediately (#8503). [Ryszard Rozak, Antmicro Ltd.]
* Fix constant oversized shifts in V3Premit. [Geza Lore, Testorrent USA, Inc.]
* Fix semaphore waiting on killed process (#8505). [Ryszard Rozak, Antmicro Ltd.]
* Fix mis-setting of process state from FINISHED to KILLED (#8506). [Ryszard Rozak, Antmicro Ltd.]
* Fix rand_mode(0) not preserving dynamic array of struct values used in a dist constraint (#8508) (#8509). [Kristof Marien]
* Fix duplicate struct declaration when inlining (#8515). [Ethan Sifferman]
* Fix bear version detection if uninstalled. [Geza Lore, Testorrent USA, Inc.]
* Fix enums inside randomize() with (#8517). [Kornel Uriasz, Antmicro Ltd.]
* Fix emitting public parameters (#8520). [Geza Lore, Testorrent USA, Inc.]
* Fix verilator_coverage report to align with get_coverage() (#8522) (#8524) (#8531). [Marco Bartoli]
* Fix verilator_coverage reports rounding incomplete coverage to 100.0% (#8523). [Jordan Carlin]
* Fix extern class method rejects matching virtual interface argument type (#8525) (#8526). [Kristof Marien]
* Fix of queue pop return value access (#8529) (#8511). [Igor Zaworski, Antmicro Ltd.]
* Fix derived class construction resets inherited per-instance rand_mode state (#8527) (#8528). [Kristof Marien]
* Fix crash on class handle passed to string port (#8536) (#8538). [Noam Gallmann]
* Fix stack depth calculations over calls (#8544). [Nick Brereton]
* Fix cascading errors after unsupported class dot reference in parameter value (#8551). [Martijn Wobbes, Antmicro Ltd.]
* Fix vpi_put_value crash on NULL value pointer (#8553). [Nick Brereton]
* Fix --hierarchical parameter specialization name collisions (#8555) (#8565). [Marco Bartoli]
* Fix dehash of a suffix after a hashed name (#8556). [Ethan Sifferman]
Verilator 5.052 2026-09-05
==========================
**Important:**
* Verilator now supports UVM 2020-3.2; see (#1538) for limitations.
**Other:**
* Add comments as a branch description in coverage .info files (#7843). [Eryk Szpotanski]
* Add --enable-light-debug configure option (#7886). [Geza Lore, Testorrent USA, Inc.]
* Add user-provided DPI-C function declarations (#7626) (#7893). [Jakub Michalski]
* Add error on static virtual functions (#7932). [Igor Zaworski, Antmicro Ltd.]
* Add error when scalar is passed to array task argument (#7948). [Pawel Klopotek]
* Add MULTIDRIVENPROC warning for signals driven by multiple plain always blocks (#7968). [Aisha]
* Add FSM arc and state coverage to verilator_coverage .info output (#7972) (#7973). [Igor Zaworski, Antmicro Ltd.]
* Add SIMILARNAME warning when variables have names that differ in case (#7992) (#8020) (#8186) (#8226) (#8233). [Paul Campbell]
* Add Unigen2 constrained randomization algorithm (#8042). [Jakub Wasilewski, Antmicro Ltd.]
* Add `+verilator+assert+lock` to ignore RTL assert control statements (#8086). [Sumanth Kadiyala]
* Add NEVERMATCH warning when an SVA sequence can never match (#8176) (#8183). [Artur Bieniek, Antmicro Ltd.]
* Remove and deprecate `--assert-unroll-limit`. (#8096). [Artur Bieniek, Antmicro Ltd.]
* Support embedded covergroup member references (#7749) (#8015). [Marco Bartoli]
* Support a sequence used as an event control (#7797) (#7846). [Yilou Wang]
* Support `[\*N:$]` consecutive repetition (#7940). [Artur Bieniek, Antmicro Ltd.]
* Support dynamic containers in unique constraints (#7947). [Adam Kostrzewski, Antmicro Ltd.]
* Support delayed tristate gates (#7960) (#7961). [Patrick Creighton]
* Support `default clocking` (#7984). [Kamil Danecki, Antmicro Ltd.]
* Support embedded covergroup clocking events (#8028). [Marco Bartoli]
* Support `weak`/`strong` keywords in property expressions (#8054). [Artur Bieniek, Antmicro Ltd.]
* Support class handle covergroup arguments (#8071). [Marco Bartoli]
* Support `soft foreach` constraints (#8174). [Kamil Danecki, Antmicro Ltd.]
* Support overlong `within` sequences as never-matching (#8177). [Artur Bieniek, Antmicro Ltd.]
* Support covergroup/function/task (ref/virtual/array) interface arguments (#8180). [Marco Bartoli]
* Support covergroup events with reference members or ref arguments (#8201). [Marco Bartoli]
* Support s_until/s_until_with in property expression (#8220). [Artur Bieniek, Antmicro Ltd.]
* Support solve before with associative array (#8232). [Kamil Danecki, Antmicro Ltd.]
* Optimize random initialization. [Geza Lore, Testorrent USA, Inc.]
* Optimize more always blocks in DFG (#7775). [Geza Lore, Testorrent USA, Inc.]
* Optimize assertion NFAs using bit-vector ring buffers (#7885). [Artur Bieniek, Antmicro Ltd.]
* Optimize circular logic in DFG (#7902). [Geza Lore, Testorrent USA, Inc.]
* Optimize VPI symbol registration and scope construction (#7936). [Nick Brereton]
* Optimize bounded always properties using ring buffers (#8061) (#8092). [Artur Bieniek, Antmicro Ltd.]
* Optimize VL_WORDS_I/VL_BYTES_I (#8095). [Geza Lore, Testorrent USA, Inc.]
* Optimize consecutive and goto repetitions using ring buffers (#8096). [Artur Bieniek, Antmicro Ltd.]
* Optimize temporary insertion for single bit replicates in DFG (#8110). [Geza Lore, Testorrent USA, Inc.]
* Optimize mtask coarsening in multi-threaded scheduling (#8120). [Geza Lore, Testorrent USA, Inc.]
* Optimize NFA delay-ring edge traversal, drop complexity to linear (#8145). [Artur Bieniek, Antmicro Ltd.]
* Optimize associative constant patterns to fixed point (#8147) (#8209). [Geza Lore, Testorrent USA, Inc.]
* Fix procedural tristate assignment overrides (#6785) (#8130). [Eddie Rydell]
* Fix $finish continuing event loop (#7267) (#7950). [Artur Bieniek, Antmicro Ltd.]
* Fix continuing on wait(0) (#7372) (#8231). [Szymon Gizler, Antmicro Ltd.]
* Fix $display accepting streaming concat arguments (#7663) (#7890). [Jaeuk Lee]
* Fix typedef clocking input sampling (#7688 partial) (#8204). [Marco Bartoli]
* Fix DFG misoptimizing bound checks (#7755). [Jakub Michalski]
* Fix unique0 case side effects (#7787). [Pawel Klopotek]
* Fix mid-window disable iff (#7792) (#7869). [Yilou Wang]
* Fix cleaning purity cache after assertions. [Geza Lore, Testorrent USA, Inc.]
* Fix uncaught type error leading to invalid C++ output (#7814). [Geza Lore, Testorrent USA, Inc.]
* Fix internal error for coverpoints that reference a covergroup formal parameter (#7853 partial) (#7889). [Matthew Ballance]
* Fix immediate disable of fork join branches (#7856) (#7931). [Marco Bartoli]
* Fix self-disable of named blocks with forks (Part of #7857) (#7996) (#8006). [Marco Bartoli]
* Fix clang++ ambiguous overload of '==' operator (#7863). [Pawel Kojma, Antmicro Ltd.]
* Fix heap-use-after-free in `VlRNG::VlRNG()` (#7865). [Dragon-Git]
* Fix mixed-width inside and dist range bounds failing randomization (#7875). [Yilou Wang]
* Fix solve-before over array variables failing randomization (#7876). [Yilou Wang]
* Fix scoped randomize with array members under rand_mode (#7877). [Yilou Wang]
* Fix dist constraint on a frozen variable failing randomization (#7878). [Yilou Wang]
* Fix range delays with parameter bounds (#7882). [Artur Bieniek, Antmicro Ltd.]
* Fix --coverage on labeled inline assert/cover property (#7898) (#7904). [Patrick Creighton]
* Fix memory leak in VerilatedFst::close() (#7899). [Jakub Michalski]
* Fix spurious FSM COVERIGN on comparisons (#7900) (#7908). [Yogish Sekhar]
* Fix release of forced port nets (#7901) (#7907). [Artur Bieniek, Antmicro Ltd.]
* Fix independent force of multiply instantiated signals (#7905). [Artur Bieniek, Antmicro Ltd.]
* Fix scheduling of variables written in non-inlined functions in suspendable processes (#7909). [Igor Zaworski, Antmicro Ltd.]
* Fix randomization of unreferenced rand members of unpacked structs (#7910) (#7911). [Philip Axer]
* Fix VL_TO_STRING function for array of structs (#7912). [Kornel Uriasz, Antmicro Ltd.]
* Fix queues falling into wrong template spec (#7914). [Adam Kostrzewski, Antmicro Ltd.]
* Fix type resolution when a local name shadows a type name (#7915). [Pawel Klopotek]
* Fix crash streaming an unpacked array of unpacked structs (#7917). [Nick Brereton]
* Fix streaming concat as output-port lvalue into unpacked struct (#7918). [Nick Brereton]
* Fix dropping variable writes across opaque calls (#7921) (#7933). [Philip Axer]
* Fix dynamic array handling in solve...before (#7922). [Kornel Uriasz, Antmicro Ltd.]
* Fix unlinked error with function call in derived class parameter (#7923). [Mateusz Gancarz, Antmicro Ltd.]
* Fix scheduling of variables written in non-inlined functions in suspendable processes (#7924). [Igor Zaworski, Antmicro Ltd.]
* Fix class parameter resolution (#7935).
* Fix FSM detection of coverage-only branches (#7941) (#7942). [Patrick Creighton]
* Fix use-after-free in V3LinkDotIfaceCapture (#7943). [Nick Brereton]
* Fix sampled-value clocks in repeated assertions (#7944). [Artur Bieniek, Antmicro Ltd.]
* Fix queued $finish/$stop request thread ordering (#7946 prep) (#7952). [Yilou Wang]
* Fix NFA assertion scheduling to fix outcome counts (#7946). [Yilou Wang]
* Fix DFG nested shifts with overflowing shift amount (#7955) (#7977).
* Fix timing controls in interface tasks called via virtual interface (#7959). [Yilou Wang]
* Fix lambda parameter types in queue min and max (#7962). [Bartosz Skorowski]
* Fix solve-before dropping all soft constraints in randomize() (#7963). [Yilou Wang]
* Fix generic interface param resolution in module/cell parameterization (#7970) (#7971). [David Garau]
* Fix lost writes when select width exceeds variable width (#7975). [Bartosz Skorowski]
* Fix $fgets being mis-optimized away (#7976). [G-A. Kamendje]
* Fix SYNCASYNCNET false positive with changed non-edge logic (#7980). [Oron Port]
* Fix variable scope in unique on dynamic array (#7981). [Kornel Uriasz, Antmicro Ltd.]
* Fix table optimization causing not contextually convertible to bool error (#7983). [Jakub Michalski]
* Fix wait fork trigger temporary split across generated functions (#7985) (#7986). [Marco Brambilla]
* Fix randc cycling in a class that also uses solve...before (#7991 partial) (#8055). [Yilou Wang]
* Fix solver session stability to avoid breaking randomize (#7991 partial). [Yilou Wang]
* Fix simulation hang when the solver stops answering (#7991 partial) (#8129) (#8136). [Yilou Wang]
* Fix randomize() with a user variable named 'item' (#7993) (#7994).
* Fix UNSATCONSTR reporting constraint indices above 9 (#7995). [Yilou Wang]
* Fix MULTIDRIVEN/MULTIDRIVENPROC warning suppression via lint_off (#8000). [Gilberto Abram]
* Fix force not substituted into an unpacked array index (#8002).
* Fix dist weights ignored when an item is not a literal (#8003).
* Fix error when forcing an array element read at a run-time index (#8004).
* Fix FSM coverage on empty reset branches (#8005) (#8064). [Yogish Sekhar]
* Fix missing verilator_coverage in cmake install (#8008) (#8011).
* Fix dist inside a foreach nested in a constraint if (#8016).
* Fix gcov dump on warnings discarding later coverage counts (#8017). [Yilou Wang]
* Fix unique constraint crash, guards, and size (#8018).
* Fix Linux peak memory stat to use VmHWM (#8022) (#8070). [Tyrone Marhguy]
* Fix assignment pattern key constant expressions (#8029) (#8030). [Josep Sans]
* Fix skipping optimization for unpacked data types (#8031). [Kornel Uriasz, Antmicro Ltd.]
* Fix gate deduplication with function arguments (#8038). [JOTEGO]
* Fix conditional expression with parameterized classes (#8039). [Pawel Klopotek, Antmicro Ltd.]
* Fix array size references in constraints (#8040). [Kornel Uriasz, Antmicro Ltd.]
* Fix mid-range consecutive repetition rejects (#8041). [Artur Bieniek, Antmicro Ltd.]
* Fix write access to dynamic arrays (#8043). [Bartosz Skorowski, Antmicro Ltd.]
* Fix nondeterminism in trace stage (#8046). [Sumanth Kadiyala]
* Fix force helpers in multiply instantiated modules (#8047). [Artur Bieniek, Antmicro Ltd.]
* Fix pin to non-existent port with PINNOTFOUND suppressed (#8051) (#8052). [Nikolai Kumar]
* Fix wildcard equality against a 4-state constant in an assertion (#8056) (#8057). [Nikolai Kumar]
* Fix untyped datatype error on sampling functions with property arguments (#8060). [Artur Bieniek, Antmicro Ltd.]
* Fix VPI cbValueChange for 1-bit select (#8063). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix NFA assertion crash and mis-counted property if/case (#8074). [Yilou Wang]
* Fix skipping non-constrained enum constraining when inside object of other class (#8075). [Kornel Uriasz, Antmicro Ltd.]
* Fix use-after-free of captured interface typedef reference during parameter cloning (#8076). [em2machine]
* Fix unintended side-effect insertion on associative array read (#8077). [Adam Kostrzewski, Antmicro Ltd.]
* Fix undefined symbol solver error (#8080). [Igor Zaworski, Antmicro Ltd.]
* Fix unpacked array element force with procedural assign (#8084) (#8085). [Nikolai Kumar]
* Fix reading another parameter resolves to 0 in cloned modules (#8086) (#8069). [em2machine]
* Fix hierarchical class scope resolution (#8094). [Artur Bieniek, Antmicro Ltd.]
* Fix segmentation fault on parameters (#8102) (#8149). [Sumanth Kadiyala]
* Fix the clang compilation using precompiled headers (#8105). [Demin Han]
* Fix invalid typedef (#8106). [Adam Kostrzewski, Antmicro Ltd.]
* Fix R/W references to random builtin function seeds (#8112). [Geza Lore, Testorrent USA, Inc.]
* Fix invalid C++ on cast (#8113). [Pawel Klopotek, Antmicro Ltd.]
* Fix COVERIGN on SVA goto repetition (#8118). [Artur Bieniek, Antmicro Ltd.]
* Fix unordered data hazards in multi-threaded scheduling (#8133). [Geza Lore, Testorrent USA, Inc.]
* Fix public table offsets larger than 32 bits (#8135). [Sunimali Rathnayake]
* Fix 'get-value' for empty constrained arrays (#8138). [Kornel Uriasz, Antmicro Ltd.]
* Fix streaming concatenation uninitialized read-modify-write access (#8143). [Geza Lore, Testorrent USA, Inc.]
* Fix unpacked array passing to logic task argument error (#8148). [Pawel Klopotek, Antmicro Ltd.]
* Fix $past in final blocks on a sampling-tick finish (#8153). [Yilou Wang]
* Fix array reference in reduction constraints (#8158). [Kornel Uriasz, Antmicro Ltd.]
* Fix VPI force data corruption (#8160). [Jonathan Drolet]
* Fix sampled-value functions output on the first cycle (#8162). [Artur Bieniek, Antmicro Ltd.]
* Fix null pointer dereference in process destruction (#8171). [Andrii, Antmicro Ltd.]
* Fix invalid conversion of queue (#8172). [Andrii, Antmicro Ltd.]
* Fix crash on forward-referencing parameters (#8175). [Geza Lore, Testorrent USA, Inc.]
* Fix crash on empty `#()` parameter list on class instance (#8182). [Geza Lore, Testorrent USA, Inc.]
* Fix crash on multiple missing type parameters (#8184). [Geza Lore, Testorrent USA, Inc.]
* Fix SVA bound limit guard, leave headroom for alignment, respect --max-num-width (#8192). [Artur Bieniek, Antmicro Ltd.]
* Fix internal error on an enum literal inside a `with` lambda body (#8190) (#8193). [Aditya Shevade]
* Fix internal error on backslash-quoted strings (#8198). [Henry Hsieh]
* Fix backslash behavior in string literals (#8211). [Pawel Klopotek, Antmicro Ltd.]
* Fix task inout pin resizing error (#8212). [Pawel Klopotek, Antmicro Ltd.]
* Fix code generation for postponed region (#8218). [Geza Lore, Testorrent USA, Inc.]
* Fix method calls to be a reorder barrier (#8222). [Matthew Ballance]
* Fix errors on stream connected to instance port (#8234). [Geza Lore, Testorrent USA, Inc.]
* Fix folding of short circuiting operators guarding member access (#8238). [Geza Lore, Testorrent USA, Inc.]
* Fix MULTIDRIVENPROC on static loop induction variables (#8242). [Geza Lore, Testorrent USA, Inc.]
* Fix multiply undefined behavior on signed int overflow (#8247) (#8248). [Paul Rigge]
* Fix initial statements with gate optimization (#8250). [Prithayan Barua]
* Fix segmentation fault on context destruction (#8265).
* Fix mis-randomizing an unpacked struct member when not rand/randc (#8277) (#8278). [Aditya Shevade]
* Fix std::randomize() with-clause array index arguments (#8279) (#8280). [Aditya Shevade]
* Fix incorrect reference to sync/async in SYNCASYNCNET warning (#8281). [Andrii, Antmicro Ltd.]
* Fix use-after-free of captured interface typedef in deleted generate branch (#8287). [Nick Brereton]
Verilator 5.050 2026-07-01
==========================
**Important:**
* Support covergroups, coverpoints, and bins (#784) (#7117) (#7728). [Matthew Ballance]
* Support new FST writer API (#6871) (#6992). [Yu-Sheng Lin]
Use of FST may requiring installing liblz4 and/or liblz4-dev packages, see docs/install.rst.
**Other:**
* Add `+verilator+log+file` (#4505) (#7645). [Tracy Narine]
* Add peak memory usage to `--stats`. [Geza Lore, Testorrent USA, Inc.]
* Add error on mixed-initialization (#7352) (#7357).
* Add `--coverage-per-instance` (#7636). [Yogish Sekhar]
* Add NOTREDOP error on reduction and negation operators (#7417) (#7623) (#7624).
* Add hierarchy-aware reporting to `verilator_coverage` (#7657). [Yogish Sekhar]
* Add FINALDLY error (#7754). [Igor Zaworski, Antmicro Ltd.]
* Deprecate isolate_assignments attribute (#7774) (#7144). [Geza Lore, Testorrent USA, Inc.]
* Improve `--coverage-fsm` (#7490) (#7529) (#7561) (#7573) (#7619). [Yogish Sekhar]
* Change `+verilator+seed` to default to 1, and 0 to randomly select (#7325) (#7516). [Miguel]
* Change JSON to include parameter constant mnemonics for FSM Coverage (#7531). [Yogish Sekhar]
* Support assert property `default disable iff` (#4848) (#7723). [Artur Bieniek, Antmicro Ltd.]
* Support printing enum names for %p and %s (#5523) (#7338 repair) (#7521) (#7527). [Nick Brereton]
* Support weak `until` / `until_with` property operators (#7290) (#7548) (#7685). [Yilou Wang]
* Support `s_eventually` (#7291) (#7508). [Bartłomiej Chmiel, Antmicro Ltd.]
* Support writing to inout in fork after timing (#7345). [Kamil Danecki, Antmicro Ltd.]
* Support `always` / `always[m:n]` / `s_always[m:n]` property operators (#7482). [Yilou Wang]
* Support rand_mode() on static rand class members (#7484) (#7510). [Yilou Wang]
* Support `randomize() with (identifier_list) {constraint_block}` (#7486) (#7507). [Yilou Wang]
* Support `obj.randomize(null)` (#7487) (#7509). [Yilou Wang]
* Support functions on RHS of force (#7491). [Artur Bieniek, Antmicro Ltd.]
* Support procedural continuous assign/deassign (#7493). [Artur Bieniek, Antmicro Ltd.]
* Support randsequence production function ports (#7522). [Yilou Wang]
* Support followed-by operators `#-#` and `#=#` in properties (#7523). [Yilou Wang]
* Support expression coverage on assign statements (#7542) (#7543). [Thomas Brown]
* Support TERMUX (#7559). [Laurent CHARRIER]
* Support NBAs in initial blocks with delay/event controls (#7566) (#7600). [Muzaffer Kal]
* Support SVA goto repetition with range `[->M:N]` (#7569). [Yilou Wang]
* Support property abort operators (accept_on, reject_on) (#7578). [Yilou Wang]
* Support procedural concurrent assertions with inferred clock (#7581). [Yilou Wang]
* Support calling interface functions without parens (#7584). [Krzysztof Bieganski, Antmicro Ltd.]
* Support streaming on queues (#7597). [Benjamin Collier, Secturion Systems, Inc.]
* Support clocking event on a sequence declaration body (#7598) (#7793). [Yilou Wang]
* Support generic interface arrays (#7604). [Krzysztof Bieganski, Antmicro Ltd.]
* Support FSM detection in primitive wrappers (#7607). [Yogish Sekhar]
* Support busses with mix of pullup/pulldown (#7632). [Lucas Amaral]
* Support forceable on unpacked array variables (#7677) (#7678). [Nikolai Kumar]
* Support pre/post increment/decrement inside && and || (#7683). [Nick Brereton]
* Support streaming into 2-D unpacked arrays (#7686) (#7687). [Paul Swirhun]
* Support if/if-else in properties (#7692). [Artur Bieniek, Antmicro Ltd.]
* Support process::self().srand() (#7695). [Igor Zaworski, Antmicro Ltd.]
* Support MacOS lldb (#7697). [Tracy Narine]
* Support assoc array methods with wide value types (#7680). [pawelktk]
* Support property case (#7682) (#7721). [Artur Bieniek, Antmicro Ltd.]
* Support `s_until` and `s_until_with`(#7722). [Artur Bieniek, Antmicro Ltd.]
* Support covergroup runtime model Phase A1 (#7728). [Matthew Ballance]
* Support hierarchical reference cross members (#7749) (#7820). [Matthew Ballance]
* Support reduction XOR/AND operations in constraints (#7753). [Kornel Uriasz, Antmicro Ltd.]
* Support NBAs in initial blocks (#7754). [Igor Zaworski, Antmicro Ltd.]
* Support assertion control system tasks in classes and interfaces (#7761). [Yilou Wang]
* Support cover sequence statement (#7764). [Yilou Wang]
* Support unpacked struct stream (#7767). [Nick Brereton]
* Support $assertcontrol control_type from lock to kill (#7788). [Yilou Wang]
* Support unbounded always [m:$] and strong s_always liveness (#7798). [Yilou Wang]
* Support method calls on a sub-interface via a virtual interface (#7800). [Yilou Wang]
* Support global $assertcontrol (#7807). [Artur Bieniek, Antmicro Ltd.]
* Support VPI access to unpacked struct members (#7823). [Nick Brereton]
* Support variable-length intersect in SVA sequences (#7835). [Yilou Wang]
* Support dynamic loading of VPI extensions (#7727). [Matthew Ballance]
* Optimize DFG cycle breaking to do less work (#7210). [Geza Lore, Testorrent USA, Inc.]
* Optimize emitting to_string() for compiler speedup (#7468). [Jakub Michalski, Antmicro Ltd.]
* Optimize additional DFG peephole cases (#7553). [Varun Koyyalagunta, Testorrent USA, Inc.]
* Optimize forced signal handling (#7554 partial) (#7572) (#7594) (#7596). [Krzysztof Bieganski, Artur Bieniek, Antmicro Ltd.]
* Optimize primitive runtime functions. [Geza Lore, Testorrent USA, Inc.]
* Optimize if branches with same trailing statements (#7674). [Geza Lore, Testorrent USA, Inc.]
* Optimize wide conditional expansion in V3Premit (#7691). [Geza Lore, Testorrent USA, Inc.]
* Optimize VL_ONEHOT. [Geza Lore, Testorrent USA, Inc.]
* Optimize formatting functions (#7701) (#7702) (#7703). [Geza Lore, Testorrent USA, Inc.]
* Optimize DPI import argument passing (#7704). [Geza Lore, Testorrent USA, Inc.]
* Optimize runtime assertOn() checks (#7707). [Geza Lore, Testorrent USA, Inc.]
* Optimize $countones and $onehot in DFG. [Geza Lore, Testorrent USA, Inc.]
* Optimize procedural loop unrolling. [Geza Lore, Testorrent USA, Inc.]
* Optimize V3Gate inlining heuristic (#7716). [Geza Lore, Testorrent USA, Inc.]
* Optimize reset in DFG (#7737). [Geza Lore, Testorrent USA, Inc.]
* Optimize DFG with relaxed live variable analysis (#7739). [Geza Lore, Testorrent USA, Inc.]
* Optimize conditional patterns sharing common MBSs/LSBs in DfgPeephole (#7760). [Geza Lore, Testorrent USA, Inc.]
* Optimize bit select removal earlier in DFG (#7762). [Geza Lore, Testorrent USA, Inc.]
* Optimize away proven redundant case statement assertions (#7771). [Geza Lore, Testorrent USA, Inc.]
* Optimize table lookups in DFG (#7772). [Geza Lore, Testorrent USA, Inc.]
* Optimize input combinational logic by change detection (#7784). [Geza Lore, Testorrent USA, Inc.]
* Optimize decoder case statements into lookup tables (#7795). [Geza Lore, Testorrent USA, Inc.]
* Optimize wide decoder case statements into decoder expressions (#7804). [Geza Lore, Testorrent USA, Inc.]
* Optimize statically known oversize shifts (#7806). [Geza Lore, Testorrent USA, Inc.]
* Optimize generated function inlining (#7811). [Geza Lore, Testorrent USA, Inc.]
* Optimize bit-scan loops into most-set-bit or $countones (#7822). [Thomas Santerre]
* Optimize additional expression patterns (#7824). [Geza Lore, Testorrent USA, Inc.]
* Optimize module inlining heuristic (#7837). [Geza Lore, Testorrent USA, Inc.]
* Fix `$bits` on unpacked structs (#4521) (#7796). [Nick Brereton]
* Fix TSP variable ordering for mtasks (#5342) (#7610). [Muzaffer Kal]
* Fix inlining static initializer in V3Gate (#5381) (#7503). [Andrew Nolte] [Geza Lore, Testorrent USA, Inc.]
* Fix timed nested fork block with disable (#6720) (#7743). [Marco Bartoli]
* Fix segmentation fault when using --trace with --lib-create (#7299) (#7518). [anonkey]
* Fix cross-hierarchy tristate drivers of interface nets (#7339) (#7801). [Yilou Wang]
* Fix destructive event state before dynamic waits (#7340). [Nick Brereton]
* Fix ALWCOMBORDER on variable ordering (#7350) (#7608). [Cookie]
* Fix false MULTIDRIVEN warning on always_ff variables (#7351) (#7621) (#7672).
* Fix array pattern concatenation (#7401) (#7402). [Greg Davill]
* Fix fairness in `std::semaphore` (#7435) (#7605). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix generic interface port forwarded to a nested instance (#7454) (#7457). [Yilou Wang]
* Fix internal error on multi-cycle SVA under default clocking (#7472) (#7506). [Yilou Wang]
* Fix internal error instead of missing prototype error (#7485). [Alex Solomatnikov]
* Fix mailbox#(packed_struct) type mismatch with parameterized class (#7494) (#7495). [Nikolai Kumar]
* Fix std::randomize internal error on static member of different class (#7498) (#7499). [Alex Solomatnikov]
* Fix assert under assert error (#7500) (#7513). [Nikolai Kumar]
* Fix std::unique_ptr with incomplete type for clang (#7501) (#7526).
* Fix virtual interface method call inlining and IMPURE suppression (#7505). [Nikolay Puzanov]
* Fix expression coverage in loops (#7511). [Todd Strader]
* Fix $bits on local struct with chained-interface (#7515) (#7517).
* Fix array indexing side effects in compound assignments (#7519) (#7540) (#7544). [Kamil Danecki, Antmicro Ltd.]
* Fix class::localparam during elaboration (#7524) (#7534).
* Fix dearray variable scope error (#7530) (#7602).
* Fix nested parameterized class typedef chain (#7538). [Michael Rogenmoser]
* Fix events in observed region (#7546). [Todd Strader]
* Fix regression rejecting boolean `!x` inside sequence expressions (#7549) (#7551). [Yilou Wang]
* Fix exponential expansion in V3Gate (#7550). [Geza Lore, Testorrent USA, Inc.]
* Fix internal error on consecutive repetition with N > 256 (#7552) (#7603). [Yilou Wang]
* Fix inherited rand array with .size + foreach constraint (#7558) (#7650). [Yilou Wang]
* Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684). [Yilou Wang]
* Fix HIERPARAM lint checking (#7570) (#7690). [em2machine]
* Fix display of %m in non-first argument (#7574).
* Fix floating point compile warning on min/max delays.
* Fix force of unpacked arrays (#7579) (#7580). [Zubin Jain]
* Fix property argument retaining type of the previous variable (#7582). [Jakub Michalski]
* Fix NBA to whole arrays (#7583) (#7575). [Geza Lore, Testorrent USA, Inc.]
* Fix wrong false assert for property local variables with cycle-delayed consequents (#7587) (#7651). [Yilou Wang]
* Fix interface instance name collision (#7591) (#7593). [Stuart Morris]
* Fix process comparison compile error with `--public-flat-rw` (#7592).
* Fix CPU pinning when no 'core id' present (#7599). [Geza Lore, Testorrent USA, Inc.]
* Fix access to parameters via class::localparam (#7609) (#7671). [em2machine]
* Fix clocking-block sample of unpacked array (#7612) (#7613). [Nikolai Kumar]
* Fix type parameters order (#7615) (#7653) (#7693). [Kamil Danecki, Antmicro Ltd.]
* Fix unique_index method on assoc arrays with values differing from the keys (#7616). [Pawel Klopotek]
* Fix wide equality comparison in unpacked structs (#7618). [Geza Lore, Testorrent USA, Inc.]
* Fix force determinism (#7620) (#7637). [Artur Bieniek, Antmicro Ltd.]
* Fix reference counting for modport task references (#7628). [Nick Brereton]
* Fix internal error when handling typedefs containing parameterized class type members (#7635) (#7661). [em2machine]
* Fix forceable signal with a procedural continuous assign (#7638) (#7639). [Zubin Jain]
* Fix scheduling of virtual interface method writes (#7641). [Artur Bieniek, Antmicro Ltd.]
* Fix implicit conversions of VlWide (#7642). [Geza Lore, Testorrent USA, Inc.]
* Fix CASEINCOMPLETE to not warn on `unique0 case` (#7647).
* Fix hierarchical coverage counts for duplicate no-inline module instances (#7649). [Yogish Sekhar]
* Fix dropped iff guard on clocking inside task (#7658) (#7659). [Nikolai Kumar]
* Fix runtime speed summary report. [Geza Lore, Testorrent USA, Inc.]
* Fix reserved keywords reaching emitter (#7666). [Pawel Kojma, Antmicro Ltd.]
* Fix width of unsized literal in property expression (#7668). [Artur Bieniek, Antmicro Ltd.]
* Fix loss of events due to bit shift (#7670). [Artur Bieniek, Antmicro Ltd.]
* Fix parameter read through locally-declared interface instance (#7679). [Nick Brereton]
* Fix skipping nulls in $sscanf (#7689).
* Fix bounds checks in expressions with read/write references (#7694). [Ryszard Rozak, Antmicro Ltd.]
* Fix (const) ref default task argument handling (#7698). [Nick Brereton]
* Fix `ref` argument type check for packed arrays with differing range directions (#7700). [Nick Brereton]
* Fix ignoring not-found modules with encoded names (#7706). [Igor Zaworski, Antmicro Ltd.]
* Fix MULTIDRIVEN in generates (#7709). [Todd Strader]
* Fix parameter pollution when using class parameters (#7711) (#7763). [em2machine]
* Fix Makefile action to not write to ${srcdir} (#7715). [Larry Doolittle]
* Fix splitting functions containing fork logic (#7717). [Mateusz Gancarz, Antmicro Ltd.]
* Fix optimizations of assignments with timing controls (#7718). [Ryszard Rozak, Antmicro Ltd.]
* Fix s_eventually on interface (#7731) (#7733). [Marco Bartoli]
* Fix parameter values in coverage bins widths (#7732) (#7734). [Marco Bartoli]
* Fix configure fall back on dynamic malloc libraries (#7736). [Geza Lore, Testorrent USA, Inc.]
* Fix crash on overlapping priority case. [Geza Lore, Testorrent USA, Inc.]
* Fix s_eventually in parameterized interfaces (#7741). [Nick Brereton]
* Fix dpi export pointers (#7742) (#7751). [Yilin Li]
* Fix force on unpacked bit select (#7744) (#7745). [Nikolai Kumar]
* Fix `$` as unsupported coverpoint-bin range bounds (#7750) (#7825). [Matthew Ballance]
* Fix FSM detect unchecked casts and variable redeclaration (#7758). [Adam Kostrzewski, Antmicro Ltd.]
* Fix no-scope internal error on virtual interface method calls (#7759). [Yilou Wang]
* Fix `case (_) inside` with x wildcards (#7766). [Geza Lore, Testorrent USA, Inc.]
* Fix not failing assertion when RHS of a range window rejects once (#7773). [Artur Bieniek, Antmicro Ltd.]
* Fix $fflush and autoflush with --threads (#7782).
* Fix out-of-bounds read value for 2-state types (#7785). [Jakub Michalski]
* Fix `cover property` of an implication counting vacuous matches (#7789). [Yilou Wang]
* Fix randomization of dynamic arrays of objects (#7790). [Ryszard Rozak, Antmicro Ltd.]
* Fix randomize() with skipping derived pre/post_randomize (#7799). [Yilou Wang]
* Fix skewed dist operator for arrays (#7802). [Jakub Wasilewski, Antmicro Ltd.]
* Fix assertion when loop unrolling failed (#7810). [Geza Lore, Testorrent USA, Inc.]
* Fix CASEINCOMPLETE for all uncovered enum items (#7815) (#7817). [Saksham]
* Fix split optimization nested-class crash (#7826). [Igor Zaworski, Antmicro Ltd.]
* Fix class/var named identically to an enclosing-scope type (#7827) (#7828). [Tom Jackson]
* Fix performance on large package-scoped structs (#7830). [Wolfgang Mayerwieser]
* Fix unclocked concurrent assertion misreported as unsupported (#7831). [Yilou Wang]
* Fix insertion of expression coverage statement (#7832). [Ryszard Rozak, Antmicro Ltd.]
* Fix lifetime of expression coverage variable (#7834). [Ryszard Rozak, Antmicro Ltd.]
* Fix disable iff ignored when its condition is held continuously true (#7841). [Yilou Wang]
* Fix constant pool cache after dead scope removal (#7845). [Nick Brereton]
* Fix covergroups without --coverage (#7848) (#7849). [Joshua Leahy]
* Fix class scope '::' reference through an inherited type parameter (#7844). [Sergey Chusov]
Verilator 5.048 2026-04-26
==========================
@@ -35,7 +561,7 @@ Verilator 5.048 2026-04-26
* Improve NFA-based multi-cycle SVA evaluation engine (#7430). [Yilou Wang]
* Change array tracing to dump left index to right index (#7205). [Geza Lore, Testorrent USA, Inc.]
* Change `--converge-limit` default to 10000 (#7209).
* Support inout inside SV interface (#3466) (#7134). [Nick Brereton]
* Support inout inside SV interface (#3466) (#7134) (#7708) (#7710). [Nick Brereton]
* Support `##0` cycle delays (#4263) (#7298). [Yilou Wang]
* Support multidimensional arrays of interfaces (#6230) (#7451). [em2machine]
* Support array reduction methods with 'with' clause in constraints (#6455) (#6999). [Rahul Behl]
@@ -179,7 +705,7 @@ Verilator 5.048 2026-04-26
* Fix std::randomize inside {typedef array} internal error (#7481). [Yilou Wang]
* Fix module parameters not re-evaluated upon instantiation (#7463) (#7477). [em2machine]
* Fix infinite recursion with VERILATOR_BIN (#7496) (#7497).
* Add error on mixed declaration initialization with continuous assignment (#7352). [Zhi QU]
Verilator 5.046 2026-02-28
==========================
@@ -342,7 +868,7 @@ Verilator 5.044 2026-01-01
* Support clocking output delay `1step` (#6681). [Ondrej Ille]
* Support parsing of dotted `bins_expression` (#6683). [Pawel Kojma, Antmicro Ltd.]
* Support constant expression cycle delays in sequences (#6691). [Ryszard Rozak, Antmicro Ltd.]
* Support general global constraints (#6709) (#6711). [Yilou Wang]
* Support general global constraints (#6709) (#6711) (#7833) (#7838). [Yilou Wang]
* Support complex std::randomize patterns (#6736) (#6737). [Yilou Wang]
* Support `rand_mode` in global constraint gathering (#6740) (#6752). [Yilou Wang]
* Support reduction or in constraints (#6840). [Pawel Kojma, Antmicro Ltd.]
@@ -686,7 +1212,7 @@ Verilator 5.038 2025-07-08
* Support non-overlapping blocking/non-blocking assignments (#6137). [Geza Lore]
* Support parameter forward types.
* Support constant functions with left-hand-side concatenates.
* Add PROCINITASSIGN on initial assignments to process variables (#2481). [Niraj Menon]
* Add PROCINITASSIGN on initial assignments to process variables (#2481) (#7640). [Niraj Menon]
* Add BADVLTPRAGMA on unknown Verilator pragmas (#5945). [Shou-Li Hsu]
* Add ternary operator into branch coverage (#5880). [Ryszard Rozak, Antmicro Ltd.]
* Add aggregate type error checks (#5570) (#5950). [Shou-Li Hsu]
@@ -1477,7 +2003,7 @@ Verilator 5.016 2023-09-16
* Optimize Verilator executable size by refactoring error reporting routines (#4446). [Anthony Donlon]
* Optimize Verilation runtime pointers and graphs (#4396) (#4397) (#4398). [Krzysztof Bieganski, Antmicro Ltd]
* Optimize preparations towards multithreaded Verilation (#4291) (#4463) (#4476) (#4477) (#4479). [Kamil Rakoczy, Antmicro Ltd]
* Fix Windows filename format, etc (#3873) (#4421). [Anthony Donlon].
* Fix Windows filename format, etc (#3873) (#4421). [Anthony Donlon]
* Fix t_dist_cppstyle Perl performance issue (#4085). [Srinivasan Venkataramanan]
* Fix using type in parameterized classes without #() (#4281) (#4440). [Anthony Donlon]
* Fix false INFINITELOOP on forever..mailbox.get() (#4323). [Srinivasan Venkataramanan]
@@ -2342,7 +2868,6 @@ Verilator 4.108 2021-01-10
* Fix to ignore coverage on real ports (#2741) (#2745). [Paul Wright]
Verilator 4.106 2020-12-02
==========================
@@ -2749,7 +3274,6 @@ Verilator 4.018 2019-08-29
* Fix internal error on gate optimization of assign. (#1475) [Oyvind Harboe]
Verilator 4.016 2019-06-16
==========================
@@ -3264,7 +3788,7 @@ Verilator 3.880 2015-12-19
* Fix model restore crash. (#1013) [Jason McMullan]
* Fix arrayed instances to unpacked of same size. (#1015) [Varun Koyyalagunta]
* Fix slices of unpacked arrays with non-zero LSBs.
* Fix ternary operation with unpacked array. (#1017) [Varun Koyyalagunta].
* Fix ternary operation with unpacked array. (#1017) [Varun Koyyalagunta]
Verilator 3.878 2015-11-01
@@ -3354,7 +3878,7 @@ Verilator 3.870 2015-02-12
* Suppress COMBDLY when inside always_latch. (#864) [Iztok Jeras]
* Support cast operator with expression size. (#865) [Iztok Jeras]
* Add warning on slice selection out of bounds. (#875) [Cong Van Nguyen].
* Add warning on slice selection out of bounds. (#875) [Cong Van Nguyen]
* Fix member select error broke in 3.868. (#867) [Iztok Jeras]
* Fix $sccanf from string. (#866) [David Pierce]
* Fix VM_PARALLEL_BUILDS broke in 3.868. (#870) [Hiroki Honda]
@@ -5200,7 +5724,6 @@ Verilator 3.270 2004-10-15
* Fix numeric fault when dividing by zero.
Verilator 3.260 2004-10-07
==========================
@@ -5539,7 +6062,7 @@ Verilator 3.104 2003-04-30
**Major:**
* Indicate direction of ports with VL_IN and VL_OUT.
* Allow $c32, etc, to specify width of the $c statement for VCS.
* Allow $c32, etc, to specify width of the $c statement.
* Numerous performance improvements, worth about 25%
**Minor:**
-9
View File
@@ -1,9 +0,0 @@
Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+60 -19
View File
@@ -94,6 +94,7 @@ CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CFG_WITH_DEV_GCOV = @CFG_WITH_DEV_GCOV@
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
CFG_WITH_SOLVER = @CFG_WITH_SOLVER@
GCOV = @GCOV@
PACKAGE_VERSION = @PACKAGE_VERSION@
#### End of system configuration section. ####
@@ -260,7 +261,7 @@ VL_INST_INC_SRCDIR_FILES = \
include/*.[chv]* \
include/*.vlt \
include/*.sv \
include/gtkwave/*.[chv]* \
include/fstcpp/*.[chv]* \
include/vltstd/*.[chv]* \
VL_INST_DATA_SRCDIR_FILES = \
@@ -292,15 +293,14 @@ installbin: | mkbindirs
done
installredirect: installbin | mkbindirs
cp ${srcdir}/bin/redirect ${srcdir}/bin/redirect.tmp
perl -p -i -e 'use File::Spec;' \
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(bindir))", "$(realpath $(DESTDIR)$(pkgdatadir)/bin)");' \
-e 's/RELPATH.*/"$$path";/g' -- "${srcdir}/bin/redirect.tmp"
cd $(srcdir)/bin; \
REDIR_SCRATCH=$$(mktemp redir_XXXXXX); \
perl -p -e 'use File::Spec;' \
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(bindir))", "$(realpath $(DESTDIR)$(pkgdatadir)/bin)");' \
-e 's/RELPATH.*/"$$path";/g' -- "${srcdir}/bin/redirect" > $$REDIR_SCRATCH; \
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) $(VL_INST_PUBLIC_BIN_FILES) ; do \
$(INSTALL_PROGRAM) redirect.tmp $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done
rm ${srcdir}/bin/redirect.tmp
$(INSTALL_PROGRAM) $$REDIR_SCRATCH $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done; \
rm $$REDIR_SCRATCH
# Man files can either be part of the original kit, or built in current directory
# So important we use $^ so VPATH is searched
@@ -311,7 +311,7 @@ installman: $(VL_INST_MAN_FILES)
done
installdata:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/include/gtkwave
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/include/fstcpp
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/include/vltstd
for p in $(VL_INST_INC_BLDDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
@@ -356,7 +356,7 @@ uninstall:
-rm $(DESTDIR)$(pkgdatadir)/verilator-config.cmake
-rm $(DESTDIR)$(pkgdatadir)/verilator-config-version.cmake
-rmdir $(DESTDIR)$(pkgdatadir)/bin
-rmdir $(DESTDIR)$(pkgdatadir)/include/gtkwave
-rmdir $(DESTDIR)$(pkgdatadir)/include/fstcpp
-rmdir $(DESTDIR)$(pkgdatadir)/include/vltstd
-rmdir $(DESTDIR)$(pkgdatadir)/include
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_hello_binary
@@ -417,7 +417,7 @@ CPPCHECK_FLAGS += --cppcheck-build-dir=$(CPPCHECK_CACHE)
CPPCHECK_FLAGS += -DVL_DEBUG=1 -DVL_CPPCHECK=1 -DINFILTER_PIPE=1 -D__GNUC__=1
CPPCHECK_FLAGS += -j$(CPPCHECK_JOBS)
CPPCHECK_INC = -I$(srcdir)/include
CPPCHECK_INC += -I$(srcdir)/include/gtkwave
CPPCHECK_INC += -I$(srcdir)/include/fstcpp
CPPCHECK_INC += -I$(srcdir)/include/vltstd
CPPCHECK_INC += -I$(srcdir)/src/obj_dbg
CPPCHECK_INC += -I$(srcdir)/src
@@ -444,7 +444,7 @@ cppcheck:
CLANGTIDY = clang-tidy
CLANGTIDY_FLAGS = -config='' \
-header-filter='.*' \
-checks='*,-abseil-*,-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \
-checks='*,-abseil-*,-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-do-while,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \
# Good checks: -checks='-*,bugprone-assignment-in-if-condition,google-build-using-namespace,google-readability-casting,modernize-use-default-member-init,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nullptr,performance-faster-string-find,readability-isolate-declaration,readability-redundant-control-flow,readability-redundant-member-init,readability-redundant-string-cstr,readability-uppercase-literal-suffix
@@ -467,9 +467,11 @@ analyzer-include:
# Bash/sh files
BASH_FILES = \
ci/ci-coverage-report.bash \
ci/ci-install.bash \
ci/ci-pages-notify.bash \
ci/ci-pages.bash \
ci/ci-rtlmeter-report.bash \
ci/ci-script.bash \
ci/docker/run/hooks/post_push \
ci/docker/run/verilator-docker \
@@ -496,6 +498,11 @@ MAKE_FILES = \
src/Makefile*.in \
test_regress/Makefile* \
# Markdown
MD_FILES = \
*.md \
*/*.md \
# Perl programs
PERL_PROGRAMS = \
bin/redirect \
@@ -532,15 +539,24 @@ PY_PROGRAMS = \
src/vlcovgen \
test_regress/*.py \
test_regress/t/*.pf \
test_regress/t/randomize_solver_tamper.py \
# Python files, subject to format but not lint
PY_FILES = \
$(PY_PROGRAMS) \
ci/*.py \
test_regress/t/*.py \
# Python files, test_regress tests
PY_TEST_FILES = test_regress/t/*.py
# reStructuredText Sphinx files
RST_FILES = \
*.rst \
*/*.rst \
ci/docker/*/*.rst \
docs/guide/*.rst \
# YAML files
YAML_FILES = \
.*.yaml \
@@ -553,7 +569,7 @@ YAML_FILES = \
# Format
format:
$(MAKE) -j 5 format-c format-cmake format-exec format-py format-yaml
$(MAKE) -j 5 format-c format-cmake format-exec format-md format-py format-rst format-yaml
BEAUTYSH = beautysh
BEAUTYSH_FLAGS = --indent-size 2
@@ -590,6 +606,13 @@ format-make mbake:
$(MBAKE) --version
$(MBAKE) $(MBAKE_FLAGS) $(MAKE_FILES)
MDFORMAT = mdformat
MDFORMAT_FLAGS =
format-md:
$(MDFORMAT) --version
$(MDFORMAT) $(MDFORMAT_FLAGS) $(MD_FILES)
YAPF = yapf
YAPF_FLAGS = -i --parallel
@@ -597,6 +620,13 @@ format-py yapf:
$(YAPF) --version
$(YAPF) $(YAPF_FLAGS) $(PY_FILES)
DOCSTRFMT = docstrfmt
DOCSTRFMT_FLAGS = --line-length 75 --indent-width 3 --keep-blanks --ordered-marker "\#" --preserve-adornments --no-center-section-titles
format-rst:
$(DOCSTRFMT) --version
$(DOCSTRFMT) $(DOCSTRFMT_FLAGS) $(RST_FILES)
YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=200 YAMLFIX_preserve_quotes=true yamlfix
YAMLFIX_FLAGS =
@@ -669,22 +699,30 @@ COVERAGE_DIR := obj_coverage
ifeq ($(CFG_WITH_DEV_GCOV),yes)
# Figure out base and head refs for coverage report
COVERAGE_REF_BASE := $(if $(COVERAGE_BASE),$(shell git rev-parse --short $(COVERAGE_BASE)))
COVERAGE_REF_BASE := $(if $(COVERAGE_BASE),$(shell git rev-parse --short $(COVERAGE_BASE) 2>/dev/null))
ifneq ($(COVERAGE_BASE),)
ifeq ($(COVERAGE_REF_BASE),)
$(error COVERAGE_BASE='$(COVERAGE_BASE)' is not a valid git revision)
endif
endif
COVERAGE_REF_HEAD := $(shell git rev-parse --short HEAD)
override undefine COVERAGE_BASE # Use the above variabels instead
# 'fastcov' setup
FASTCOV := nodist/fastcov.py
FASTCOV_OPT := -j $(shell nproc)
FASTCOV_OPT += --gcov $(GCOV)
FASTCOV_OPT += --lcov
FASTCOV_OPT += --process-gcno
FASTCOV_OPT += --branch-coverage
FASTCOV_OPT += --dump-statistic
# Files matching the following glob patterns will be excluded from coverage
FASTCOV_OPT += --exclude-glob
FASTCOV_OPT += '/usr/*'
FASTCOV_OPT += '/usr/include/*'
FASTCOV_OPT += '/usr/lib*/*'
FASTCOV_OPT += '/usr/share/*'
FASTCOV_OPT += '*examples/*'
FASTCOV_OPT += '*include/gtkwave/*'
FASTCOV_OPT += '*include/fstcpp/*'
FASTCOV_OPT += '*src/obj_dbg/*'
FASTCOV_OPT += '*src/obj_opt/*.yy.cpp'
FASTCOV_OPT += '*src/obj_opt/V3Ast*'
@@ -709,6 +747,7 @@ FASTCOV_OPT += BROKEN_RTN
FASTCOV_OPT += NUM_ASSERT
FASTCOV_OPT += SELF_CHECK
FASTCOV_OPT += UASSERT
FASTCOV_OPT += UDEBUGONLY
FASTCOV_OPT += UINFO
FASTCOV_OPT += assert
FASTCOV_OPT += 'if (VL_UNCOVERABLE'
@@ -723,6 +762,8 @@ GENHTML_OPT += --missed
GENHTML_OPT += --rc branch_coverage=1
GENHTML_OPT += --rc genhtml_hi_limit=100
GENHTML_OPT += --ignore-errors negative
GENHTML_OPT += --ignore-errors inconsistent
GENHTML_OPT += --ignore-errors empty
ifeq ($(COVERAGE_REF_BASE),)
GENHTML_OPT += --header-title "Code coverage for Verilator $(shell git describe --dirty)"
else
@@ -754,7 +795,7 @@ $(COVERAGE_DIR)/verilator-patch.info: $(COVERAGE_DIR)/verilator.info
@echo "####################################################################"
rm -f $(COVERAGE_DIR)/empty-patch
git diff $(COVERAGE_REF_BASE) -- include src > $(COVERAGE_DIR)/filter.patch
[ -s $(COVERAGE_DIR)/filter.patch ]] || touch $(COVERAGE_DIR)/empty-patch
[ -s $(COVERAGE_DIR)/filter.patch ] || touch $(COVERAGE_DIR)/empty-patch
$(FASTCOV) -C $^ --lcov -o $@ --diff-filter $(COVERAGE_DIR)/filter.patch
# Build coverage report
@@ -763,7 +804,7 @@ $(COVERAGE_DIR)/report/index.html: $(COVERAGE_DIR)/verilator$(if $(COVERAGE_REF_
@echo "# genhtml: Generating coverage report"
@echo "####################################################################"
@rm -rf $(COVERAGE_DIR)/report
[ -f $(COVERAGE_DIR)/empty-patch ]] || /usr/bin/time -f "That took %E" \
[ -f $(COVERAGE_DIR)/empty-patch ] || /usr/bin/time -f "That took %E" \
$(GENHTML) $(GENHTML_OPT) --output-directory $(COVERAGE_DIR)/report $^ || true
@# Uncommitted changes not tracked, force rebuild on next run if patch coverage
@$(if $(COVERAGE_REF_BASE),mv $(COVERAGE_DIR)/verilator-patch.info $(COVERAGE_DIR)/verilator-patch-last.info)
+51 -42
View File
@@ -1,58 +1,65 @@
.. Github doesn't render images unless absolute URL
.. Do not know of a conditional tag, "only: github" nor "github display" works
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
Github doesn't render images unless absolute URL
Do not know of a conditional tag, "only: github" nor "github display" works
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|badge1| |badge2| |badge3| |badge4| |badge5| |badge7| |badge8|
|badge1| |badge2| |badge3| |badge4| |badge5|
|badge7| |badge8|
.. |badge1| image:: https://img.shields.io/badge/Website-Verilator.org-181717.svg
:target: https://verilator.org
.. |badge2| image:: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/lgpl-3.0
.. |badge3| image:: https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg
:target: https://opensource.org/licenses/Artistic-2.0
.. |badge4| image:: https://repology.org/badge/tiny-repos/verilator.svg?header=distro%20packages
:target: https://repology.org/project/verilator/versions
.. |badge5| image:: https://img.shields.io/docker/pulls/verilator/verilator
:target: https://hub.docker.com/r/verilator/verilator
.. |badge7| image:: https://github.com/verilator/verilator/workflows/build/badge.svg
:target: https://github.com/verilator/verilator/actions?query=workflow%3Abuild
.. |badge7| image:: https://img.shields.io/github/actions/workflow/status/verilator/verilator/regression.yml?branch=master&label=regression
:target: https://github.com/verilator/verilator/actions/workflows/regression.yml
.. |badge8| image:: https://img.shields.io/github/actions/workflow/status/verilator/verilator/rtlmeter.yml?branch=master&event=schedule&label=benchmarks
:target: https://verilator.github.io/verilator-rtlmeter-results
Welcome to Verilator
====================
.. list-table::
* - **Welcome to Verilator, the fastest Verilog/SystemVerilog simulator.**
* Accepts Verilog or SystemVerilog
* Performs lint code-quality checks
* Compiles into multithreaded C++, or SystemC
* Creates JSON to front-end your own tools
- - **Welcome to Verilator, the fastest Verilog/SystemVerilog simulator.**
- Accepts Verilog or SystemVerilog, including UVM
- Performs lint code-quality checks
- Compiles into multithreaded C++, or SystemC
- Creates JSON to front-end your own tools
- |Logo|
* - |verilator multithreaded performance|
- - |verilator multithreaded performance|
- **Fast**
* Outperforms many closed-source commercial simulators
* Single- and multithreaded output models
* - **Widely Used**
* Wide industry and academic deployment
* Out-of-the-box support from Arm and RISC-V vendor IP
* Over 700 contributors
- Outperforms many closed-source commercial simulators
- Single- and multithreaded output models
- - **Widely Used**
- Wide industry and academic deployment
- Out-of-the-box support from Arm and RISC-V vendor IP
- Over 700 contributors
- |verilator usage|
* - |verilator community|
- - |verilator community|
- **Community Driven & Openly Licensed**
* Guided by the `CHIPS Alliance`_ and `Linux Foundation`_
* Open, and free as in both speech and beer
* More simulation for your verification budget
* - **Commercial Support Available**
* Commercial support contracts
* Design support contracts
* Enhancement contracts
- Guided by the `CHIPS Alliance`_ and `Linux Foundation`_
- Open, and free as in both speech and beer
- More simulation for your verification budget
- - **Commercial Support Available**
- Commercial support contracts
- Design support contracts
- Enhancement contracts
- |verilator support|
What Verilator Does
===================
@@ -68,15 +75,14 @@ instantiate the model. The resulting Verilated executable performs the
design simulation. Verilator also supports linking Verilator-generated
libraries, optionally encrypted, into other simulators.
Verilator supports all design constructs, most verification constructs,
intra-assignment delays (e.g, `#10`), and events. Tristate-bus (`z`) and
unknowns (`x`) are handled in limited contexts, in a special manor for
performance. It currently may not be the best choice if you are expecting a
full-featured replacement for a closed-source Verilog simulator, performing
SDF annotation, or mixed-signal simulation. However, if you are looking for
a path to migrate SystemVerilog to C++/SystemC, or want high-speed
simulation, Verilator is the tool for you.
Verilator supports all design constructs, most verification constructs
including UVM, intra-assignment delays (e.g, `#10`), and events.
Tristate-bus (`z`) and unknowns (`x`) are handled in limited contexts, in a
special manor for performance. It currently may not be the best choice if
you are expecting a full-featured replacement for a closed-source Verilog
simulator, performing SDF annotation, or mixed-signal simulation. However,
if you are looking for a path to migrate SystemVerilog to C++/SystemC, or
want high-speed simulation, Verilator is the tool for you.
Performance
===========
@@ -96,7 +102,6 @@ Mentor ModelSim/Questa, Synopsys VCS, VTOC, and Pragmatic CVer/CVC). But,
Verilator is open-sourced, so you can spend on computes rather than
licenses. Thus, Verilator gives you the best simulation cycles/dollar.
Installation & Documentation
============================
@@ -115,7 +120,6 @@ For more information:
- `Verilator issues <https://verilator.org/issues>`_
Support
=======
@@ -132,7 +136,6 @@ Verilator also supports and encourages commercial support models and
organizations; please see `Verilator Commercial Support
<https://verilator.org/verilator_commercial_support>`_.
Related Projects
================
@@ -149,7 +152,6 @@ Related Projects
- `Surfer <https://surfer-project.org/>`_ - Web or offline waveform viewer
for Verilator traces.
Open License
============
@@ -161,10 +163,17 @@ the terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0. See the documentation for more details.
.. _chips alliance: https://chipsalliance.org
.. _icarus verilog: https://steveicarus.github.io/iverilog
.. _linux foundation: https://www.linuxfoundation.org
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png
.. |verilator multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png
.. |verilator usage| image:: https://www.veripool.org/img/verilator_usage_400x200-min.png
.. |verilator community| image:: https://www.veripool.org/img/verilator_community_400x125-min.png
.. |verilator support| image:: https://www.veripool.org/img/verilator_support_400x125-min.png
+1 -1
View File
@@ -4,9 +4,9 @@ version = 1
[[annotations]]
path = [
"**/.clang-format",
"**/.gitattributes",
"**/.gitignore",
".clang-format",
".clang-tidy",
".codacy.yml",
".devcontainer/devcontainer.json",
+83 -30
View File
@@ -101,9 +101,15 @@ if (defined $ENV{VERILATOR_ROOT}) {
$ENV{VERILATOR_ROOT} = $verilator_root;
}
if ($opt_gdbbt && !gdb_works()) {
warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
$opt_gdbbt = 0;
my $lldb_selected = 0;
if (($opt_gdb || $opt_gdbbt) && !gdb_works()) {
if (lldb_works()) {
$lldb_selected = 1;
} else {
warn "-Info: --gdb or --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
$opt_gdbbt = 0;
$opt_gdb = 0;
}
}
# Determine runtime flags and run
@@ -113,22 +119,35 @@ if ($opt_gdbbt && !gdb_works()) {
# then see exactly the contents of @Opt_Verilator_Sw.
my @quoted_sw = map { sh_escape($_) } @Opt_Verilator_Sw;
if ($opt_gdb) {
# Generic GDB interactive
run (ulimit_stack_unlimited()
. aslr(0)
. ($ENV{VERILATOR_GDB} || "gdb")
. " " . verilator_bin()
# Note, uncomment to set breakpoints before running:
# ." -ex 'break main'"
# Note, we must use double-quotes ("run <switches>")
# and not single ('run <switches>') below. Bash swallows
# escapes as you would expect in a double-quoted string.
# That's not true for a single-quoted string, where \'
# actually terminates the string -- not what we want!
. " -ex \"run " . join(' ', @quoted_sw) . "\""
. " -ex 'set width 0'"
. " -ex 'bt'");
# Note, we must use double-quotes ("run <switches>")
# and not single ('run <switches>') below. Bash swallows
# escapes as you would expect in a double-quoted string.
# That's not true for a single-quoted string, where \'
# actually terminates the string -- not what we want!
if ($lldb_selected) {
# Generic lldb interactive
run (ulimit_stack_unlimited()
. aslr(0)
. ($ENV{VERILATOR_GDB} || "lldb")
. " " . verilator_bin()
# Note, uncomment to set breakpoints before running:
# . " -o 'b main'"
. " -o 'b exit'" # Need break to keep process active for bt
. " -o \"run " . join(' ', @quoted_sw) . "\""
. " -o 'settings set term-width 1024'"
. " -o 'bt'");
} else {
# Generic GDB interactive
run (ulimit_stack_unlimited()
. aslr(0)
. ($ENV{VERILATOR_GDB} || "gdb")
. " " . verilator_bin()
# Note, uncomment to set breakpoints before running:
# . " -ex 'break main'"
. " -ex \"run " . join(' ', @quoted_sw) . "\""
. " -ex 'set width 0'"
. " -ex 'bt'");
}
} elsif ($opt_rr) {
# Record with rr
run (ulimit_stack_unlimited()
@@ -136,15 +155,27 @@ if ($opt_gdb) {
. "rr record " . verilator_bin()
. " " . join(' ', @quoted_sw));
} elsif ($opt_gdbbt && $Debug) {
# Run under GDB to get gdbbt
run (ulimit_stack_unlimited()
. aslr(0)
. "gdb"
. " " . verilator_bin()
. " --batch --quiet --return-child-result"
. " -ex \"run " . join(' ', @quoted_sw)."\""
. " -ex 'set width 0'"
. " -ex 'bt' -ex 'quit'");
# Run under debugger to get gdbbt
if ($lldb_selected) {
run (ulimit_stack_unlimited()
. aslr(0)
. ($ENV{VERILATOR_GDB} || "lldb")
. " " . verilator_bin()
. " -o 'b exit'" # Need break to keep process active for bt
. " --batch --source-quietly"
. " -o \"run " . join(' ', @quoted_sw)."\""
. " -o 'settings set term-width 1024'"
. " -o 'bt' -o 'quit'");
} else {
run (ulimit_stack_unlimited()
. aslr(0)
. ($ENV{VERILATOR_GDB} || "gdb")
. " " . verilator_bin()
. " --batch --quiet --return-child-result"
. " -ex \"run " . join(' ', @quoted_sw)."\""
. " -ex 'set width 0'"
. " -ex 'bt' -ex 'quit'");
}
} elsif ($opt_valgrind) {
# Run under valgrind
my $valgrind_bin = ($ENV{VERILATOR_VALGRIND} || "valgrind --error-exitcode=1 --max-stackframe=2815880"
@@ -200,9 +231,9 @@ sub verilator_bin {
sub gdb_works {
$! = undef; # Cleanup -x
system("gdb /bin/echo"
system("gdb /bin/sh"
. " --batch-silent --quiet --return-child-result"
. " -ex 'run -n'" # `echo -n`
. " -ex 'run -c exit'" # `/bin/sh -c exit
. " -ex 'set width 0'"
. " -ex 'bt'"
. " -ex 'quit'");
@@ -210,6 +241,18 @@ sub gdb_works {
return $status == 0;
}
sub lldb_works {
$! = undef; # Cleanup -x
# macOS system integrity stops attach to system binaries like /bin/sh
system("lldb --version"
. " --batch --source-quietly"
. " -o 'settings set term-width 1024'"
. " -o 'bt'"
. " -o 'quit'");
my $status = $?;
return $status == 0;
}
sub aslr {
my $want_on = shift;
$want_on = $opt_aslr if defined $opt_aslr;
@@ -357,6 +400,7 @@ detailed descriptions of these arguments.
--no-aslr Disable address space layout randomization
--no-assert Disable all assertions
--no-assert-case Disable unique/unique0/priority-case assertions
--assert-unroll-limit <iter> Max SVA assertion repetition before erroring
--autoflush Flush streams after all $displays
--bbox-sys Blackbox unknown $system calls
--bbox-unsup Blackbox unsupported language features
@@ -375,7 +419,10 @@ detailed descriptions of these arguments.
--coverage-expr-max <value> Maximum permutations allowed for an expression
--coverage-fsm Enable FSM state/arc coverage
--coverage-line Enable line coverage
--coverage-max-bins <value> Maximum bins of an integral coverpoint bins declaration
--coverage-max-real-bins <value> Maximum bins of a real coverpoint bins declaration
--coverage-max-width <width> Maximum array depth for coverage
--coverage-per-instance Enable per-instance coverage counters
--coverage-toggle Enable toggle coverage
--coverage-underscore Enable coverage of _signals
--coverage-user Enable SVL user coverage
@@ -393,6 +440,7 @@ detailed descriptions of these arguments.
--diagnostics-sarif-output <filename> Set SARIF diagnostics output file
--dpi-hdr-only Only produce the DPI header file
--dump-<srcfile> Enable dumping everything in source file
--dump-ast-patterns Enable dumping Ast pattern statistics
--dump-defines Show preprocessor defines with -E
--dump-dfg Enable dumping DfgGraphs to .dot files
--dump-dfg-patterns Enable dumping Dfg pattern statistics
@@ -416,6 +464,8 @@ detailed descriptions of these arguments.
-f <file> Parse arguments from a file
-FI <file> Force include of a file
--flatten Force inlining of all modules, tasks and functions
--fourstate Enable fourstate logic
--no-fourstate Disable fourstate logic
--func-recursion-depth <value> Maximum recursive constant function depth
--future0 <option> Ignore an option for compatibility
--future1 <option> Ignore an option with argument for compatibility
@@ -588,11 +638,13 @@ description of these arguments.
=for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst"
+verilator+assert+lock Lock assertion status changes at startup
+verilator+coverage+file+<filename> Set coverage output filename
+verilator+debug Enable debugging
+verilator+debugi+<value> Enable debugging at a level
+verilator+error+limit+<value> Set error limit
+verilator+help Show help
+verilator+log+file+<filename> Log stdout and stderr output to filename
+verilator+noassert Disable assert checking
+verilator+prof+exec+file+<filename> Set execution profile filename
+verilator+prof+exec+start+<value> Set execution profile starting point
@@ -604,6 +656,7 @@ description of these arguments.
+verilator+solver+file+<filename> Set random solver log filename
+verilator+V Show verbose version and config
+verilator+version Show version and exit
+verilator+vpi+<library>[:<bootstrap>] Load VPI shared library
+verilator+wno+unsatconstr+<value> Disable constraint warnings
+6
View File
@@ -157,6 +157,10 @@ verilator_coverage - Verilator coverage analyzer
verilator_coverage --annotate <obj>
verilator_coverage --report summary,hier <datafiles>...
verilator_coverage --report hier <datafiles>...
verilator_coverage -write merged.dat <datafiles>...
verilator_coverage -write-info merged.info <datafiles>...
@@ -176,7 +180,9 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
--filter-type <regex> Keep only records of given coverage type.
--help Displays this message and version and exits.
--include-reset-arcs Include reset arcs in FSM arc summaries.
--levels <depth> Limit displayed hierarchy report depth.
--rank Compute relative importance of tests.
--report <kind>[,<kind>...] Generate reports: summary, hier, or hierarchy.
--unlink With --write, unlink all inputs
--version Displays program version and exits.
--write <filename> Write aggregate coverage results.
+7 -2
View File
@@ -51,12 +51,17 @@ def profcfunc(filename: str) -> None:
# Find modules
verilated_mods = {}
for func in funcs:
match = re.search(r'(.*)::eval(_step)?\(', func)
# Match only the model entry points: 'eval', 'eval_step', 'eval_end_step',
# and the 'evalXxx' region entry points, but not e.g. a user's '::evaluate'
match = re.match(r'([A-Za-z_][A-Za-z_0-9]*)::eval(_step|_end_step|[A-Z][A-Za-z_0-9]*)?\(',
func)
if match:
prefix = match.group(1)
if prefix.startswith('Verilated'): # Run-time library, not a model
continue
if Args.debug:
print("-got _eval %s prefix=%s" % (func, prefix))
verilated_mods[prefix] = re.compile(r'^' + prefix)
verilated_mods[prefix] = re.compile(r'^' + re.escape(prefix))
# pprint(verilated_mods)
# Sort by Verilog name
+103
View File
@@ -0,0 +1,103 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI build job script
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
# Executed in the 'build' stage.
################################################################################
# Destructive to the checkout (reconfigures and rebuilds); never run locally
if [ "$GITHUB_ACTIONS" != "true" ]; then
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
exit 1
fi
set -e
set -x
source "$(dirname "$0")/ci-common.bash"
################################################################################
# Parse arguments
OPT_ASAN=0
OPT_CCWARN=0
OPT_GCOV=0
OPT_LIGHT_DEBUG=0
OPT_COMPILER=
OPT_PREFIX=
while [ $# -gt 0 ]; do
case "$1" in
--asan) OPT_ASAN=1 ;;
--ccwarn) OPT_CCWARN=1 ;;
--compiler)
[ $# -ge 2 ] || fatal "--compiler requires an argument"
OPT_COMPILER="$2"
shift
;;
--gcov) OPT_GCOV=1 ;;
--light-debug) OPT_LIGHT_DEBUG=1 ;;
--prefix)
[ $# -ge 2 ] || fatal "--prefix requires an argument"
OPT_PREFIX="$2"
shift
;;
*) fatal "Unknown option: '$1'" ;;
esac
shift
done
[ -n "$OPT_COMPILER" ] || fatal "--compiler is required"
[ -n "$OPT_PREFIX" ] || fatal "--prefix is required"
# Map the compiler name to the executable name configure CXX expects
case "$OPT_COMPILER" in
clang) CXX=clang++ ;;
gcc) CXX=g++ ;;
*) fatal "Unknown compiler: '$OPT_COMPILER'" ;;
esac
################################################################################
# Configure
CONFIGURE_ARGS="--prefix=$OPT_PREFIX --enable-longtests"
if [ "$OPT_CCWARN" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-ccwarn"
fi
if [ "$OPT_ASAN" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-asan"
CXX="$CXX -DVL_LEAK_CHECKS"
# Replaces VNUser's union with a std::variant to validate type usage.
# Only takes effect when the build is C++17 or newer.
CXX="$CXX -DVL_USER_TYPE_CHECKS"
fi
if [ "$OPT_GCOV" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-gcov"
fi
if [ "$OPT_LIGHT_DEBUG" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-light-debug"
fi
if [ "$(uname -s)" = Darwin ]; then
# Force the use of the Homebrew flex over the one included as part of the
# Apple SDK that's preinstalled on the MacOS Github Action runners.
FLEX_PREFIX=$(brew --prefix flex)
export LEX="$FLEX_PREFIX/bin/flex"
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I$FLEX_PREFIX/include"
fi
autoconf
./configure $CONFIGURE_ARGS CXX="$CXX"
################################################################################
# Build
ccache -z
BUILD_START=$SECONDS
"$MAKE" -j "$NPROC" -k
# Second make to get failures at bottom, to avoid needing to
# scroll up GitHub action logs (to see first errors half-way up)
"$MAKE" -j "$NPROC" -k
ccache -svv
ccache --evict-older-than "$((SECONDS - BUILD_START + 60))s"
ccache -svv
+35
View File
@@ -0,0 +1,35 @@
# DESCRIPTION: Verilator: CI common definitions, sourced by the stage scripts
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
# Common definitions sourced by the CI stage scripts; not executed directly.
################################################################################
fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
}
case "$(uname -s)" in
Linux)
HOST_OS=linux
MAKE=make
NPROC=$(nproc)
# Distro id/version; subshell keeps os-release out of our namespace
if [ -r /etc/os-release ]; then
DISTRO_ID=$(. /etc/os-release; echo "$ID")
DISTRO_VERSION=$(. /etc/os-release; echo "$VERSION_ID")
fi
;;
Darwin)
HOST_OS=macOS
MAKE=make
NPROC=$(sysctl -n hw.logicalcpu)
;;
*)
fatal "Unknown host OS: '$(uname -s)'"
;;
esac
export MAKE
+133
View File
@@ -0,0 +1,133 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI script for 'coverage.yml' results
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# This script combines the code coverage data gathered by the test jobs into
# the HTML report published on GitHub Pages, and for a pull request, builds the
# content of the response comment posted on it.
# Developer note: You should be able to run this script in your local checkout
# if you have GitHub CLI (command 'gh') setup, authenticated ('gh auth login'),
# and have set a default repository ('gh repo set-default').
set -eo pipefail
# Trace when running in the CI
[ "$GITHUB_ACTIONS" != "true" ] || set -x
# Arguments:
# 1. run ID
# 2. number of the pull request, or empty for a non-pull-request run
# 3. base SHA of the pull request (pull requests only)
# 4. head SHA of the pull request (pull requests only)
RUN_ID=$1
PR_NUMBER=$2
PR_BASE_SHA=$3
PR_HEAD_SHA=$4
# Coverage data and report directory, uploaded as the 'coverage-report' artifact
COVERAGE_DIR=obj_coverage
ls -lsha ${COVERAGE_DIR}
# Combine the reports from the test jobs
nodist/fastcov.py -C ${COVERAGE_DIR}/verilator-*.info --lcov -o ${COVERAGE_DIR}/verilator.info
# Create the report. For a pull request, report patch coverage against the
# merge-base between the head of the pull request and the target branch. The
# summary quoted in the notification below is only in the log of 'make'.
MAKE_LOG=make-coverage-report.log
if [ -n "${PR_NUMBER}" ]; then
COVERAGE_BASE=$(git rev-parse --short $(git merge-base ${PR_BASE_SHA} ${PR_HEAD_SHA}))
make coverage-report COVERAGE_BASE=${COVERAGE_BASE} |& tee ${MAKE_LOG}
else
make coverage-report
fi
# Remove the data files, only the HTML report is published
rm -f ${COVERAGE_DIR}/verilator*.info
# The rest is for pull requests only
if [ -z "${PR_NUMBER}" ]; then
exit 0
fi
# Get some metadata about the run
RUN_NUM=$(gh run view ${RUN_ID} --json number --jq ".number")
RUN_URL=$(gh run view ${RUN_ID} --json url --jq ".url")
# Repository owner and name of the default repository, used to build the
# GitHub Pages URL of the report. The owner is lowercased, as required for the
# '<owner>.github.io' Pages domain.
PAGES_OWNER=$(gh repo view --json owner --jq '.owner.login' | tr '[:upper:]' '[:lower:]')
PAGES_NAME=$(gh repo view --json name --jq '.name')
REPORT_URL=https://${PAGES_OWNER}.github.io/${PAGES_NAME}/coverage-reports/${RUN_ID}/index.html
###############################################################################
# Create the PR notification
###############################################################################
NOTIFICATION_DIR=notification
mkdir -p ${NOTIFICATION_DIR}
cat > ${NOTIFICATION_DIR}/body.txt <<NOTIFICATION_TEMPLATE
Patch coverage from PR workflow [#${RUN_NUM}](${RUN_URL}) (code coverage of lines changed relative to ${COVERAGE_BASE}):
NOTIFICATION_TEMPLATE
if [ -f ${COVERAGE_DIR}/empty-patch ]; then
# Patch is empty
cat >> ${NOTIFICATION_DIR}/body.txt <<SUMMARY_TEMPLATE
Patch contains no code changes
SUMMARY_TEMPLATE
echo "Workflow [#${RUN_NUM}](${RUN_URL}): patch contains no code changes" > ${NOTIFICATION_DIR}/hist.txt
else
# Patch contains code changes
cat >> ${NOTIFICATION_DIR}/body.txt <<SUMMARY_TEMPLATE
<pre>
$(grep -E "(lines|branches)\.*:" ${MAKE_LOG} | sed "s/\.*:/:/" || true)
</pre>
Report: [${RUN_ID}](${REPORT_URL})
Please get to 100% line coverage, and understand all branches; see the [developer docs](https://github.com/verilator/verilator/blob/master/docs/internals.rst#code-coverage-results)
SUMMARY_TEMPLATE
echo "Workflow [#${RUN_NUM}](${RUN_URL}) report: [${RUN_ID}](${REPORT_URL})" > ${NOTIFICATION_DIR}/hist.txt
fi
###############################################################################
# Create the coverage status
###############################################################################
# 'pr-automation.yml' labels the pull request from this. Note it is only
# written when the coverage could actually be determined, so that a report we
# could not read leaves the labels of the pull request alone.
if [ -f ${COVERAGE_DIR}/empty-patch ]; then
# Nothing to cover, so count it as covered
COVERED=true
else
# Take the counts, and not the percentage, which is rounded. The line reads
# for example " lines......: 100.00% (60 of 60 lines)"
COUNTS=$(sed -nE 's/^ *lines\.*: *[0-9.]+% \(([0-9]+) of ([0-9]+) lines\).*/\1 \2/p' \
${MAKE_LOG} | tail -n 1)
HIT=${COUNTS%% *}
TOTAL=${COUNTS##* }
if [ -z "${TOTAL}" ]; then
echo "Could not read the line coverage from ${MAKE_LOG}" >&2
COVERED=
elif [ "${HIT}" = "${TOTAL}" ]; then
COVERED=true
else
COVERED=false
fi
fi
if [ -n "${COVERED}" ]; then
echo "Line coverage complete: ${COVERED}"
echo "${COVERED}" > coverage-status.txt
fi
+161 -91
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI dependency install script
#
# SPDX-FileCopyrightText: 2020 Geza Lore
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
@@ -10,141 +10,211 @@
# required by the particular build stage.
################################################################################
# Installs system packages with sudo; never run locally
if [ "$GITHUB_ACTIONS" != "true" ]; then
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
exit 1
fi
set -e
set -x
cd $(dirname "$0")/..
# Avoid occasional cpan failures "Issued certificate has expired."
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
echo "check_certificate = off" >> ~/.wgetrc
source "$(dirname "$0")/ci-common.bash"
fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
################################################################################
# Parse arguments
# Which stage to install dependencies for
STAGE="$1"
################################################################################
# Install dependencies
if [ "$HOST_OS" = "macOS" ]; then
# The macos runner image ships an untrusted third-party tap we don't use;
# untap it so brew stops emitting a tap-trust warning. Force + '|| true' since
# untap fails if a formula was installed from it, which is harmless here.
brew untap --force aws/tap || true
fi
# Run 'sudo apt-get', with timeout, retrying if failed
apt-get-retry() {
local _attempt
for _attempt in 1 2 3; do
[ "$_attempt" -eq 1 ] || sleep $((15 * _attempt))
sudo timeout --kill-after=30s 5m env DEBIAN_FRONTEND=noninteractive \
apt-get -o DPkg::Lock::Timeout=60 "$@" && return 0
done
fatal "'apt-get $*' failed on all attempts"
}
if [ "$CI_OS_NAME" = "linux" ]; then
MAKE=make
elif [ "$CI_OS_NAME" = "osx" ]; then
MAKE=make
elif [ "$CI_OS_NAME" = "freebsd" ]; then
MAKE=gmake
else
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
fi
if [ "$CI_OS_NAME" = "linux" ]; then
# Avoid slow "processing triggers for man db"
echo "path-exclude /usr/share/doc/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/man/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude /usr/share/info/*" | sudo tee -a /etc/dpkg/dpkg.cfg.d/01_nodoc
fi
# Run 'brew', retrying if failed
brew-retry() {
local _attempt
for _attempt in 1 2 3; do
[ "$_attempt" -eq 1 ] || sleep $((15 * _attempt))
brew "$@" && return 0
done
fatal "'brew $*' failed on all attempts"
}
install-wavediff() {
source ci/docker/buildenv/wavetools.conf
local _base_url="https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}"
local _platform
if [ "$CI_OS_NAME" = "linux" ]; then
if [ "$HOST_OS" = "linux" ]; then
_platform="linux-x86_64"
elif [ "$CI_OS_NAME" = "osx" ]; then
elif [ "$HOST_OS" = "macOS" ]; then
_platform="macos-arm64"
elif [ "$CI_OS_NAME" = "windows" ]; then
_platform="windows-x86_64"
else
echo "WARNING: No wavetools binary available for CI_OS_NAME=$CI_OS_NAME, skipping"
echo "WARNING: No wavetools binary available for HOST_OS=$HOST_OS, skipping"
return 0
fi
local _tmpdir
_tmpdir=$(mktemp -d)
local _archive="wavetools-${WAVETOOLS_VERSION}-${_platform}"
if [ "$CI_OS_NAME" = "windows" ]; then
wget -q -O "${_tmpdir}/${_archive}.zip" "${_base_url}/${_archive}.zip"
unzip -o "${_tmpdir}/${_archive}.zip" -d "${_tmpdir}"
else
wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz"
tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}"
fi
wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz"
tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}"
sudo cp "${_tmpdir}/${_archive}/wavediff" /usr/local/bin/wavediff
rm -rf "${_tmpdir}"
}
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
if [ "$STAGE" = "build" ]; then
##############################################################################
# Dependencies of jobs in the 'build' stage, i.e.: packages required to
# build Verilator
if [ "$CI_OS_NAME" = "linux" ]; then
sudo apt-get update ||
sudo apt-get update
sudo apt-get install --yes ccache help2man libfl-dev ||
sudo apt-get install --yes ccache help2man libfl-dev
if [[ ! "$CI_RUNS_ON" =~ "ubuntu-22.04" ]]; then
# Some conflict of libunwind verison on 22.04, can live without it for now
sudo apt-get install --yes libjemalloc-dev ||
sudo apt-get install --yes libjemalloc-dev
fi
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
if [[ ! "$CI_RUNS_ON" =~ "-riscv" ]]; then
sudo apt-get install --yes libsystemc libsystemc-dev ||
sudo apt-get install --yes libsystemc libsystemc-dev
if [ "$HOST_OS" = "linux" ]; then
if [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
bear
ccache
help2man
libfl-dev
libsystemc-dev
mold
)
# libunwind conflict on 22.04, can live without libjemalloc there
if [ "$DISTRO_VERSION" != "22.04" ]; then
PACKAGES+=(libjemalloc-dev)
fi
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
sudo apt-get install --yes bear mold ||
sudo apt-get install --yes bear mold
fi
elif [ "$CI_OS_NAME" = "osx" ]; then
brew update ||
brew update
brew install ccache perl gperftools autoconf bison flex help2man ||
brew install ccache perl gperftools autoconf bison flex help2man
elif [ "$CI_OS_NAME" = "freebsd" ]; then
sudo pkg install -y autoconf bison ccache gmake perl5
elif [ "$HOST_OS" = "macOS" ]; then
PACKAGES=(
autoconf
bison
ccache
flex
gperftools
help2man
perl
)
brew-retry update
brew-retry install "${PACKAGES[@]}"
else
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
fatal "Unknown HOST_OS: '$HOST_OS'"
fi
if [ -n "$CCACHE_DIR" ]; then
mkdir -p "$CCACHE_DIR"
fi
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
elif [ "$STAGE" = "test" ]; then
##############################################################################
# Dependencies of jobs in the 'test' stage, i.e.: packages required to
# run the tests
if [ "$CI_OS_NAME" = "linux" ]; then
sudo apt-get update ||
sudo apt-get update
# libfl-dev needed for internal coverage's test runs
sudo apt-get install --yes gdb gtkwave lcov libfl-dev ccache jq z3 ||
sudo apt-get install --yes gdb gtkwave lcov libfl-dev ccache jq z3
# Required for test_regress/t/t_dist_attributes.py
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
sudo apt-get install --yes python3-clang mold ||
sudo apt-get install --yes python3-clang mold
if [ "$HOST_OS" = "linux" ]; then
if [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
ccache
gdb
jq
lcov
libfl-dev
libsystemc-dev
mold
python3-clang
z3
)
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
if [[ "$CI_RUNS_ON" =~ "ubuntu-22.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-24.04" ]] || [[ "$CI_RUNS_ON" =~ "ubuntu-26.04" ]]; then
if [[ ! "$CI_RUNS_ON" =~ "-riscv" ]]; then
sudo apt-get install --yes libsystemc libsystemc-dev ||
sudo apt-get install --yes libsystemc libsystemc-dev
fi
fi
elif [ "$CI_OS_NAME" = "osx" ]; then
brew update
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
brew install ccache perl jq z3
elif [ "$CI_OS_NAME" = "freebsd" ]; then
# fst2vcd fails with "Could not open '<input file>', exiting."
sudo pkg install -y ccache gmake perl5 python3 jq z3
elif [ "$HOST_OS" = "macOS" ]; then
PACKAGES=(
ccache
jq
perl
z3
)
brew-retry update
brew-retry install "${PACKAGES[@]}"
else
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
fatal "Unknown HOST_OS: '$HOST_OS'"
fi
# Common installs
install-wavediff
# Workaround -fsanitize=address crash
sudo sysctl -w vm.mmap_rnd_bits=28
elif [ "$STAGE" = "lint-py" ]; then
##############################################################################
# Dependencies for nodist/clang_check_attributes
if [ "$HOST_OS" = "linux" ] && [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
python3-clang # Not run, but importers are linted
)
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
elif [ "$STAGE" = "format" ]; then
##############################################################################
# Dependencies of 'make format'
if [ "$HOST_OS" = "linux" ] && [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
clang-format-18 # Version pinned, so all of CI formats alike
)
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
elif [ "$STAGE" = "coverage" ]; then
##############################################################################
# Dependencies of the coverage report job, which only collates what the
# 'test' stage jobs measured
if [ "$HOST_OS" = "linux" ] && [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
lcov
)
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
elif [ "$STAGE" = "rtlmeter-run" ]; then
##############################################################################
# Dependencies of the RTLMeter jobs, which compile and run designs with an
# already built Verilator, so they need its runtime prerequisites only
if [ "$HOST_OS" = "linux" ] && [ "$DISTRO_ID" = "ubuntu" ]; then
PACKAGES=(
ccache
libfl-dev
libjemalloc-dev
libsystemc-dev
mold
)
apt-get-retry update
apt-get-retry install --yes "${PACKAGES[@]}"
fi
else
##############################################################################
# Unknown build stage
fatal "Unknown CI_BUILD_STAGE_NAME: '$CI_BUILD_STAGE_NAME'"
fatal "Unknown stage '$STAGE'"
fi
# Report where the tools we may have installed live (ok if some are missing)
set +x
echo "Tools:"
for bin in autoconf bear bison ccache flex gdb help2man jq lcov mold perl wavediff z3; do
echo -n " $bin: "
which "$bin" || echo "Not found"
done
+141 -16
View File
@@ -4,39 +4,164 @@
# SPDX-FileCopyrightText: 2025 Geza Lore
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# Notify PRs via comment that their coverage reports are available
# Notify PRs via comment that their workflow reports are available
# Get the current repo URL - might differ on a fork
readonly REPO_URL=$(gh repo view --json url --jq .url)
# Note this deliberately does not 'set -e'. A run that cannot be notified, say
# because its pull request was locked, must not hold up the notification of all
# the others, so each failure below moves on to the next run instead. Its
# artifact is then left in place, so it is retried on the next run of 'pages.yml'.
# The account we post as, which is how we tell our own earlier notifications
# from anybody else's comments. 'pages.yml' sets this to the slug of the app the
# token belongs to. Set it to your own login when running this by hand. The 'jq'
# filter below picks it up from the environment.
if [ -z "${GH_AUTHOR:-}" ]; then
echo "GH_AUTHOR must hold the account we post as" >&2
exit 1
fi
echo "Posting as '${GH_AUTHOR}'"
# Marker line separating the report from the history of the older reports
readonly HISTORY_MARKER='<!-- Verilator CI notification history -->'
# Opening line of the HTML comment stashing the history entry of the report
# itself. It is not shown in its own history, only inherited by the ones
# superseding it, hence it is kept out of sight until then.
readonly NEXTHIST_MARKER='<!-- Verilator CI notification entry'
# Create artifacts root directory
ARTIFACTS_ROOT=artifacts
mkdir -p ${ARTIFACTS_ROOT}
for RUN_ID in ${COVERAGE_PR_RUN_IDS//,/ }; do
echo "@@@ Processing run ${RUN_ID}"
for RUN_ID in ${PR_RUN_IDS//,/ }; do
# Create workflow artifacts directory
ARTIFACTS_DIR=${ARTIFACTS_ROOT}/${RUN_ID}
mkdir -p ${ARTIFACTS_DIR}
# Download artifact of this run, if exists
gh run download ${RUN_ID} --name coverage-pr-notification --dir ${ARTIFACTS_DIR} || true
ls -lsha ${ARTIFACTS_DIR}
gh run download ${RUN_ID} --name pr-notification --dir ${ARTIFACTS_DIR} &> /dev/null || true
# Move on if no notification is required
if [ ! -f ${ARTIFACTS_DIR}/pr-number.txt ]; then
echo "No notification found"
continue
fi
echo "Posting notification found"
cat ${ARTIFACTS_DIR}/body.txt
gh pr comment $(cat ${ARTIFACTS_DIR}/pr-number.txt) --body-file ${ARTIFACTS_DIR}/body.txt
PR_NUMBER=$(cat ${ARTIFACTS_DIR}/pr-number.txt)
echo "@@@ Run ${RUN_ID}: notifying PR #${PR_NUMBER}"
# Get the artifact ID
ARTIFACT_ID=$(gh api "repos/{owner}/{repo}/actions/runs/${RUN_ID}/artifacts" --jq '.artifacts[] | select(.name == "coverage-pr-notification") | .id')
# Everything below is created and validated by the 'upload-pr-notification'
# action. Move on if this artifact was not made by it, e.g. it is left over
# from an earlier version of the CI, so it does not hold up the other runs.
for f in body.txt key.txt hist.txt; do
if [ ! -f ${ARTIFACTS_DIR}/${f} ]; then
echo "Notification has no '${f}'" >&2
continue 2 # Note: continues the enclosing 'RUN_ID' loop
fi
done
# Delete it, so we only notify once
gh api --method DELETE "repos/{owner}/{repo}/actions/artifacts/${ARTIFACT_ID}"
# 'key.txt' holds the key naming the source of the notification. It goes on the
# first line of the comment as an HTML comment, so it is invisible when
# rendered, and is used below to find the stale notifications with the same
# key, which are then superseded by the new one and deleted.
COMMENT_MARKER="<!-- Verilator CI notification: $(cat ${ARTIFACTS_DIR}/key.txt) -->"
# Find the stale notifications from the same source on this PR. That is, our
# own comments with the same marker on their first line. Oldest first, as
# returned by the API. An app posts as '<slug>[bot]', so drop that suffix to
# compare against the slug. Move on if they cannot be listed, as without them
# we would post a duplicate instead of superseding them.
if ! COMMENT_MARKER="${COMMENT_MARKER}" \
gh api --paginate "repos/{owner}/{repo}/issues/${PR_NUMBER}/comments" \
--jq '.[]
| select((.user.login | rtrimstr("[bot]")) == env.GH_AUTHOR)
| select((.body | split("\n") | .[0] | rtrimstr("\r")) == env.COMMENT_MARKER)
| {id, body}' > ${ARTIFACTS_DIR}/stale.json; then
echo "Failed to list the comments of PR #${PR_NUMBER}" >&2
continue
fi
# Inherit the history of the newest stale notification. There should only ever
# be one, and it holds the whole history anyway, as each notification inherits
# the history of the one it superseded. Any older ones are only deleted below.
STALE_COUNT=$(wc -l < ${ARTIFACTS_DIR}/stale.json)
if [ ${STALE_COUNT} -gt 1 ]; then
echo "Found ${STALE_COUNT} stale notifications, only the newest is inherited from"
fi
HISTORY=${ARTIFACTS_DIR}/history.txt
touch ${HISTORY}
if [ ${STALE_COUNT} -gt 0 ]; then
tail -n 1 ${ARTIFACTS_DIR}/stale.json | jq -r '.body' | tr -d '\r' > ${ARTIFACTS_DIR}/stale-body.txt
# Its own entry, stashed in an HTML comment
awk -v marker="${NEXTHIST_MARKER}" '
$0 == marker { inside = 1; next }
!inside { next }
$0 == "-->" { exit }
NF { print }
' ${ARTIFACTS_DIR}/stale-body.txt >> ${HISTORY}
# Followed by its history, without the enclosing '<details>' markup
awk -v marker="${HISTORY_MARKER}" '
$0 == marker { inside = 1; next }
!inside { next }
$0 == "<details>" || /^<summary>/ { next }
$0 == "</details>" { exit }
NF { print }
' ${ARTIFACTS_DIR}/stale-body.txt >> ${HISTORY}
fi
# Assemble the comment. Starts with the marker and the report.
COMMENT=${ARTIFACTS_DIR}/comment.txt
cat > ${COMMENT} <<COMMENT_TEMPLATE
${COMMENT_MARKER}
$(cat ${ARTIFACTS_DIR}/body.txt)
COMMENT_TEMPLATE
# Then the history inherited from the notifications this one supersedes, so
# the older reports remain reachable from the only remaining comment.
if [ -s ${HISTORY} ]; then
echo "History holds $(wc -l < ${HISTORY}) entries"
cat >> ${COMMENT} <<HISTORY_TEMPLATE
${HISTORY_MARKER}
<details>
<summary>PR history</summary>
$(cat ${HISTORY})
</details>
HISTORY_TEMPLATE
fi
# Finally this report's own history entry, stashed out of sight until a later
# notification inherits it.
cat >> ${COMMENT} <<NEXTHIST_TEMPLATE
${NEXTHIST_MARKER}
$(cat ${ARTIFACTS_DIR}/hist.txt)
-->
NEXTHIST_TEMPLATE
# Post it. Move on if this failed, without deleting anything below, otherwise
# the history held by the stale notifications would be lost.
if ! jq -Rs '{body: .}' ${COMMENT} \
| gh api --method POST "repos/{owner}/{repo}/issues/${PR_NUMBER}/comments" \
--input - > ${ARTIFACTS_DIR}/posted.json; then
echo "Failed to post this notification on PR #${PR_NUMBER}:" >&2
cat ${COMMENT} >&2
continue
fi
echo "Posted $(jq -r '.html_url' ${ARTIFACTS_DIR}/posted.json)"
# Delete the stale notifications, so only the new one remains
for COMMENT_ID in $(jq -r '.id' ${ARTIFACTS_DIR}/stale.json); do
echo "Deleting stale comment ${COMMENT_ID}"
gh api --method DELETE "repos/{owner}/{repo}/issues/comments/${COMMENT_ID}"
done
# Get the artifact IDs. Note there can be more than one artifact named
# 'pr-notification' for a single run, as the artifacts endpoint lists
# artifacts across all run attempts, and a re-run uploads a new one while
# keeping the previous attempt's artifact.
ARTIFACT_IDS=$(gh api "repos/{owner}/{repo}/actions/runs/${RUN_ID}/artifacts?name=pr-notification" --jq '.artifacts[].id')
# Delete them all, so we only notify once
for ARTIFACT_ID in ${ARTIFACT_IDS}; do
gh api --method DELETE "repos/{owner}/{repo}/actions/artifacts/${ARTIFACT_ID}"
done
done
+128 -27
View File
@@ -5,8 +5,7 @@
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# This scipt build the content of the GitHub Pages for the repository.
# Currently this only hosts code coverage reports, but it would be possible to
# add any other contents to the page in parallel here.
# Currently this hosts code coverage reports, and PR RTLMeter detailed reports.
# Developer note: You should be able to run this script in your local checkout
# if you have GitHub CLI (command 'gh') setup, authenticated ('gh auth login'),
@@ -25,6 +24,9 @@ if [[ -z "$GITHUB_OUTPUT" ]]; then
GITHUB_OUTPUT=github-output.txt
fi
# Run IDs of PR jobs processed
PR_RUN_IDS=""
# Populates ${PAGES_ROOT}/coverage-reports
compile_coverage_reports() {
# We will process all runs up to and including this date. This is chosen to be
@@ -33,16 +35,13 @@ compile_coverage_reports() {
# Gather all coverage workflow runs within the time window
gh run list -w coverage.yml --limit 1000 --created ">=${OLDEST}" --json "databaseId,event,status,conclusion,createdAt,number" > recentRuns.json
echo @@@ Recent runs:
jq "." recentRuns.json
# Select completd runs that were not cancelled or skipped, sort by descending run number
jq 'sort_by(-.number) | map(select(.status == "completed" and (.conclusion == "success" or .conclusion == "failure")))' recentRuns.json > completedRuns.json
echo @@@ Completed with success or failure:
jq "." completedRuns.json
echo "@@@ $(jq length completedRuns.json) of $(jq length recentRuns.json) runs since ${OLDEST} completed with success or failure"
# Create artifacts root directory
local ARTIFACTS_ROOT=artifacts
local ARTIFACTS_ROOT=artifacts-coverage
mkdir -p ${ARTIFACTS_ROOT}
# Create coverage reports root directory
@@ -53,9 +52,6 @@ compile_coverage_reports() {
local CONTENTS=contents.tmp
echo > ${CONTENTS}
# Run IDs of PR jobs processed
local PR_RUN_IDS=""
# Iterate over all unique event types that triggered the workflows
for EVENT in $(jq -r 'map(.event) | sort | unique | .[]' completedRuns.json); do
echo "@@@ Processing '${EVENT}' runs"
@@ -65,35 +61,24 @@ compile_coverage_reports() {
# For each worfklow run that was triggered by this event type
for RUN_ID in $(jq ".[] | select(.event == \"${EVENT}\") |.databaseId" completedRuns.json); do
echo "@@@ Processing run ${RUN_ID}"
# Extract the info of this run
jq ".[] | select(.databaseId == $RUN_ID)" completedRuns.json > workflow.json
jq "." workflow.json
# Record run ID of PR job
if [[ $EVENT == "pull_request" ]]; then
if [[ -z "$PR_RUN_IDS" ]]; then
PR_RUN_IDS="$RUN_ID"
else
PR_RUN_IDS="$PR_RUN_IDS,$RUN_ID"
fi
fi
[[ $EVENT != "pull_request" ]] || PR_RUN_IDS="$PR_RUN_IDS $RUN_ID"
# Create workflow artifacts directory
local ARTIFACTS_DIR=${ARTIFACTS_ROOT}/${RUN_ID}
mkdir -p ${ARTIFACTS_DIR}
# Download artifacts of this run, if exists
gh run download ${RUN_ID} --name coverage-report --dir ${ARTIFACTS_DIR} || true
ls -lsha ${ARTIFACTS_DIR}
gh run download ${RUN_ID} --name coverage-report --dir ${ARTIFACTS_DIR} &> /dev/null || true
# Move on if no coverage report is available
if [ ! -d ${ARTIFACTS_DIR}/report ]; then
echo "No coverage report found"
continue
fi
echo "Coverage report found"
echo "@@@ Run ${RUN_ID}: coverage report found"
# Emit section header
if [[ -n $EMIT_SECTION_HEADER ]]; then
@@ -148,7 +133,7 @@ CONTENTS_TEMPLATE
<body>
$(cat ${CONTENTS})
<h4>Assembled $(date --iso-8601=minutes --utc)</h1>
<h4>Assembled $(date --iso-8601=minutes --utc)</h4>
<body>
</html>
@@ -156,12 +141,128 @@ INDEX_TEMPLATE
# Report size
du -shc ${COVERAGE_ROOT}/*
}
# Set output
echo "coverage-pr-run-ids=${PR_RUN_IDS}" >> $GITHUB_OUTPUT
# Populates ${PAGES_ROOT}/rtlmeter-reports
compile_rtlmeter_reports() {
# We will process all runs up to and including this date. This is chosen to be
# slightly less than the artifact retention period for simplicity.
local OLDEST=$(date --date="28 days ago" --iso-8601=date)
# Gather all RTLMeter workflow runs within the time window
gh run list -w rtlmeter.yml --limit 1000 --created ">=${OLDEST}" --json "databaseId,event,status,conclusion,createdAt,number" > recentRuns.json
# Select completd runs that were not cancelled or skipped, sort by descending run number
jq 'sort_by(-.number) | map(select(.status == "completed" and (.conclusion == "success" or .conclusion == "failure")))' recentRuns.json > completedRuns.json
echo "@@@ $(jq length completedRuns.json) of $(jq length recentRuns.json) runs since ${OLDEST} completed with success or failure"
# Create artifacts root directory
local ARTIFACTS_ROOT=artifacts-rtlmeter
mkdir -p ${ARTIFACTS_ROOT}
# Create rtlmeter reports root directory
local RTLMETER_ROOT=${PAGES_ROOT}/rtlmeter-reports
mkdir -p ${RTLMETER_ROOT}
# Create index page contents fragment
local CONTENTS=contents.tmp
echo > ${CONTENTS}
# Iterate over all unique event types that triggered the workflows
for EVENT in $(jq -r 'map(.event) | sort | unique | .[]' completedRuns.json); do
echo "@@@ Processing '${EVENT}' runs"
# Emit section header if a report exists with this event type
EMIT_SECTION_HEADER=1
# For each worfklow run that was triggered by this event type
for RUN_ID in $(jq ".[] | select(.event == \"${EVENT}\") |.databaseId" completedRuns.json); do
# Extract the info of this run
jq ".[] | select(.databaseId == $RUN_ID)" completedRuns.json > workflow.json
# Record run ID of PR job
[[ $EVENT != "pull_request" ]] || PR_RUN_IDS="$PR_RUN_IDS $RUN_ID"
# Create workflow artifacts directory
local ARTIFACTS_DIR=${ARTIFACTS_ROOT}/${RUN_ID}
mkdir -p ${ARTIFACTS_DIR}
# Download artifacts of this run, if exists
gh run download ${RUN_ID} --name rtlmeter-report --dir ${ARTIFACTS_DIR} &> /dev/null || true
# Move on if no RTLMeter report is available
if [ ! -d ${ARTIFACTS_DIR}/report ]; then
continue
fi
echo "@@@ Run ${RUN_ID}: RTLMeter report found"
# Emit section header
if [[ -n $EMIT_SECTION_HEADER ]]; then
unset EMIT_SECTION_HEADER
echo "<h4>RTLMeter reports for '${EVENT}' runs:</h4>" >> ${CONTENTS}
fi
# Create pages subdirectory
mv ${ARTIFACTS_DIR}/report ${RTLMETER_ROOT}/${RUN_ID}
# Add index page content
local WORKFLOW_CREATED=$(jq -r '.createdAt' workflow.json)
local WOFKRLOW_NUMBER=$(jq -r '.number' workflow.json)
cat >> ${CONTENTS} <<CONTENTS_TEMPLATE
Run <a href="${RUN_ID}/index.html">#${WOFKRLOW_NUMBER}</a>
| GitHub: <a href="${REPO_URL}/actions/runs/${RUN_ID}">${RUN_ID}</a>
| started at: ${WORKFLOW_CREATED}
CONTENTS_TEMPLATE
if [ -e ${ARTIFACTS_DIR}/pr-number.txt ]; then
local PRNUMBER=$(cat ${ARTIFACTS_DIR}/pr-number.txt)
echo " | Pull request: <a href=\"${REPO_URL}/pull/${PRNUMBER}\">#${PRNUMBER}</a>" >> ${CONTENTS}
fi
echo "<br>" >> ${CONTENTS}
done
# Section break
if [[ -z "$EMIT_SECTION_HEADER" ]]; then
echo "<hr>" >> ${CONTENTS}
fi
done
# Write rtlmeter report index.html
cat > ${RTLMETER_ROOT}/index.html <<INDEX_TEMPLATE
<html>
<head>
<title>Verilator CI RTLMeter reports</title>
<style>
body {
font-family: courier, serif;
background-color: #f3f3f3;
a {
color: #008fd7;
}
}
</style>
</head>
<body>
$(cat ${CONTENTS})
<h4>Assembled $(date --iso-8601=minutes --utc)</h4>
<body>
</html>
INDEX_TEMPLATE
# Report size
du -shc ${RTLMETER_ROOT}/*
}
# Compilie coverage reports
compile_coverage_reports;
# Compile RTLMeter reports
compile_rtlmeter_reports;
# You can build any other content here to be put under ${PAGES_ROOT}
# Set output to all affected unique PR run IDs (comma separated, no trailing comma)
IDS=$(echo ${PR_RUN_IDS} | xargs -n1 | sort -u | paste -sd,)
echo "pr-run-ids=${IDS}" >> $GITHUB_OUTPUT
+226
View File
@@ -0,0 +1,226 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: RTLMeter cases to run in the rtlmeter.yml CI workflow
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
###############################################################################
# Defines the RTLMeter cases to run in CI. This is consumed by the 'start' job
# in rtlmeter.yml, which captures the printed JSON and feeds it to the run job
# matrices.
###############################################################################
import argparse
import json
# Cases to run for scheduled runs, keyyed by the 'run tag' used in rtlmeter.yml
# The associated priority is roughly the number of minutes it takes to run the
# job, the emitted job matrix will try to start longest jobs first.
# Cases to run for non-PR jobs (e.g.: nightly schedule)
# fmt: off
CASES = {
"gcc": [
("BlackParrot:1x1:*", 5),
("BlackParrot:2x2:*", 14),
("BlackParrot:4x4:*", 25),
("Caliptra:default:*", 19),
("HammerBlade:16x8:*", 5),
("HammerBlade:2x1:*", 3),
("HummingbirdV2-E203:default:*", 3),
("HummingbirdV2-E203:nodelay:*", 3),
("NVDLA:*", 29),
("OpenPiton:1x1:*", 4),
("OpenPiton:2x2:*", 7),
("OpenPiton:4x4:*", 10),
("OpenTitan:*", 16),
("Servant:qerv:*", 2),
("Servant:serv:*", 2),
("VeeR-EH1:asic:*", 4),
("VeeR-EH1:default:*", 6),
("VeeR-EH1:hiperf:*", 5),
("VeeR-EH2:asic:*", 13),
("VeeR-EH2:default:*", 6),
("VeeR-EH2:hiperf:*", 12),
("VeeR-EL2:asic:*", 4),
("VeeR-EL2:default:*", 4),
("VeeR-EL2:hiperf:*", 4),
("Vortex:mini:*", 3),
("Vortex:sane:*", 6),
("XiangShan:default-chisel3:* !*:linux", 31),
("XiangShan:default-chisel6:* !*:linux", 28),
("XiangShan:mini-chisel3:* !*:linux", 13),
("XiangShan:mini-chisel6:* !*:linux", 15),
("XuanTie-C906:*", 5),
("XuanTie-C910:*", 9),
("XuanTie-E902:*", 5),
("XuanTie-E906:*", 6),
],
"clang": [
("BlackParrot:1x1:*", 5),
("BlackParrot:2x2:*", 9),
("BlackParrot:4x4:*", 12),
("Caliptra:default:*", 16),
("HammerBlade:16x8:*", 4),
("HammerBlade:2x1:*", 2),
("HummingbirdV2-E203:default:*", 10),
("HummingbirdV2-E203:nodelay:*", 10),
("NVDLA:*", 28),
("OpenPiton:1x1:*", 5),
("OpenPiton:2x2:*", 6),
("OpenPiton:4x4:*", 8),
("OpenTitan:*", 10),
("Servant:qerv:phil", 17),
("Servant:serv:phil", 15),
("VeeR-EH1:asic:*", 6),
("VeeR-EH1:default:*", 8),
("VeeR-EH1:hiperf:*", 5),
("VeeR-EH2:asic:*", 9),
("VeeR-EH2:default:*", 8),
("VeeR-EH2:hiperf:*", 7),
("VeeR-EL2:asic:*", 4),
("VeeR-EL2:default:*", 5),
("VeeR-EL2:hiperf:*", 5),
("Vortex:mini:*", 3),
("Vortex:sane:*", 5),
("XiangShan:default-chisel3:* !*:linux", 21),
("XiangShan:default-chisel6:* !*:linux", 19),
("XiangShan:mini-chisel3:* !*:linux", 8),
("XiangShan:mini-chisel6:* !*:linux", 8),
("XuanTie-C906:*", 3),
("XuanTie-C910:*", 7),
("XuanTie-E902:*", 7),
("XuanTie-E906:*", 7),
],
"gcc-hier": [
("BlackParrot:1x1:*", 4),
("BlackParrot:2x2:*", 16),
("BlackParrot:4x4:*", 25),
("NVDLA:*", 25),
("OpenPiton:16x16:dhry", 16),
("OpenPiton:1x1:*", 4),
("OpenPiton:2x2:*", 4),
("OpenPiton:4x4:*", 4),
("OpenPiton:8x8:*", 6),
("XuanTie-C910:*", 7),
],
}
# fmt: on
# Cases to run for PR jobs
# fmt: off
CASES_PR = {
"gcc": [
("BlackParrot:1x1:*", 5),
("BlackParrot:4x4:*", 25),
("Caliptra:default:*", 19),
("HammerBlade:16x8:*", 5),
("HammerBlade:2x1:*", 3),
("NVDLA:*", 29),
("HummingbirdV2-E203:default:*", 3),
("HummingbirdV2-E203:nodelay:*", 3),
("OpenPiton:1x1:*", 4),
("OpenPiton:4x4:*", 10),
("OpenTitan:*", 16),
("Servant:qerv:*", 2),
("Servant:serv:*", 2),
("VeeR-EH1:asic:*", 4),
("VeeR-EH1:default:*", 6),
("VeeR-EH1:hiperf:*", 5),
("VeeR-EH2:asic:*", 13),
("VeeR-EH2:default:*", 6),
("VeeR-EH2:hiperf:*", 12),
("VeeR-EL2:asic:*", 4),
("VeeR-EL2:default:*", 4),
("VeeR-EL2:hiperf:*", 4),
("Vortex:mini:*", 3),
("Vortex:sane:*", 6),
("XiangShan:default-chisel3:* !*:linux", 31),
("XiangShan:default-chisel6:* !*:linux", 28),
("XiangShan:mini-chisel3:* !*:linux", 13),
("XiangShan:mini-chisel6:* !*:linux", 15),
("XuanTie-C906:*", 5),
("XuanTie-C910:*", 9),
("XuanTie-E902:*", 5),
("XuanTie-E906:*", 6),
],
"clang": [
("BlackParrot:1x1:*", 5),
("BlackParrot:4x4:*", 12),
("Caliptra:default:*", 16),
("HammerBlade:16x8:*", 4),
("HammerBlade:2x1:*", 2),
("NVDLA:*", 28),
("HummingbirdV2-E203:default:*", 10),
("HummingbirdV2-E203:nodelay:*", 10),
("OpenPiton:1x1:*", 5),
("OpenPiton:4x4:*", 8),
("OpenTitan:*", 10),
("Servant:qerv:phil", 17),
("Servant:serv:phil", 15),
("VeeR-EH1:asic:*", 6),
("VeeR-EH1:default:*", 8),
("VeeR-EH1:hiperf:*", 5),
("VeeR-EH2:asic:*", 9),
("VeeR-EH2:default:*", 8),
("VeeR-EH2:hiperf:*", 7),
("VeeR-EL2:asic:*", 4),
("VeeR-EL2:default:*", 5),
("VeeR-EL2:hiperf:*", 5),
("Vortex:mini:*", 3),
("Vortex:sane:*", 5),
("XiangShan:default-chisel3:* !*:linux", 21),
("XiangShan:default-chisel6:* !*:linux", 19),
("XiangShan:mini-chisel3:* !*:linux", 8),
("XiangShan:mini-chisel6:* !*:linux", 8),
("XuanTie-C906:*", 3),
("XuanTie-C910:*", 7),
("XuanTie-E902:*", 7),
("XuanTie-E906:*", 7),
],
"gcc-hier": [
("BlackParrot:1x1:*", 4),
("BlackParrot:4x4:*", 25),
("NVDLA:*", 25),
("OpenPiton:16x16:dhry", 16),
("OpenPiton:1x1:*", 4),
("OpenPiton:4x4:*", 4),
("OpenPiton:8x8:*", 6),
("XuanTie-C910:*", 7),
],
}
# fmt: on
parser = argparse.ArgumentParser(
description="Print the RTLMeter CI cases as JSON, keyed by run tag")
parser.add_argument("--event-name",
required=True,
help="GitHub event name that triggered the workflow")
parser.add_argument(
"--ci-testing",
action="store_true",
help="Print only the shortest (lowest priority) case per tag, to reduce CI testing time")
args = parser.parse_args()
# Pull requests use the reduced 'CASES_PR' set, other events (e.g.: the nightly
# schedule) use the full 'CASES' set.
is_pr = args.event_name == "pull_request"
selected = CASES_PR if is_pr else CASES
cases = {}
for tag, entries in selected.items():
# Highest priority (longest) first
ordered = sorted(entries, key=lambda cp: cp[1], reverse=True)
# While tweaking the CI, keep only the shortest (lowest priority) case to minimise churn time
if args.ci_testing:
ordered = ordered[-1:]
# Case filters appended to every case for this tag/event
suffix = ""
# Filters out the non-hierarchical case variants for the hierarchical job
if tag == "gcc-hier":
suffix += " !-hier"
# Filter out hello tests on pull requests, these just add measurement noise
if is_pr:
suffix += " !*:hello"
cases[tag] = [case + suffix for case, _ in ordered]
print(json.dumps(cases, separators=(",", ":")))
+175
View File
@@ -0,0 +1,175 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI script for 'rtlmeter.yml' PR results
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# This script builds the content of the response comment posted on PRs
# at the end of RTLMeter runs.
# Developer note: You should be able to run this script in your local checkout
# if you have GitHub CLI (command 'gh') setup, authenticated ('gh auth login'),
# and have set a default repository ('gh repo set-default').
# Trace when running in the CI
[ "$GITHUB_ACTIONS" != "true" ] || set -x
# Arguments:
# 1. run ID
# 2. SHA of the event that triggered the run (for a PR, the test merge commit)
# rest: run tags
RUN_ID=$1; shift
RUN_SHA=$1; shift
RUNS="$@"
# $VERILATOR_CHECKOUT/ci directory
SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
# Move into a temporary directory
rm -rf rtlmeter-report
mkdir rtlmeter-report
pushd rtlmeter-report &> /dev/null
TMP_DIR=$(readlink -f .)
# Download the combined results. 'combine-results' uploads a single artifact
# for each version, holding the per-tag JSON files (e.g. all-results-gcc.json):
# - 'all-results' for the new version
# - 'all-reference' for the old reference version
mkdir new ref
NEW_DIR=$(readlink -f new)
REF_DIR=$(readlink -f ref)
gh run download ${RUN_ID} --name all-results --dir $NEW_DIR
gh run download ${RUN_ID} --name all-reference --dir $REF_DIR
# Get Some metadata about the runs
RUN_URL=$(gh run view $RUN_ID --json url --jq ".url")
RUN_NUM=$(gh run view $RUN_ID --json number --jq ".number")
# Repository owner and name of the default repository, used to build the
# GitHub Pages URL of the detailed report. The owner is lowercased, as required
# for the '<owner>.github.io' Pages domain. Resolved here, while still in the
# default repository's git context (before the 'cd rtlmeter' below).
PAGES_OWNER=$(gh repo view --json owner --jq '.owner.login' | tr '[:upper:]' '[:lower:]')
PAGES_NAME=$(gh repo view --json name --jq '.name')
# The 'old' reference was built from the target branch base commit, which is
# the first parent of the triggering merge commit (same as the 'start' job in
# rtlmeter.yml). Resolved here, while still in the default repository's git
# context (before the 'cd rtlmeter' below).
REF_SHA=$(gh api "repos/{owner}/{repo}/commits/$RUN_SHA" --jq '.parents[0].sha')
# Go back to root directory
popd &> /dev/null
# Go to RTLMeter directory
cd rtlmeter
# Compare results
SUMMARY_ARGS=()
for r in $RUNS; do
CMP_JSON=$TMP_DIR/cmp-$r.json
# Gather args for summary script
SUMMARY_ARGS+=($NEW_DIR/all-results-$r.json $CMP_JSON)
# Create JSON
./rtlmeter compare --format json --steps "*" --metrics "*" \
$REF_DIR/all-reference-$r.json $NEW_DIR/all-results-$r.json > $CMP_JSON
# Also create detailed tables
./rtlmeter compare --format ascii --steps 'verilate' --metrics '*' $REF_DIR/all-reference-$r.json $NEW_DIR/all-results-$r.json > $TMP_DIR/verilate-$r.txt
./rtlmeter compare --format ascii --steps 'cppbuild' --metrics '*' $REF_DIR/all-reference-$r.json $NEW_DIR/all-results-$r.json > $TMP_DIR/cppbuild-$r.txt
./rtlmeter compare --format ascii --steps 'execute' --metrics '*' $REF_DIR/all-reference-$r.json $NEW_DIR/all-results-$r.json > $TMP_DIR/execute-$r.txt
# Chop them at new lines, into one table per file
awk -v RS= -v prefix=$TMP_DIR/$r-frag '{print > sprintf("%s-verilate-%02d.txt",prefix,NR)}' $TMP_DIR/verilate-$r.txt
awk -v RS= -v prefix=$TMP_DIR/$r-frag '{print > sprintf("%s-cppbuild-%02d.txt",prefix,NR)}' $TMP_DIR/cppbuild-$r.txt
awk -v RS= -v prefix=$TMP_DIR/$r-frag '{print > sprintf("%s-execute-%02d.txt" ,prefix,NR)}' $TMP_DIR/execute-$r.txt
done
# Create summary, suppress failure, but save the status reported to pass back.
STATUS=0
venv/bin/python3 $SCRIPT_DIR/ci-rtlmeter-report.py ${SUMMARY_ARGS[@]} > $TMP_DIR/summary.txt || STATUS=$?
# Print it
cat $TMP_DIR/summary.txt
REPORT_URL=https://${PAGES_OWNER}.github.io/${PAGES_NAME}/rtlmeter-reports/${RUN_ID}/index.html
###############################################################################
# Create the PR notification
###############################################################################
NOTIFICATION_DIR=$TMP_DIR/notification
mkdir -p $NOTIFICATION_DIR
cat > ${NOTIFICATION_DIR}/body.txt <<NOTIFICATION_TEMPLATE
Performance metrics for PR workflow [#$RUN_NUM]($RUN_URL), comparing:
- target branch commit [${REF_SHA:0:9}](https://github.com/${PAGES_OWNER}/${PAGES_NAME}/commit/${REF_SHA}) (A)
- with PR merge commit [${RUN_SHA:0:9}](https://github.com/${PAGES_OWNER}/${PAGES_NAME}/commit/${RUN_SHA}) (B)
<details open>
<summary>Summary of all runs</summary>
<pre>
$(cat $TMP_DIR/summary.txt)
</pre>
</details>
The reported numbers are the geometric means of the ratios of the metrics over all cases,
less than 1 is a regression, greater than 1 is an improvement.
The jobs run on variable and noisy runners, so some variance is expected between runs.
Detailed report: [${RUN_ID}](${REPORT_URL})
NOTIFICATION_TEMPLATE
echo "Workflow [#$RUN_NUM]($RUN_URL) report: [${RUN_ID}](${REPORT_URL})" > ${NOTIFICATION_DIR}/hist.txt
###############################################################################
# Create detailed report
###############################################################################
REPORT=$TMP_DIR/body.html
cat > $REPORT <<SUMMARY_TEMPLATE
<h3>Summary of all runs</h3>
<pre>
$(cat $TMP_DIR/summary.txt)
</pre>
SUMMARY_TEMPLATE
echo "<h3>Detailed results</h3>" >> $REPORT
for r in $RUNS; do
RUN_NAME=$(jq -rj ".[0].runName" $NEW_DIR/all-results-$r.json)
echo "<h4>$RUN_NAME</h4>" >> $REPORT
for f in $(ls -1 $TMP_DIR/$r-frag-verilate-*.txt | sort) \
$(ls -1 $TMP_DIR/$r-frag-cppbuild-*.txt | sort) \
$(ls -1 $TMP_DIR/$r-frag-execute-*.txt | sort); do
cat >> $REPORT <<DETAIL_TAMPLATE
<details>
<summary>$(head -n 1 $f | tr -d '\n')</summary>
<pre>
$(tail -n +2 $f)
</pre>
</details>
DETAIL_TAMPLATE
done
done
# Turn the report into a proper HTML page
mkdir -p ${TMP_DIR}/report
cat > ${TMP_DIR}/report/index.html <<INDEX_TEMPLATE
<html>
<head>
<title>Verilator RTLMeter report #${RUN_NUM}</title>
<style>
body {
font-family: courier, serif;
background-color: #f3f3f3;
a {
color: #008fd7;
}
}
</style>
</head>
<body>
$(cat ${TMP_DIR}/body.html)
</body>
</html>
INDEX_TEMPLATE
exit $STATUS
+137
View File
@@ -0,0 +1,137 @@
# DESCRIPTION: Verilator: CI script for 'rtlmeter.yml' PR results
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
###############################################################################
# This script runs with the venv of **RTLMeter**
###############################################################################
import sys
import json
import tabulate
from typing import Final, List
tabulate.PRESERVE_WHITESPACE = True
tabulate.MIN_PADDING = 0
_ASCII_TABLE_FORMAT: Final = tabulate.TableFormat(
lineabove=tabulate.Line("╒═", "═", "═╤═", "═╕"),
linebelowheader=tabulate.Line("╞═", "═", "═╪═", "═╡"),
linebelow=tabulate.Line("╘═", "═", "═╧═", "═╛"),
headerrow=tabulate.DataRow("│ ", " │ ", " │"),
datarow=tabulate.DataRow("│ ", " │ ", " │"),
linebetweenrows=None,
padding=0,
with_header_hide=None,
)
def printTable(table: List[List[str]], **kwargs) -> None:
print(tabulate.tabulate(table, tablefmt=_ASCII_TABLE_FORMAT, **kwargs))
# fmt: off
stepMetric = (
# Step, Metric, Status Brackets
("execute", "speed", ("❌", 0.96, "⚠️", 0.98, "✅", 1.02, "💡", 1.04, "⭐")),
("execute", "memory", ("❌", 0.90, "⚠️", 0.95, "✅", 1.05, "💡", 1.10, "⭐")),
("verilate", "cpu", ("❌", 0.96, "⚠️", 0.98, "✅", 1.02, "💡", 1.04, "⭐")),
("verilate", "memory", ("❌", 0.90, "⚠️", 0.95, "✅", 1.05, "💡", 1.10, "⭐")),
("cppbuild", "cpu", ("❌", 0.96, "⚠️", 0.98, "✅", 1.02, "💡", 1.04, "⭐")),
("cppbuild", "memory", ("❌", 0.90, "⚠️", 0.95, "✅", 1.05, "💡", 1.10, "⭐")),
("cppbuild", "codeSize",("❌", 0.96, "⚠️", 0.98, "✅", 1.02, "💡", 1.04, "⭐")),
("cppbuild", "elapsed", ("❌", 0.70, "⚠️", 0.85, "✅", 1.15, "💡", 1.30, "⭐")),
)
badgeLegend = [
("❌", "Likely regression"),
("⚠️", "Possible regression"),
("✅", "Within acceptable range"),
("💡", "Possible improvement"),
("⭐", "Likely improvement"),
]
# fmt: on
changedCycles = []
table = []
badgesToExplain = set()
for ref, cmp in zip(sys.argv[1::2], sys.argv[2::2]):
with open(ref, "r", encoding="utf-8") as f:
ref_json = json.load(f)[0]
with open(cmp, "r", encoding="utf-8") as f:
cmp_json = json.load(f)
if table:
table.append(tabulate.SEPARATING_LINE)
runName = ref_json["runName"]
# Check simulated cycles match - it's ok to crash if this entry does not exist
for entry in cmp_json["execute"]["clocks"]["table"]:
case, _, _, (refCycles, _), (newCycles, _), _, _ = entry
refCycles = int(refCycles)
newCycles = int(newCycles)
if refCycles != newCycles:
changedCycles.append([runName, case, refCycles, newCycles])
# Check metrics
for step, metric, brackets in stepMetric:
if step not in cmp_json:
continue
data = cmp_json[step]
if metric not in data:
continue
data = data[metric]
minGain = float("inf")
maxGain = float("-inf")
meanGain = 1
count = 0
for _, _, _, (a, _), (b, _), g, _ in data["table"]:
# for wall clock and CPU time, ignore small values that just add noise
if metric == "elapsed" or metric == "cpu":
if a < 30 or b < 30:
continue
minGain = min(minGain, g)
maxGain = max(maxGain, g)
meanGain *= g
count += 1
if count == 0:
continue
meanGain = meanGain**(1 / count)
status = brackets[0]
for limit, badge in zip(brackets[1::2], brackets[2::2]):
if meanGain >= limit:
status = badge
badgesToExplain.add(status)
table.append([
runName, step, ref_json["metrics"][metric]["header"], f"{meanGain:.2f}x {status} ",
f"{minGain:.2f}x", f"{maxGain:.2f}x", f"{count}"
])
# Print changed cycles if any
if changedCycles:
print("❌ simulated cycles changed (must be fixed):")
printTable(changedCycles,
headers=("Run", "Case", "Old Cycles", "New Cycles"),
colalign=("left", "left", "right", "right"),
disable_numparse=True)
print()
# Print results
printTable(
table,
headers=("Run", "Step", "Metric", "Improvement", "Min", "Max", "Samples"),
colalign=("left", "left", "left", "right", "right", "right", "right"),
disable_numparse=True,
)
# Explain badges
print()
for badge, legend in badgeLegend:
if badge in badgesToExplain:
print(f" {badge} : {legend}")
# Fail job if status changed
sys.exit(0 if not changedCycles else 1)
-208
View File
@@ -1,208 +0,0 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI main job script
#
# SPDX-FileCopyrightText: 2020 Geza Lore
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
# This is the main script executed in the 'script' phase by all jobs. We use a
# single script to keep the CI setting simple. We pass job parameters via
# environment variables using 'env' keys.
################################################################################
set -e
set -x
fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
}
if [ "$CI_OS_NAME" = "linux" ]; then
export MAKE=make
NPROC=$(nproc)
elif [ "$CI_OS_NAME" = "osx" ]; then
export MAKE=make
NPROC=$(sysctl -n hw.logicalcpu)
# Disable ccache, doesn't always work in GitHub Actions
export OBJCACHE=
elif [ "$CI_OS_NAME" = "freebsd" ]; then
export MAKE=gmake
NPROC=$(sysctl -n hw.ncpu)
else
fatal "Unknown CI_OS_NAME: '$CI_OS_NAME'"
fi
NPROC=$(expr $NPROC '+' 1)
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
##############################################################################
# Build verilator
autoconf
CONFIGURE_ARGS="--enable-longtests --enable-ccwarn"
if [ "$CI_DEV_ASAN" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-asan"
CXX="$CXX -DVL_LEAK_CHECKS"
fi
if [ "$CI_DEV_GCOV" = 1 ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-dev-gcov"
fi
./configure $CONFIGURE_ARGS --prefix="$INSTALL_DIR"
ccache -z
"$MAKE" -j "$NPROC" -k
# 22.04: ccache -s -v
ccache -s
if [ "$CI_OS_NAME" = "osx" ]; then
file bin/verilator_bin
file bin/verilator_bin_dbg
md5 bin/verilator_bin
md5 bin/verilator_bin_dbg
stat bin/verilator_bin
stat bin/verilator_bin_dbg
fi
elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
##############################################################################
# Run tests
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
if [ "$CI_OS_NAME" = "osx" ]; then
export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X
# TODO below may no longer be required as configure checks for -pg
export VERILATOR_TEST_NO_GPROF=1 # Apple Clang has no -pg
# export PATH="/Applications/gtkwave.app/Contents/Resources/bin:$PATH" # fst2vcd
file bin/verilator_bin
file bin/verilator_bin_dbg
md5 bin/verilator_bin
md5 bin/verilator_bin_dbg
stat bin/verilator_bin
stat bin/verilator_bin_dbg
# For some reason, the dbg exe is corrupted by this point ('file' reports
# it as data rather than a Mach-O). Unclear if this is an OS X issue or
# CI's. Remove the file and re-link...
rm bin/verilator_bin_dbg
"$MAKE" -j "$NPROC" -k
elif [ "$CI_OS_NAME" = "freebsd" ]; then
export VERILATOR_TEST_NO_GDB=1 # Disable for now, ideally should run
# TODO below may no longer be required as configure checks for -pg
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
fi
TEST_REGRESS=test_regress
if [ "$CI_RELOC" == 1 ]; then
# Testing that the installation is relocatable.
"$MAKE" install
mkdir -p "$RELOC_DIR"
mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install"
export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator"
TEST_REGRESS="$RELOC_DIR/test_regress"
mv test_regress "$TEST_REGRESS"
NODIST="$RELOC_DIR/nodist"
mv nodist "$NODIST"
# Feeling brave?
find . -delete
ls -la .
fi
# Run the specified test
ccache -z
case $TESTS in
dist-vlt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=0/4
;;
dist-vlt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=1/4
;;
dist-vlt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=2/4
;;
dist-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=3/4
;;
vltmt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=0/3
;;
vltmt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=1/3
;;
vltmt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=2/3
;;
coverage-dist)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist"
;;
coverage-vlt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=0/10
;;
coverage-vlt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=1/10
;;
coverage-vlt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=2/10
;;
coverage-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=3/10
;;
coverage-vlt-4)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=4/10
;;
coverage-vlt-5)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=5/10
;;
coverage-vlt-6)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=6/10
;;
coverage-vlt-7)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=7/10
;;
coverage-vlt-8)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=8/10
;;
coverage-vlt-9)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=9/10
;;
coverage-vltmt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=0/10
;;
coverage-vltmt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=1/10
;;
coverage-vltmt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=2/10
;;
coverage-vltmt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=3/10
;;
coverage-vltmt-4)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=4/10
;;
coverage-vltmt-5)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=5/10
;;
coverage-vltmt-6)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=6/10
;;
coverage-vltmt-7)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=7/10
;;
coverage-vltmt-8)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=8/10
;;
coverage-vltmt-9)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=9/10
;;
*)
fatal "Unknown TESTS: $TESTS"
;;
esac
# To see load average (1 minute, 5 minute, 15 minute)
uptime
# 22.04: ccache -s -v
ccache -s
else
##############################################################################
# Unknown build stage
fatal "Unknown CI_BUILD_STAGE_NAME: '$CI_BUILD_STAGE_NAME'"
fi
+169
View File
@@ -0,0 +1,169 @@
#!/usr/bin/env bash
# DESCRIPTION: Verilator: CI test job script
#
# SPDX-FileCopyrightText: 2026 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
# Executed in the 'test' stage.
################################################################################
# Destructive to the checkout (wipes most of it); never run locally
if [ "$GITHUB_ACTIONS" != "true" ]; then
echo "ERROR: $(basename "$0") must only be run in GitHub Actions CI" >&2
exit 1
fi
set -e
set -x
source "$(dirname "$0")/ci-common.bash"
################################################################################
# Parse arguments
OPT_RELOC=
OPT_SUITE=
while [ $# -gt 0 ]; do
case "$1" in
--reloc)
[ $# -ge 2 ] || fatal "--reloc requires an argument"
OPT_RELOC="$2"
shift
;;
--suite)
[ $# -ge 2 ] || fatal "--suite requires an argument"
OPT_SUITE="$2"
shift
;;
*) fatal "Unknown option: '$1'" ;;
esac
shift
done
[ -n "$OPT_SUITE" ] || fatal "--suite is required"
################################################################################
# Run tests
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
if [ "$HOST_OS" = "macOS" ]; then
export VERILATOR_TEST_NO_GDB=1 # No working GDB on macOS
fi
TEST_REGRESS=test_regress
if [ -n "$OPT_RELOC" ]; then
# Testing that the installation is relocatable.
"$MAKE" install
# Install prefix, as configured into the Makefile at build time
INSTALL_DIR=$(sed -n 's/^prefix = //p' Makefile)
mkdir -p "$OPT_RELOC"
mv "$INSTALL_DIR" "$OPT_RELOC/relocated-install"
export VERILATOR_ROOT="$OPT_RELOC/relocated-install/share/verilator"
TEST_REGRESS="$OPT_RELOC/test_regress"
mv test_regress "$TEST_REGRESS"
NODIST="$OPT_RELOC/nodist"
mv nodist "$NODIST"
# Delete everything else, but keep the CI infrastructure
find . -mindepth 1 -maxdepth 1 ! -name .github ! -name ci -exec rm -rf {} +
ls -la .
fi
# Run the specified suite
ccache -z
TEST_START=$SECONDS
case $OPT_SUITE in
dist-vlt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=0/4
;;
dist-vlt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=1/4
;;
dist-vlt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=2/4
;;
dist-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt --driver-clean" DRIVER_HASHSET=--hashset=3/4
;;
vltmt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=0/3
;;
vltmt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=1/3
;;
vltmt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt --driver-clean" DRIVER_HASHSET=--hashset=2/3
;;
coverage-dist)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist"
;;
coverage-vlt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=0/10
;;
coverage-vlt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=1/10
;;
coverage-vlt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=2/10
;;
coverage-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=3/10
;;
coverage-vlt-4)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=4/10
;;
coverage-vlt-5)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=5/10
;;
coverage-vlt-6)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=6/10
;;
coverage-vlt-7)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=7/10
;;
coverage-vlt-8)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=8/10
;;
coverage-vlt-9)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vlt" DRIVER_HASHSET=--hashset=9/10
;;
coverage-vltmt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=0/10
;;
coverage-vltmt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=1/10
;;
coverage-vltmt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=2/10
;;
coverage-vltmt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=3/10
;;
coverage-vltmt-4)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=4/10
;;
coverage-vltmt-5)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=5/10
;;
coverage-vltmt-6)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=6/10
;;
coverage-vltmt-7)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=7/10
;;
coverage-vltmt-8)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=8/10
;;
coverage-vltmt-9)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--vltmt" DRIVER_HASHSET=--hashset=9/10
;;
*)
fatal "Unknown suite: $OPT_SUITE"
;;
esac
ccache -svv
ccache --evict-older-than "$((SECONDS - TEST_START + 60))s"
ccache -svv
uptime # To see load average
+20 -6
View File
@@ -6,19 +6,33 @@
Set-PSDebug -Trace 1
if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
$NPROC = $env:NUMBER_OF_PROCESSORS
# Absolute path for the win_flex_bison install; CMake reads this from the environment
$env:WIN_FLEX_BISON = "$(Resolve-Path ..)/win_flex_bison"
if (-Not (Test-Path $env:WIN_FLEX_BISON/win_bison.exe)) {
git clone --depth 1 https://github.com/lexxmark/winflexbison
cd winflexbison
mkdir build
cd build
cmake .. --install-prefix $PWD/../../../.ccache
cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../../../.ccache
cmake .. --install-prefix $env:WIN_FLEX_BISON
cmake --build . --config Release -j $NPROC
cmake --install . --prefix $env:WIN_FLEX_BISON
cd ../..
}
# Enter the MSVC developer shell so cl/link are on PATH for the Ninja generator
$VsPath = & "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -latest -products * -property installationPath
Import-Module "$VsPath/Common7/Tools/Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $VsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64"
mkdir build
cd build
cmake .. --install-prefix $PWD/../install
cmake --build . --config Release -j 3
# Ninja saturates all cores; the MSBuild generator only parallelizes across
# projects and Verilator is a single target, so it compiles serially. /Od skips
# optimization: this job only checks that Verilator builds and can verilate an
# example, so an optimized binary is not needed and the codegen time dominates.
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release --install-prefix $PWD/../install "-DCMAKE_CXX_FLAGS_RELEASE=/Od /DNDEBUG"
cmake --build .
cmake --install . --prefix $PWD/../install
+6 -2
View File
@@ -7,13 +7,17 @@
Set-PSDebug -Trace 1
$NPROC = $env:NUMBER_OF_PROCESSORS
cd install
$Env:VERILATOR_ROOT=$PWD
cd examples/cmake_tracing_c
mkdir build
cd build
cmake ..
cmake --build . --config Release -j 3
# /Od skips optimization; this only checks the example verilates and builds, so
# an optimized binary is not needed (see ci-win-compile.ps1).
cmake .. "-DCMAKE_CXX_FLAGS_RELEASE=/Od /DNDEBUG"
cmake --build . --config Release -j $NPROC
# TODO put this back in, see issue# 5163
# Release/example.exe
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _verilator build docker container:
+1
View File
@@ -29,6 +29,7 @@ RUN apt-get update \
python3 \
zlib1g \
zlib1g-dev \
liblz4-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Verilator Executable Docker Container
=====================================
+160 -49
View File
@@ -12,7 +12,7 @@
# Then 'make maintainer-dist'
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel])
AC_INIT([Verilator],[5.048 2026-04-26],
AC_INIT([Verilator],[5.053 devel],
[https://verilator.org],
[verilator],[https://verilator.org])
@@ -129,6 +129,21 @@ AC_ARG_ENABLE([dev-gcov],
AC_SUBST(CFG_WITH_DEV_GCOV)
AC_MSG_RESULT($CFG_WITH_DEV_GCOV)
# Flag to reduce the debug info in the debug executable to minimize its size
AC_MSG_CHECKING(whether to reduce debug info in the debug executable)
AC_ARG_ENABLE([light-debug],
[AS_HELP_STRING([--enable-light-debug],
[Reduce the amount of debug information in the debug
Verilator executable to minimize its size. Enable
slight optimization. Enough for backtraces only.])],
[case "${enableval}" in
yes) CFG_WITH_LIGHT_DEBUG=yes ;;
no) CFG_WITH_LIGHT_DEBUG=no ;;
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-light-debug]) ;;
esac],
CFG_WITH_LIGHT_DEBUG=no)
AC_MSG_RESULT($CFG_WITH_LIGHT_DEBUG)
# Special Substitutions - CFG_WITH_DEFENV
AC_MSG_CHECKING(whether to use hardcoded paths)
AC_ARG_ENABLE([defenv],
@@ -249,6 +264,7 @@ fi
python3_version=$($PYTHON3 --version | head -1)
AC_MSG_RESULT([$PYTHON3 --version = $python3_version])
AC_ARG_VAR([LEX], [Flex executable])
AC_CHECK_PROG(LEX,flex,flex)
if test "x$LEX" = "x" ; then
AC_MSG_ERROR([Cannot find "flex" in your PATH, please install it])
@@ -256,6 +272,22 @@ fi
flex_version=$($LEX --version | head -1)
AC_MSG_RESULT([$LEX --version = $flex_version])
# Use the header installed with the selected generator.
flex_include=$($PYTHON3 -c '
import pathlib
import shutil
import sys
print(pathlib.Path(shutil.which(sys.argv@<:@1@:>@) or sys.argv@<:@1@:>@).resolve().parent.parent / "include")
' "$LEX")
if test -f "$flex_include/FlexLexer.h"; then
if test -n "$MSYSTEM"; then
# Search MSYS Flex headers after the active toolchain's system headers.
CPPFLAGS="$CPPFLAGS -idirafter $flex_include"
else
CPPFLAGS="$CPPFLAGS -I$flex_include"
fi
fi
AC_CHECK_PROG(YACC,bison,bison)
if test "x$YACC" = "x" ; then
AC_MSG_ERROR([Cannot find "bison" in your PATH, please install it])
@@ -421,8 +453,18 @@ AC_DEFUN([_MY_LDLIBS_CHECK_OPT],
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
])
AC_DEFUN([_MY_LDLIBS_CHECK_SET],
[# _MY_LDLIBS_CHECK_SET(variable, flag) -- Check if linker supports specific
# options. If it does, set variable to flag, only if not previously set
# (so the first supported flag wins and the rest are not tested).
if test "$$1" = ""; then
_MY_LDLIBS_CHECK_IFELSE($2, $1="$2")
fi
])
# Add the coverage flags early as they influence later checks.
if test "$CFG_WITH_DEV_GCOV" = "yes"; then
CFG_GCOV_CXX="$CXX"
_MY_CXX_CHECK_OPT(CXX,--coverage)
# Otherwise inline may not show as uncovered
# If we use this then e.g. verilated.h functions properly show up
@@ -444,8 +486,32 @@ if test "$CFG_WITH_DEV_GCOV" = "yes"; then
_MY_CXX_CHECK_OPT(CXX,-fprofile-abs-path)
# Define so compiled code can know
_MY_CXX_CHECK_OPT(CXX,-DVL_GCOV)
AC_DEFINE([HAVE_DEV_GCOV],[1],[Defined if compiled with code coverage collection for gcov])]
AC_DEFINE([HAVE_DEV_GCOV],[1],[Defined if compiled with code coverage collection for gcov])
if test "x$GCOV" = "x"; then GCOV=gcov; fi
AC_MSG_CHECKING([whether $GCOV reads coverage data from $CFG_GCOV_CXX])
CFG_GCOV_DIR=conftest.gcov.dir
rm -rf $CFG_GCOV_DIR
AS_MKDIR_P([$CFG_GCOV_DIR])
echo 'int main() { return 0; }' > $CFG_GCOV_DIR/conftest_gcov.cpp
CFG_GCOV_RES=no
if (cd $CFG_GCOV_DIR \
&& $CFG_GCOV_CXX --coverage -o conftest_gcov conftest_gcov.cpp \
&& ./conftest_gcov) >/dev/null 2>&1; then
(cd $CFG_GCOV_DIR && $GCOV conftest_gcov.gcda) >/dev/null 2>&1
if test -s $CFG_GCOV_DIR/conftest_gcov.cpp.gcov; then CFG_GCOV_RES=yes; fi
else
CFG_GCOV_RES=untested
fi
rm -rf $CFG_GCOV_DIR
AC_MSG_RESULT($CFG_GCOV_RES)
if test "$CFG_GCOV_RES" = "no"; then
AC_MSG_ERROR(['$GCOV' cannot read coverage data written by '$CFG_GCOV_CXX'.
Coverage collection would silently produce no data.
Pass a matching tool, e.g. GCOV=gcov-<version>
or configure without --enable-dev-gcov.])
fi
fi
AC_SUBST(GCOV)
AC_SUBST(HAVE_DEV_GCOV)
# Compiler flags to enable profiling
@@ -483,6 +549,11 @@ _MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-std=gnu++20)
AC_SUBST(CFG_CXXFLAGS_COROUTINES)
AC_SUBST(HAVE_COROUTINES)
# Check if the C++ compiler supports ThreadSanitizer
_MY_CXX_CHECK_IFELSE(-fsanitize=thread,
[AC_DEFINE([HAVE_TSAN],[1],[Defined if ThreadSanitizer is supported by $CXX])])
AC_SUBST(HAVE_TSAN)
# Flags for compiling Verilator internals including parser always
if test "$CFG_WITH_DEV_ASAN" = "yes"; then
_MY_CXX_CHECK_IFELSE(-fsanitize=address -DVL_ASAN,
@@ -509,15 +580,27 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_PARSER,-Wno-unused)
AC_SUBST(CFG_CXXFLAGS_PARSER)
# Flags for compiling the debug version of Verilator (in addition to above CFG_CXXFLAGS_SRC)
if test "$CFG_WITH_DEV_GCOV" = "no"; then # Do not optimize for the coverage build
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-Og)
if test "$CFG_WITH_LIGHT_DEBUG" = "yes"; then
# Slight optimization and minimal compressed debug info. This is enough for
# --gdb/--gdbbt backtraces, but omits the bulk of the debug info, which
# significantly reduces object file sizes. For CI or release builds.
if test "$CFG_WITH_DEV_GCOV" = "no"; then # Do not optimize for the coverage build
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-Og)
fi
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-ggdb1)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-fdebug-info-for-profiling) # For fully-qualified names with clang
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-gz)
else
# Full debug: no optimization, full debug info, for development.
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-O0)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-ggdb)
fi
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-ggdb)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_DBG,-gz)
AC_SUBST(CFG_CXXFLAGS_DBG)
# Flags for linking the debug version of Verilator (in addition to above CFG_LDFLAGS_SRC)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_DBG,-gz)
if test "$CFG_WITH_LIGHT_DEBUG" = "yes"; then
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_DBG,-gz)
fi
AC_SUBST(CFG_LDFLAGS_DBG)
# Flags for compiling the optimized version of Verilator (in addition to above CFG_CXXFLAGS_SRC)
@@ -580,6 +663,34 @@ m4_foreach([ldflag], [
AC_SUBST(CFG_LDLIBS_THREADS)
AC_SUBST(CFG_LDFLAGS_THREADS_CMAKE)
# Find link flags for runtime VPI library loading (+verilator+vpi+<lib>).
# The model executable must export its VPI symbols so the dlopen'd library can
# resolve them: -rdynamic (GNU ld) or -Wl,-export_dynamic (Darwin); the first the
# linker accepts wins. -ldl provides dlopen/dlsym where it is a separate library.
_MY_LDLIBS_CHECK_SET(CFG_LDFLAGS_DYNAMIC, -rdynamic)
# -Wl,-export_dynamic contains a comma, so probe it directly rather than through
# the _MY_LDLIBS_CHECK_* macros (which re-expand their flag argument unquoted).
if test "$CFG_LDFLAGS_DYNAMIC" = ""; then
ACO_SAVE_LIBS="$LIBS"
LIBS="$LIBS -Wl,-export_dynamic"
AC_MSG_CHECKING([whether $CXX linker accepts -Wl,-export_dynamic])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]])],
[_my_result=yes
if test -s conftest.err; then
if grep -e "-export_dynamic" conftest.err >/dev/null; then
_my_result=no
fi
fi],
[_my_result=no])
AC_MSG_RESULT($_my_result)
LIBS="$ACO_SAVE_LIBS"
if test "$_my_result" = "yes"; then CFG_LDFLAGS_DYNAMIC="-Wl,-export_dynamic"; fi
fi
AC_SUBST(CFG_LDFLAGS_DYNAMIC)
_MY_LDLIBS_CHECK_OPT(CFG_LDLIBS_DYNAMIC, -ldl)
AC_SUBST(CFG_LDLIBS_DYNAMIC)
# If 'mold' is installed, use it to link for faster buildtimes
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -fuse-ld=mold)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_VERILATED, -fuse-ld=mold)
@@ -589,11 +700,6 @@ if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libgcc)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libstdc++)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -Xlinker -gc-sections)
LTCMALLOC="-Wl,--whole-archive -l:libtcmalloc_minimal.a -Wl,--no-whole-archive"
LJEMALLOC="-Wl,--whole-archive -l:libjemalloc.a -Wl,--no-whole-archive"
else
LTCMALLOC=-ltcmalloc_minimal
LJEMALLOC=-ljemalloc
fi
AC_SUBST(CFG_LDFLAGS_SRC)
AC_SUBST(CFG_LDFLAGS_VERILATED)
@@ -609,51 +715,56 @@ _MY_LDLIBS_CHECK_OPT(CFG_LIBS, -latomic)
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpsapi)
# Check if jemalloc is available based on --enable-jemalloc
# jemalloc is preferred over tcmalloc when both are available
# Figure out which malloc library to use:
# - Prefer jemalloc over tcmalloc (it's faster)
# - If partial static link enabled, prefer static libraries,
# but fall back on dynamic if static is not available
# Test for jemalloc
CFG_HAVE_JEMALLOC=no
_MY_LDLIBS_CHECK_IFELSE(
$LJEMALLOC,
[if test "$CFG_WITH_JEMALLOC" != "no"; then
CFG_LIBS="$LJEMALLOC $CFG_LIBS";
CFG_HAVE_JEMALLOC=yes;
# If using jemalloc, add some extra options to make the compiler not assume
# it is using its own versions of the standard library functions
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-malloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-calloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-realloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-free)
if test "$CFG_WITH_JEMALLOC" != "no"; then
if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
_MY_LDLIBS_CHECK_SET(CFG_LIBS_MALLOC, -Xlinker --whole-archive -l:libjemalloc.a -Xlinker --no-whole-archive)
fi
_MY_LDLIBS_CHECK_SET(CFG_LIBS_MALLOC, -ljemalloc)
if test "$CFG_LIBS_MALLOC" != ""; then
CFG_HAVE_JEMALLOC=yes
AC_DEFINE([HAVE_JEMALLOC],[1],[Defined if have jemalloc])
fi],
[if test "$CFG_WITH_JEMALLOC" = "yes"; then
AC_MSG_ERROR([--enable-jemalloc was given but test for ${LJEMALLOC} failed])
fi])
elif test "$CFG_WITH_JEMALLOC" = "yes"; then
AC_MSG_ERROR([--enable-jemalloc was given but jemalloc is not available])
fi
fi
AC_SUBST(HAVE_JEMALLOC)
# Check if tcmalloc is available based on --enable-tcmalloc
# Only use tcmalloc if jemalloc was not found/enabled
if test "$CFG_HAVE_JEMALLOC" = "yes"; then
AC_MSG_NOTICE([jemalloc found, skipping tcmalloc check])
else
# Test for tcmalloc
CFG_HAVE_TCMALLOC=no
_MY_LDLIBS_CHECK_IFELSE(
$LTCMALLOC,
[if test "$CFG_WITH_TCMALLOC" != "no"; then
CFG_LIBS="$LTCMALLOC $CFG_LIBS";
CFG_HAVE_TCMALLOC=yes;
# If using tcmalloc, add some extra options to make the compiler not assume
# it is using its own versions of the standard library functions
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-malloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-calloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-realloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-free)
if test "$CFG_HAVE_JEMALLOC" = "yes"; then
AC_MSG_NOTICE([jemalloc found, skipping check for tcmalloc])
elif test "$CFG_WITH_TCMALLOC" != "no"; then
if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
_MY_LDLIBS_CHECK_SET(CFG_LIBS_MALLOC, -Xlinker --whole-archive -l:libtcmalloc_minimal.a -Xlinker --no-whole-archive)
fi
_MY_LDLIBS_CHECK_SET(CFG_LIBS_MALLOC, -ltcmalloc_minimal)
if test "$CFG_LIBS_MALLOC" != ""; then
CFG_HAVE_TCMALLOC=yes
AC_DEFINE([HAVE_TCMALLOC],[1],[Defined if have tcmalloc])
fi],
[if test "$CFG_WITH_TCMALLOC" = "yes"; then
AC_MSG_ERROR([--enable-tcmalloc was given but test for ${LTCMALLOC} failed])
fi])
elif test "$CFG_WITH_TCMALLOC" = "yes"; then
AC_MSG_ERROR([--enable-tcmalloc was given but tcmalloc is not available])
fi
fi
AC_SUBST(HAVE_TCMALLOC)
if test "$CFG_HAVE_JEMALLOC" = "yes" || test "$CFG_HAVE_TCMALLOC" = "yes"; then
# If using custom malloc, add some extra options to make the compiler not assume
# it is using its own versions of the standard library functions
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-malloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-calloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-realloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-free)
fi
# Finished with libraries
CFG_LIBS="$CFG_LIBS_MALLOC $CFG_LIBS"
AC_SUBST(CFG_LIBS)
# Need C++14 at least
+38
View File
@@ -0,0 +1,38 @@
<!-- DESCRIPTION: Verilator: docs/ guidelines for AI coding agents
SPDX-FileCopyrightText: 2026-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -->
# docs/ Guidelines -- Verilator documentation (\*.rst)
When to check: before editing anything under `docs/`.
Read the repository-root [AGENTS.md](../AGENTS.md) first for process and cross-cutting rules.
## Writing rules
- Rewrap paragraphs after editing -- keep consistent line length in `*.rst` files.
- Document only stable, implemented features -- never planned or in-development capabilities; prevents user confusion and support burden.
- Explain WHAT and WHEN, not HOW -- conceptual purpose and practical use cases over implementation mechanics; describe behavior ("optimized as pure", not "treated as pure") and clarify ambiguous referents ("in the internals of Verilator").
- Keep terminology consistent -- one term per concept; update docs when renaming code constructs; spell out full terms, avoiding abbreviations like "sim"/"sims".
- Use "how many" for countable nouns (threads, tasks, workers) and "how much" for uncountable quantities.
- Mark internal or experimental features "for internal use only" -- prevents user dependence and forced deprecation cycles later.
- Use specific IEEE references: `IEEE {number}-{year}` plus the section (e.g. `Annex I`) -- a vague "IEEE spec requires" is unverifiable.
- Document all flags with descriptions, not just syntax.
## reStructuredText mechanics
- Use the `:vlopt:` role for Verilator option references -- makes cross-references clickable and consistent.
- Escape angle brackets (`\<`, `\>`) in link targets -- prevents broken links to command-line options.
- Generate documentation examples with `test.extract` from `test_regress` test files -- examples stay synced with actually tested behavior.
## Hard constraint
- Never edit `docs/CONTRIBUTORS` -- only humans may, after reading and agreeing to its statement; remind the user instead.
+39 -6
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Contributing to Verilator
=========================
@@ -86,12 +87,44 @@ Do you have questions on Verilator?
<https://verilator.org/forum>`__.
AI Policy
---------
Verilator follows the Linux Foundation recommendations regarding the usage
of Generative Large Language Model Artificial Intelligence (LLM-AI) tools
and agents for all contributions to the project, including source code,
test benches, and documentation.
AI assistants and automated agents are not permitted to sign off on
contributions. A human submitter is strictly responsible for reviewing,
verifying, and testing all AI-generated content. By submitting, the
contributor certifies that the generated content is effectively their work
product and adheres to project standards. This accountability is affirmed
when the human contributor signs the Developer Certificate of Origin (DCO)
as outlined in ``docs/CONTRIBUTORS``.
Contributors are encouraged to disclose the significant use of generative
AI tools in their commit messages or Pull Request descriptions to maintain
transparency.
Contributors must ensure that the terms and conditions of the generative AI
tool do not place any contractual restrictions on the tool's output that
are inconsistent with Verilator's open-source licenses, the project's
intellectual property policies, or the Open Source Definition.
If any pre-existing copyrighted materials (including third-party
open-source code or documentation) are included in the AI tool's output,
the contributor must confirm prior to submission that they have explicit
permission from the third-party owners to use, modify, and distribute those
materials under terms compliant with Verilator's licensing policies.
Code of Conduct
---------------
- Our contributors and participants pledge to make participation in our
project and our community a positive experience for everyone. We follow
the `Contributor Covenant version 1.4
<https://www.contributor-covenant.org/version/1/4/code-of-conduct/>`__.
Our contributors and participants pledge to make participation in our
project and our community a positive experience for everyone. We follow the
`Contributor Covenant version 1.4
<https://www.contributor-covenant.org/version/1/4/code-of-conduct/>`__.
Thanks!
+83 -9
View File
@@ -1,14 +1,23 @@
The contributors listed below have certified their Verilator contributions
under the Developer Certificate of Origin (https://developercertificate.org/).
under the Developer Certificate of Origin
(https://developercertificate.org/).
AI agents may not edit this file. As a human, you are agreeing to the
contribution terms including the AI policy in ``docs/CONTRIBUTING.rst``.
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
00>> Please insert into sorted position, and see header as to agreement
24bit-xjkp
404allen404
Adam Bagley
Adam Kostrzewski
Aditya Shevade
Adrian Sampson
Adrien Le Masle
أحمد المحمودي (Ahmed El-Mahmoudy)
Aidan McNay
Aisha Salimgereyeva
Aleksander Kiryk
Alex Chadwick
Alex Solomatnikov
@@ -21,17 +30,24 @@ Andrei Kostovski
Andrew Miloradovsky
Andrew Nolte
Andrew Voznytsa
Andrii Andrieiev
anonkey
Anthony Donlon
Anthony Moore
apocelipes
Arkadiusz Kozdra
Arthur Rosa
Artur Bieniek
AUDIY
Aylon Chaim Porat
Bartosz Skorowski
Bartłomiej Chmiel
Benjamin Collier
BRDR LIFE
Brian Li
Cameron Kirk
Cameron Waite
CatalpaEel
Chih-Mao Chen
Chris Bachhuber
Chris Randall
@@ -41,33 +57,48 @@ Chuxuan Wang
Chykon
Congcong Cai
Conor McCullough
Cookie
Dan Ruelas-Petrisko
Daniel Bates
Danny Oler
Dave Sargeant
David Garau
David Harris
David Horton
David Ledger
David Metz
David Stanford
David Turner
Deanyone Su
dependabot[bot]
Dercury
Demin Han
Diego Roux
Dominick Grochowina
Don Williamson
Dragon-Git
Drew Ranck
Drew Risinger
Drew Taussig
Driss Hafdi
Edgar E. Iglesias
Edmund Lam
Eddie Rydell
em2machine
emmettifelts
Eric Mejdrich
Eric Müller
Eric Rippey
Eunseo Song
Eryk Szpotański
Ethan Sifferman
Eunseo Song
Eyck Jentzsch
Fabian Keßler-Schulz
Fan Shupei
february cozzocrea
Felix Neumärker
Felix Yan
Francesco Urbani
Frans Skarman
Fuad Ismail
Furqan Nadir
@@ -88,6 +119,8 @@ Gökçe Aydos
Han Qi
Harald Heckmann
Hennadii Chernyshchyk
hjsanjana
Hongseok Choi
Howard Su
Huang Rui
Huanghuang Zhou
@@ -99,6 +132,8 @@ Ilya Barkov
Iru Cai
Ivan Vnučec
Iztok Jeras
JAEUK LEE
Jaeuk Lee (이재욱)
Jake Merdich
Jakub Michalski
Jakub Wasilewski
@@ -113,9 +148,12 @@ Jamie Iles
Jan Van Winkel
Jean Berniolles
Jean-Nicolas Strauss
Jeffrey Song
jeffrey.song
Jens Yuechao Liu
Jeremy Bennett
Jesse Taube
Jesús Alberto López Soto
Jevin Sweval
Jiacheng Qian
Jiamin Zhu
@@ -137,6 +175,8 @@ Jose Loyola
Josep Sans
Joseph Nwabueze
Josh Redford
Joshua Leahy
JOTEGO (Jose Tejada)
Julian Carrier
Julian Daube
Julie Schwartz
@@ -150,6 +190,8 @@ Kefa Chen
Keith Colbert
Kevin Kiningham
Kevin Nygaard
Kornel Uriasz
Kristof Marien
Kritik Bhimani
Krzysztof Bieganski
Krzysztof Boronski
@@ -160,9 +202,11 @@ Krzysztof Sychla
Kuba Ober
Lan Zongwei
Larry Doolittle
Laurent CHARRIER
Leela Pakanati
Liam Braun
Luca Colagrande
Lucas Amaral
Ludwig Rogiers
Lukasz Dalek
M2kar
@@ -170,11 +214,14 @@ Maarten De Braekeleer
Maciej Sobkowski
Marcel Chang
Marco Bartoli
Marco Brambilla
Marco Frank
Marco Widmer
Mariusz Glebocki
Markus Krause
Marlon James
Marshal Qiao
Martijn Wobbes
Martin Schmidt
Martin Stadler
Mateusz Gancarz
@@ -185,28 +232,39 @@ Maxim Fonarev
Michael Bedford Taylor
Michael Bikovitsky
Michael Killough
Michael Rogenmoser
Michal Czyz
Michaël Lefebvre
Miguel Perez Andrade
Mike Murunov
Mike Popoloski
Miodrag Milanović
Mladen Slijepcevic
Morten Borup Petersen
Mostafa Gamal
Moubarak Jeje
Muzaffer Kal
Nandu Raj
Natan Kreimer
Nathan Graybeal
Nathan Kohagen
Nathan Myers
Nazar Zibilyuk
Nick Brereton
Nikolai Kumar
Nikolay Puzanov
Noam Gallmann
Nolan Poe
Oleh Maksymenko
Patrick Creighton
Patrick Stewart
Paul Bowen-Huggett
Paul Campbell
Paul Rigge
Paul Swirhun
Paul Wright
Pawel Jewstafjew
Pawel Klopotek
Pawel Kojma
Pawel Sagan
Pengcheng Xu
@@ -236,29 +294,44 @@ Rowan Goemans
Rupert Swarbrick
Ryan Ziegler
Ryszard Rozak
Saksham Gupta
Samuel Riedel
Saqib Khan
Sean Cross
Sebastien Van Cauwenberghe
Secturion
Sergey Chusov
Sergey Fedorov
Sergi Granell
Seth Pellegrino
Shashvat Prabhu
Shogo Yamazaki
Shou-Li Hsu
Shriyans Sahoo
spomatasmd
Srinivasan Venkataramanan
Stefan Wallentowitz
Stephen Henry
Steven Hugg
Stuart Morris
sumpster
Szymon Gizler
Szymon Jędras
Sören Tempel
Sumanth Kadiyala
Sunimali Rathnayake
Teng Huang
Thomas Aldrian
Thomas Brown
Thomas Dybdahl Ahle
Thomas Santerre
Tim Hutt
Tim Snyder
Tobias Jensen
Tobias Rosenkranz
Tobias Wölfel
Todd Strader
Tom Jackson
Tom Manner
Tomasz Gorochowik
Topa Topino
@@ -267,8 +340,11 @@ Tracy Narine
Trung Nguyen
Tudor Timi
Tymoteusz Blazejczyk
Tynan McAuley
Tyrone Marhguy
Udaya Raj Subedi
Udi Finkelstein
UnsignedByte
Unai Martinez-Corral
Valentin Atepalikhin
Varun Koyyalagunta
@@ -280,12 +356,15 @@ Vito Gamberini
Wei-Lun Chiu
William D. Jones
Wilson Snyder
Wolfgang Mayerwieser
Xi Zhang
Yan Xu
Yangyu Chen
Yilin Li
Yilou Wang
Yinan Xu
Yoda Lee
Yogish Sekhar
Yossi Nivin
Yu-Sheng Lin
Yuri Victorovich
@@ -296,12 +375,7 @@ Zhen Yan
Zhou Shen
Zhouyi Shen
Zixi Li
apocelipes
dependabot[bot]
february cozzocrea
sumpster
em2machine
emmettifelts
Zubin Jain
Àlex Torregrosa
Ícaro Lima
Yogish Sekhar
ÍÍ>> Please insert into sorted position, and see header as to agreement
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Verilator Documentation
=======================
+2 -2
View File
@@ -1,5 +1,5 @@
.. comment: generated by t_lint_didnotconverge_bad
.. code-block::
-V{t#,#} 'stl' region trigger index 0 is active: @([hybrid] a)
%Error-DIDNOTCONVERGE: t/t_lint_didnotconverge_bad.v:7: Settle region did not converge after '--converge-limit' of 10000 tries
-V{t#,#} 'stl' region trigger index 0 is active: @([hybrid] b)
%Error-DIDNOTCONVERGE: Settle region did not converge after '--converge-limit' of 10000 tries
+1 -1
View File
@@ -1,4 +1,4 @@
.. comment: generated by t_lint_didnotconverge_nodbg_bad
.. code-block::
%Error-DIDNOTCONVERGE: t/t_lint_didnotconverge_bad.v:7: Settle region did not converge after '--converge-limit' of 10000 tries
%Error-DIDNOTCONVERGE: Settle region did not converge after '--converge-limit' of 10000 tries
+7
View File
@@ -0,0 +1,7 @@
.. comment: generated by t_finaldly_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 2
bit foo;
final foo <= 1; // <--- Error
+6
View File
@@ -0,0 +1,6 @@
.. comment: generated by t_finaldly_bad
.. code-block::
%Error-FINALDLY: example.v:1:13 Non-blocking assignment '<=' in final block
9 | final foo <= 1;
| ^~
+6
View File
@@ -0,0 +1,6 @@
.. comment: generated by t_lint_multidriven_proc_bad
.. code-block:: sv
:linenos:
always @(posedge clk) q <= d;
always @(posedge clk) q <= ~d;
+13
View File
@@ -0,0 +1,13 @@
.. comment: generated by t_lint_multidriven_proc_bad
.. code-block:: sv
:linenos:
integer i;
always @(posedge clk) begin
for (i = 0; i < 4; i = i + 1) q1[i] <= d[i];
end
always @(posedge clk) begin
for (i = 0; i < 4; i = i + 1) q2[i] <= ~d[i];
end
+8
View File
@@ -0,0 +1,8 @@
.. comment: generated by t_lint_multidriven_proc_bad
.. code-block::
%Warning-MULTIDRIVENPROC: example.v:1:25 Variable written to in always block also written by another always block: 'q'
: ... note: In instance 't.u1'
example.v:1:25
54 | always @(posedge clk) q <= ~d;
| ^
@@ -0,0 +1,12 @@
.. code-block:: sv
:linenos:
:emphasize-lines: 3,6
module t(input logic clk, input logic d, output logic q);
initial q = 1'b0; // <--- Warning
always_ff @(posedge clk) begin
q <= d; // <--- Warning
end
endmodule
+7
View File
@@ -0,0 +1,7 @@
.. comment: generated by t_lint_notredop_bad
.. code-block::
%Error-NOTREDOP: example.v:1:17 Logical not directly before reduction operator is illegal
: ... Suggest use parentheses, e.g. '!(|expr)'
12 | assign y[0] = !|v;
| ^
+6
View File
@@ -0,0 +1,6 @@
.. comment: generated by t_lint_similarname_bad
.. code-block:: sv
:linenos:
reg i;
wire I;
+9
View File
@@ -0,0 +1,9 @@
.. comment: generated by t_lint_similarname_bad
.. code-block::
%Warning-SIMILARNAME: example.v:1:8 Declaration overlaps another with different case: 'I'
13 | wire I;
| ^
example.v:1:7 ... Location of original declaration
12 | reg i;
| ^
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
****************
Revision History
+55 -23
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _connecting:
@@ -28,17 +29,41 @@ The generated model class file manages all internal state required by the
model, and exposes the following interface that allows interaction with the
model:
* Top level IO ports are exposed as references to the appropriate internal
- Top level IO ports are exposed as references to the appropriate internal
equivalents.
* Public top level module instances are exposed as pointers to allow access
- Public top level module instances are exposed as pointers to allow access
to ``/* verilator public */`` items.
* The root of the design hierarchy (as in SystemVerilog ``$root``) is
- The root of the design hierarchy (as in SystemVerilog ``$root``) is
exposed via the ``rootp`` member pointer to allow access to model
internals, including ``/* verilator public_flat */`` items.
.. _model header include macros:
Model Header Include Macros
---------------------------
Code compiled with the generated :file:`{prefix}.mk`, or with the CMake
``verilate()`` command, gets preprocessor macros that expand to the model
header includes, so user C++ need not hard-code the :vlopt:`--prefix`:
.. code-block:: C++
#include VM_PREFIX_INCLUDE // e.g. <Vtop.h>
#include VM_PREFIX_INCLUDE_DPI // e.g. <Vtop__Dpi.h>
``VM_PREFIX_INCLUDE_DPI`` is defined only when Verilator generates the
:file:`{prefix}__Dpi.h` header, which is the case for designs with DPI and
also for public-signal access such as :vlopt:`--public-flat-rw`. Using it
otherwise is a compile-time error.
A target built from several models defines each macro once, naming the
first model, as one target has one set of preprocessor definitions. Code
that must reach a second model's header names it directly.
.. _porting from pre 4.210:
Model interface changes in version 4.210
@@ -58,22 +83,22 @@ This means that user code that accesses internal signals in the model
(likely including ``/* verilator public_flat */`` signals, as they are
often inlined into the root scope) will need to be updated as follows:
* No change required for accessing top level IO signals. These are directly
- No change required for accessing top level IO signals. These are directly
accessible in the model class via references.
* No change required for accessing ``/* verilator public */`` items. These
- No change required for accessing ``/* verilator public */`` items. These
are directly accessible via sub-module pointers in the model class.
* Accessing any other internal members, including
``/* verilator public_flat */`` items requires the following changes:
- Accessing any other internal members, including ``/* verilator
public_flat */`` items requires the following changes:
* Additionally include :file:`{prefix}___024root.h`. This header defines
- Additionally include :file:`{prefix}___024root.h`. This header defines
type of the ``rootp`` pointer within the model class. Note the
``__024`` substring is the Verilator escape sequence for the ``$``
character, i.e.: ``rootp`` points to the Verilated SystemVerilog
``$root`` scope.
* Replace ``modelp->internal->member`` references with
- Replace ``modelp->internal->member`` references with
``modelp->rootp->internal->member`` references, which contain one
additional indirection via the ``rootp`` pointer.
@@ -91,13 +116,17 @@ model.
Refer to ``examples/make_tracing_c`` in the distribution for a detailed
commented example.
Top level IO signals are read and written as members of the model. You call
the model's ``eval()`` method to evaluate the model. When the simulation is
complete call the model's ``final()`` method to execute any SystemVerilog
final blocks, and complete any assertions. If using :vlopt:`--timing`,
there are two additional functions for checking if there are any events
pending in the simulation due to delays, and for retrieving the simulation
time of the next delayed event. See :ref:`Evaluation Loop`.
Top level IO signals are read and written as members of the model. All
inputs must be sanitized, that is have no bits set above those
corresponding to the width of the Verilog construct;
:vlopt:`--runtime-debug` will assert this is correct.
Call the model's ``eval()`` method to evaluate the model. When the
simulation is complete call the model's ``final()`` method to execute any
SystemVerilog final blocks, and complete any assertions. If using
:vlopt:`--timing`, there are two additional functions for checking if there
are any events pending in the simulation due to delays, and for retrieving
the simulation time of the next delayed event. See :ref:`Evaluation Loop`.
Connecting to SystemC
@@ -184,7 +213,7 @@ Verilog, put in our.v:
initial begin
$display("%x + %x = %x", 1, 2, add(1,2));
endtask
end
Then after Verilating, Verilator will create a file Vour__Dpi.h with the
prototype to call this function:
@@ -202,6 +231,9 @@ command line, or the link), you'd then:
#include "Vour__Dpi.h"
int add(int a, int b) { return a+b; }
Rather than hard-coding the prefix, ``#include VM_PREFIX_INCLUDE_DPI`` may
be used instead; see :ref:`Model Header Include Macros`.
DPI System Task/Functions
-------------------------
@@ -210,9 +242,9 @@ Verilator extends the DPI format to allow using the same scheme to
efficiently add system functions. Use a dollar-sign prefixed system
function name for the import, but note it must be escaped.
.. code-block:: sv
.. code-block::
export "DPI-C" function integer \$myRand;
import "DPI-C" function integer \$myRand;
initial $display("myRand=%d", $myRand());
@@ -502,9 +534,9 @@ described above is just a wrapper which calls these two functions.
3. If using delays and :vlopt:`--timing`, there are two additional methods
the user should call:
* ``designp->eventsPending()``, which returns ``true`` if there are any
- ``designp->eventsPending()``, which returns ``true`` if there are any
delayed events pending,
* ``designp->nextTimeSlot()``, which returns the simulation time of the
- ``designp->nextTimeSlot()``, which returns the simulation time of the
next delayed event. This method can only be called if
``designp->eventsPending()`` returned ``true``.
+6 -4
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*******************************
Contributing and Reporting Bugs
@@ -86,7 +87,8 @@ Please refer to `sv-bugpoint README
<https://github.com/antmicro/sv-bugpoint/blob/main/README.md>`_ for more
information on how to use `sv-bugpoint`.
.. Contributing
.. ============
..
Contributing
============
.. include:: ../CONTRIBUTING.rst
+19 -18
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
************************
Contributors and Origins
@@ -29,10 +30,10 @@ Alliance <https://chipsalliance.org>`_, and `Antmicro Ltd
Previous major corporate sponsors of Verilator, by providing significant
contributions of time or funds include: Antmicro Ltd., Atmel Corporation,
Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Fractile
Ltd., Hicamp Systems, Intel Corporation, Marvell Inc., Mindspeed Technologies
Inc., MicroTune Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus
Networks Inc., SiCortex Inc, Shunyao CAD, Tenstorrent USA, Inc. and Western
Digital Inc.
Ltd., Hicamp Systems, Intel Corporation, Marvell Inc., Mindspeed
Technologies Inc., MicroTune Inc., picoChip Designs Ltd., Sun Microsystems
Inc., Nauticus Networks Inc., SiCortex Inc, Shunyao CAD, Tenstorrent USA,
Inc. and Western Digital Inc.
The contributors of major functionality are: Jeremy Bennett, Krzysztof
Bieganski, Byron Bradley, Lane Brooks, John Coiner, Duane Galbi, Arkadiusz
@@ -142,18 +143,18 @@ Krzysztof Obłonczek, Danny Oler, Andreas Olofsson, Baltazar Ortiz,
Aleksander Osman, Don Owen, Tim Paine, Deepa Palaniappan, James Pallister,
Vassilis Papaefstathiou, Sanggyu Park, Brad Parker, Risto Pejašinović, Seth
Pellegrino, Joel Peltonen, Morten Borup Petersen, Dan Petrisko, Thanh Tung
Pham, Wesley Piard, Maciej Piechotka, David Pierce, Cody Piersall,
T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, Tuomas Poikela,
George Polack, David Poole, Michael Popoloski, Roman Popov, Aylon Chaim
Porat, Oron Port, Rich Porter, Rick Porter, Stefan Post, Niranjan Prabhu,
Damien Pretet, Harald Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark
Jackson Pulver, Prateek Puri, Nikolay Puzanov, Han Qi, Jiacheng Qian,
Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen Qin, Frank Qiu, Nandu Raj,
Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh
Redford, Odd Magne Reitan, Frédéric Requin, Wajahat Riaz, Dustin Richmond,
Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, Oleg Rodionov,
Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen Roodselaar, Arthur
Rosa, Tobias Rosenkranz, Yernagula Roshit, Diego Roux, Ryszard Rozak, Dan
Pham, Wesley Piard, Maciej Piechotka, David Pierce, Cody Piersall, T.
Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, Tuomas Poikela, George
Polack, David Poole, Michael Popoloski, Roman Popov, Aylon Chaim Porat,
Oron Port, Rich Porter, Rick Porter, Stefan Post, Niranjan Prabhu, Damien
Pretet, Harald Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark Jackson
Pulver, Prateek Puri, Nikolay Puzanov, Han Qi, Jiacheng Qian, Marshal Qiao,
Raynard Qiao, Yujia Qiao, Jasen Qin, Frank Qiu, Nandu Raj, Kamil Rakoczy,
Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh Redford, Odd
Magne Reitan, Frédéric Requin, Wajahat Riaz, Dustin Richmond, Samuel
Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, Oleg Rodionov, Ludwig
Rogiers, Paul Rolfe, Michail Rontionov, Arjen Roodselaar, Arthur Rosa,
Tobias Rosenkranz, Yernagula Roshit, Diego Roux, Ryszard Rozak, Dan
Ruelas-Petrisko, Luca Rufer, Huang Rui, Graham Rushton, Jan Egil Ruud,
Denis Rystsov, Pawel Sagan, Robert Sammelson, Adrian Sampson, John
Sanguinetti, Josep Sans, Dave Sargeant, Luca Sasselli, Philippe Sauter,
+28 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _verilator control files:
@@ -100,6 +101,27 @@ The grammar of control commands is as follows:
Same as :option:`/*verilator&32;forceable*/` metacomment.
.. option:: fsm_register_wrapper -module "<modulename>" -d "<port>" -q "<port>" -clock "<port>" [-reset "<port>"] [-reset_value "<param>"]
Declares that the specified module is a transparent FSM state-register
wrapper for FSM coverage extraction. One declaration applies to all
instances of that module.
The ``-d`` option names the wrapper input port carrying next-state data.
The ``-q`` option names the wrapper output port carrying registered state.
The ``-clock`` option names the wrapper clock port.
Verilator does not infer wrapper semantics from module or port naming
conventions. A wrapper module must be declared with this option before
Verilator will use instances of it to extract FSM state and transition
coverage.
The ``-reset`` and ``-reset_value`` options are optional. Reset arcs are
emitted only when both the reset polarity can be inferred from the
wrapper's event control and ``-reset_value`` names a static parameter value.
If reset metadata is incomplete, Verilator may still emit FSM state and
transition coverage without reset arcs.
.. option:: full_case -file "<filename>" -lines <lineno>
Same as ``//synthesis full_case``. When these synthesis directives
@@ -166,6 +188,10 @@ The grammar of control commands is as follows:
.. option:: isolate_assignments -module "<modulename>" [-task "<taskname>"] -var "<signame>"
Deprecated and has no effect (ignored).
In versions before 5.050:
Used to indicate that the assignments to this signal in any blocks
should be isolated into new blocks. Same as
:option:`/*verilator&32;isolate_assignments*/` metacomment.
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*********
Copyright
+3 -10
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Deprecations
============
@@ -17,14 +18,6 @@ C++14 compiler support
the Ubuntu LTS versions of GCC and clang use C++20 by default, estimated
May 2028.)
`--structs-packed` option
The :vlopt:`--structs-packed` option was introduced when Verilator was
first implementing unpacked structs. That feature has been stable now
for multiple years, so :vlopt:`--structs-packed` should no longer be
used. Thus :vlopt:`--structs-packed` will change to a no-operation flag
and the related :option:`UNPACKED` warning will never be issued no
sooner than September 2026.
tcmalloc support
Verilator currently supports the default malloc, tcmalloc, or jemalloc.
As jemalloc has better performance, support for tcmalloc may be removed
+5 -3
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _environment:
@@ -89,7 +90,8 @@ associated programs.
.. option:: VERILATOR_GDB
If set, the command to run when using the :vlopt:`--gdb` option, such as
"ddd". If not specified, it will use "gdb".
"ddd". If not specified, it will use "gdb" if available, otherwise
"lldb" if available.
.. option:: VERILATOR_NUMA_STRATEGY
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _example create-binary execution:
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _example c++ execution:
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
First you need Verilator installed, see :ref:`Installation`. In brief, if
you installed Verilator using the package manager of your operating system,
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _examples in the distribution:
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _example systemc execution:
+7 -6
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _examples:
@@ -9,10 +10,10 @@ Examples
This section covers the following examples:
* :ref:`Example Create-Binary Execution`
* :ref:`Example C++ Execution`
* :ref:`Example SystemC Execution`
* :ref:`Examples in the Distribution`
- :ref:`Example Create-Binary Execution`
- :ref:`Example C++ Execution`
- :ref:`Example SystemC Execution`
- :ref:`Examples in the Distribution`
.. toctree::
:maxdepth: 1
+35 -5
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _simulation runtime arguments:
@@ -20,6 +21,13 @@ Summary:
Options:
.. option:: +verilator+assert+lock
Only allow command line options to disable / enable assertions.
Disables RTL from changing assertion handling via ``$asserton``,
``$assertoff``, and ``$assertcontrol``. Also prevents ``VerilatedContext*``
assertion control functions from updating assertion handling.
.. option:: +verilator+coverage+file+<filename>
When a model was Verilated using :vlopt:`--coverage`, sets the filename
@@ -48,6 +56,11 @@ Options:
Display help and exit.
.. option:: +verilator+log+file+<filename>
Log all stdout and stderr to the specified output filename. If not specified
the normal stdout/stderr streams are used.
.. option:: +verilator+noassert
Disable assert checking per runtime argument. This is the same as
@@ -108,13 +121,16 @@ Options:
When a model was Verilated using :vlopt:`--x-initial unique
<--x-initial>`, sets the simulation runtime initialization technique. 0
= Reset to zeros. 1 = Reset to all-ones. 2 = Randomize. See
:ref:`Unknown States`.
:ref:`Unknown States`. Default is 0.
.. option:: +verilator+seed+<value>
For $random and :vlopt:`--x-initial unique <--x-initial>`, set the
simulation runtime random seed value. If zero or not specified picks a
value from the system random number generator.
simulation runtime random seed value. If not specified, the seed
defaults to 1. If specified as 0, a non-zero seed is generated at
startup; the picked value is exposed through ``$get_initial_random_seed``
so the run can be reproduced later by passing
``+verilator+seed+<that_value>``.
.. option:: +verilator+solver+file+<filename>
@@ -130,6 +146,20 @@ Options:
Displays program version and exits.
.. option:: +verilator+vpi+<library>[:<bootstrap>]
Load a VPI shared library before simulation starts. Only available when the
model was Verilated with :vlopt:`--vpi` and :vlopt:`--main` (or
:vlopt:`--binary`). ``<library>`` is the path to the shared library. If
``:<bootstrap>`` is given, that named no-argument function is called;
otherwise the library's ``vlog_startup_routines`` array (IEEE 1800 38.37.2) is
invoked. May be repeated to load multiple libraries.
Runtime loading is supported on POSIX platforms only (it relies on the
executable exporting its VPI symbols to the loaded library); on Windows the
argument is rejected and the VPI code must instead be statically linked
into the model.
.. option:: +verilator+wno+unsatconstr+<value>
Disable unsatisfied constraint warnings at simulation runtime. When set to
+154 -28
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
===================
verilator Arguments
@@ -113,6 +114,19 @@ Summary:
In versions before 5.038, these were disabled by default, and `--assert`
or `--assert-case` was required to enable case assertions.
.. option:: --assert-unroll-limit <iterations>
Deprecated and has no effect (ignored).
In versions before 5.052:
Rarely needed. Specifies the maximum repetition or range count Verilator
will unroll inside an SVA concurrent assertion (e.g. ``[*N]``, ``[->M:N]``,
``always[lo:hi]``). Beyond this, the assertion is rejected with an error
so that pathological counts do not blow up compile time or memory.
Defaults to 1024. Increase if a design needs larger repetition counts.
.. option:: --autoflush
After every $display or $fdisplay, flush the output stream. This ensures
@@ -302,12 +316,53 @@ Summary:
Enables basic block line coverage analysis. See :ref:`Line Coverage`.
.. option:: --coverage-max-bins <value>
Rarely needed. Specifies the maximum number of bins one covergroup bins
declaration of an integral coverpoint may create: an array of bins such
as ``bins b[] = {[0:$]}``, automatic bins ``bins auto[N]``, or the
automatic bins of a coverpoint from ``option.auto_bin_max``. Defaults to
1024, and may be at most 4294967295 (``2**32 - 1``).
A larger array of bins is ignored with a :option:`COVERIGN` warning, a
larger ``bins auto[N]`` is an error, and a larger
``option.auto_bin_max`` is reduced to this limit with a
:option:`COVERIGN` warning. Increasing the limit increases the memory
the model uses for the bins. See also
:vlopt:`--coverage-max-real-bins`.
.. option:: --coverage-max-real-bins <value>
Rarely needed. Specifies the maximum number of values of one array of
bins of a coverpoint of a ``real`` expression, such as
``bins b[] = {[1:10]}``, each of which is a bin compared separately.
Defaults to 1024, and may be at most 4294967295 (``2**32 - 1``).
A larger array of bins is ignored with a :option:`COVERIGN` warning.
Increasing the limit increases the size of the generated code, which
grows with the number of these bins. See also
:vlopt:`--coverage-max-bins`.
.. option:: --coverage-max-width <width>
Rarely needed. Specify the maximum bit width of a signal subject to
toggle coverage. Defaults to 256, as covering large vectors may greatly
slow coverage simulations.
.. option:: --coverage-per-instance
For Verilator-inserted coverage, preserve generated coverage counters and
``.dat`` records per hierarchy instance. This option must be specified when
Verilating the model, together with one or more coverage instrumentation
options, for example :vlopt:`--coverage`, :vlopt:`--coverage-line`,
:vlopt:`--coverage-toggle`, :vlopt:`--coverage-expr`,
:vlopt:`--coverage-fsm`, or :vlopt:`--coverage-user`. It may increase
generated model size, counter memory, coverage write time, and ``.dat`` file
size.
This does not affect SystemVerilog ``cover``, which uses the IEEE-specified
coverage option ``per_instance``.
.. option:: --coverage-toggle
Enables adding signal toggle coverage. See :ref:`Toggle Coverage`.
@@ -320,8 +375,8 @@ Summary:
.. option:: --coverage-user
Enables adding user-inserted functional coverage. See :ref:`User
Coverage`.
Enables adding user-inserted functional covergroup coverage. See
:ref:`Covergroup Coverage`.
.. option:: -D<var>=<value>
@@ -467,6 +522,10 @@ Summary:
Rarely needed - for developer use. Enable all dumping in the given
source file at level 3.
.. option:: --dump-ast-patterns
Rarely needed. Enable dumping AstNodeExpr pattern statistics.
.. option:: --dump-defines
With :vlopt:`-E`, suppress normal output, and instead print a list of
@@ -634,8 +693,28 @@ Summary:
.. option:: -fno-assemble
.. option:: -fno-bit-scan-loops
Rarely needed. Disable converting bit counting loops into built-in operations.
.. option:: -fno-case
Rarely needed. Disable all case statement optimizations.
Alias for all other `-fno-case-*` options.
.. option:: -fno-case-decoder
Rarely needed. Disable converting case statements into decoder tables.
.. option:: -fno-case-table
Rarely needed. Disable converting case statements into table lookups.
.. option:: -fno-case-tree
Rarely needed. Disable converting case statements into bit-wise branch trees.
.. option:: -fno-combine
.. option:: -fno-const
@@ -654,6 +733,8 @@ Summary:
.. option:: -fno-dead-cells
.. option:: -fno-dead-methods
.. option:: -fno-dedup
.. option:: -fno-dfg
@@ -667,6 +748,10 @@ Summary:
.. option:: -fno-dfg-break-cycles
Deprecated and has no effect (ignored).
In versions before 5.052:
Rarely needed. Disable breaking combinational cycles during DFG.
.. option:: -fno-dfg-peephole
@@ -714,18 +799,51 @@ Summary:
this is not recommended as may cause additional warnings and ordering
issues.
.. option:: -fno-ico-change-detect
Rarely needed. Disable input change detection in the input combinational
('ico') region. With change detection enabled (the default, unless
:vlopt:`--vpi` is passed), the input combinational logic is evaluated only
when a top level input has actually changed, rather than unconditionally on
the first scheduling iteration.
The change detection logic assumes a top level input only ever changes
externally between evaluations. The optimization is automatically disabled
for top level input signals that are written within the design. Accesses via
the VPI cannot be analyzed at compile time, therefore :vlopt:`--vpi`
disables this optimization for all inputs; it may be turned back on by
explicitly passing :vlopt:`-fico-change-detect <-fno-ico-change-detect>`.
.. option:: -fno-inline
Rarely needed. Disable module inlining.
.. option:: -fno-inline-cfuncs
Rarely needed. Disable inlining of small generated C++ functions into their
callers.
This optimization is automatically disabled when :vlopt:`--prof-cfuncs` is
used.
.. option:: -fno-inline-funcs
Rarely needed. Disable inlining of SystemVerilog functions and tasks.
.. option:: -fno-inline-funcs-eager
Rarely needed. Disable eager inlining of SystemVerilog functions and tasks.
.. option:: -fno-life
.. option:: -fno-life-post
.. option:: -fno-lift-expr
Deprecated and has no effect (ignored).
In versions before 5.054: Disable lifting of expressions out of statements.
.. option:: -fno-localize
.. option:: -fno-merge-cond
@@ -734,6 +852,11 @@ Summary:
.. option:: -fno-merge-const-pool
Deprecated and has no effect (ignored).
In versions before 5.054: Disable merging constant pool entries that have
the same value but different data types.
.. option:: -fno-reloop
.. option:: -fno-reorder
@@ -758,6 +881,14 @@ Summary:
automatically. Variables explicitly annotated with
:option:`/*verilator&32;split_var*/` are still split.
.. option:: --fourstate
Enables four-state logic support. Experimental, for developer use only.
.. option:: --no-fourstate
Disables four-state logic support which is the default. Exists for forward compatibility.
.. option:: --fslice-element-limit
Rarely needed. Set the maximum array size (number of elements) for slice
@@ -851,7 +982,7 @@ Summary:
:file:`*.mk` files.
Feature may be one of the following: COROUTINES, DEV_ASAN, DEV_GCOV,
SYSTEMC.
SYSTEMC, TSAN.
.. option:: --getenv <variable>
@@ -913,27 +1044,21 @@ Summary:
.. option:: --inline-cfuncs <value>
Inline small C++ function (internal AstCFunc) calls directly into their
callers when the function has at most <value> nodes. This reduces
function call overhead when :vlopt:`--output-split-cfuncs` places
functions in separate compilation units that the C++ compiler cannot
inline.
Tune the inlining of small generated C++ function. Functions no bigger than
<value> nodes will be inlined if possible. The default is 20.
Set to 0 to disable this optimization. The default is 20.
This optimization is automatically disabled when :vlopt:`--prof-cfuncs`
or :vlopt:`--trace` is used.
See also :vlopt:`--inline-cfuncs-product` and :vlopt:`-fno-inline-cfuncs`.
.. option:: --inline-cfuncs-product <value>
Tune the inlining of C++ function (internal AstCFunc) calls for larger
functions. When a function is too large to always inline (exceeds
:vlopt:`--inline-cfuncs` threshold), it may still be inlined if the
function size multiplied by the number of call sites is at most <value>.
Tune the inlining of small generated C++ function. If a function's node
count multiplied by the number of calls is not bigger than <value>, the
function will be inlined if possible.
This allows functions that are called only once or twice to be inlined
even if they exceed the small function threshold. Set to 0 to only inline
functions below the :vlopt:`--inline-cfuncs` threshold. The default is 200.
This allows functions that are called only once or twice to be inlined even
if they exceed the small function threshold. The default is 200.
See also :vlopt:`--inline-cfuncs` and :vlopt:`-fno-inline-cfuncs`.
.. option:: --inline-mult <value>
@@ -1140,6 +1265,8 @@ Summary:
.. option:: --max-num-width <value>
Set the maximum number literal width (e.g., in 1024'd22 the 1024).
This also limits SVA cycle delay and temporal bound values.
Defaults to 64K.
.. option:: --Mdir <directory>
@@ -1701,12 +1828,11 @@ Summary:
.. option:: --structs-packed
Deprecated; discontinue use of this option.
Removed in 5.054.
Converts all unpacked structures to packed structures, and issues an
:option:`UNPACKED` warning. Specifying this option allows for backward
compatibility with versions before Verilator 5.006, when Verilator would
always pack unpacked structures.
Converted all unpacked structures to packed structures, Specifying this
option allowed for backward compatibility with versions before Verilator
5.006, when Verilator would always pack unpacked structures.
.. option:: -sv
@@ -2178,7 +2304,7 @@ Summary:
If using `--x-assign unique`, use the
:vlopt:`+verilator+rand+reset+2 <+verilator+rand+reset+\<value\>>`
runtime option, and seed the runtime random number generator such that
each regression run gets a different randomization sequence with
each regression test run gets a different randomization sequence with
:vlopt:`+verilator+seed+\<value\>`. You'll probably also want to print
any seeds selected, and code to enable rerunning with that same seed,
so you can reproduce bugs.
@@ -2207,7 +2333,7 @@ Summary:
If using `--x-initial unique`, use the
:vlopt:`+verilator+rand+reset+2 <+verilator+rand+reset+\<value\>>`
runtime option, and seed the runtime random number generator such that
each regression run gets a different randomization sequence with
each regression test run gets a different randomization sequence with
:vlopt:`+verilator+seed+\<value\>`. You'll probably also want to print
any seeds selected, and code to enable rerunning with that same seed,
so you can reproduce bugs.
+34 -6
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_coverage
==================
@@ -38,6 +39,10 @@ verilator_coverage Example Usage
verilator_coverage --annotate obj_dir coverage.dat
verilator_coverage --report summary coverage.dat
verilator_coverage --report hier --levels 3 coverage.dat
verilator_coverage --write merged.dat coverage.dat ...
verilator_coverage --write-info merged.info coverage.dat ...
@@ -128,10 +133,14 @@ verilator_coverage Arguments
.. option:: --filter-type <regex>
Skips records of coverage types that matches with <regex>
Possible values are `toggle`, `line`, `branch`, `expr`, `user`,
`fsm_state`, `fsm_arc` and a wildcard with `\*` or `?`. The default
value is `\*`.
Keeps records of coverage types that matches with <regex>
Possible values are `toggle`, `line`, `branch`, `expr`, `covergroup`,
`user`, `fsm_state`, `fsm_arc` and a wildcard with `\*` or `?`. The
default value is `\*`.
The `covergroup` type represents SystemVerilog functional coverage
including covergroups, coverpoints, bins, and cross coverage as defined
in IEEE 1800-2023 Section 19.
.. option:: --help
@@ -143,6 +152,13 @@ verilator_coverage Arguments
By default, reset arcs are tracked but summarized separately from the
non-reset FSM arcs.
.. option:: --levels <depth>
With :option:`--report hierarchy`, limits displayed hierarchy depth.
Deeper descendants still roll-up into the visible parent totals. A depth
of 0 shows the top-level hierarchy roll-up. If negative or omitted, all
depths are shown.
.. option:: --rank
Prints an experimental report listing the relative importance of each
@@ -155,6 +171,18 @@ verilator_coverage Arguments
contribute to overall coverage if all tests are run in the order of
highest to the lowest rank.
.. option:: --report <kind>[,<kind>...]
Generates a human-consumable report. Supported report kinds are
``summary``, ``hier``, and ``hierarchy``. Multiple report kinds may be
comma-separated, for example ``summary,hier``. With no explicit
:option:`--report`, the legacy flat summary is printed. ``summary`` is
equivalent to the flat type summary. ``hier`` and ``hierarchy`` build a
deterministic hierarchy roll-up from ``hier`` fields. Collapsed wildcard
hierarchy can be reported, but it is not precise per-instance coverage.
If no hierarchy fields are present, a warning is printed and the flat
summary is shown instead.
.. option:: --unlink
With :option:`--write`, unlink all input files after the output has been
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_gantt
===============
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_profcfunc
===================
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*********************************
Executable and Argument Reference
+26 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
===================
Language Extensions
@@ -293,6 +294,25 @@ or "`ifdef`"'s may break other tools.
(if appropriate :vlopt:`--coverage` flags are passed) after being
disabled earlier with :option:`/*verilator&32;coverage_off*/`.
.. option:: /*verilator&32;dpi_c_decl "<C function declaration>"*/
Specifies C function declaration that will be emitted for given DPI-C
function into the Verilator-generated __Dpi.h header, replacing the declaration
that Verilator would build by default using the Verilog function signature.
This enables use of C functions with types not specified in the
standard. For example, it enables use of functions that return ``char*``:
.. code-block:: sv
module t;
import "DPI-C" function string getenv(input string arg) /*verilator dpi_c_decl "char* getenv(const char*)"*/;
initial begin
$display("%s", getenv("HOME"));
end
endmodule
.. option:: /*verilator&32;fargs <arguments>*/
For Verilator developers only. When a source file containing these `fargs`
@@ -341,6 +361,10 @@ or "`ifdef`"'s may break other tools.
.. option:: /*verilator&32;isolate_assignments*/
Deprecated and has no effect (ignored).
In versions before 5.050:
Used after a signal declaration to indicate the assignments to this
signal in any blocks should be isolated into new blocks. When large
combinatorial block results in a :option:`UNOPTFLAT` warning, attaching
+17 -16
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******************************
FAQ/Frequently Asked Questions
@@ -82,17 +83,17 @@ the licenses for details.
Some examples:
* Any SystemVerilog or other input fed into Verilator remains your own.
- Any SystemVerilog or other input fed into Verilator remains your own.
* Any of your VPI/DPI C++ routines that Verilator calls remain your own.
- Any of your VPI/DPI C++ routines that Verilator calls remain your own.
* Any of your main() C++ code that calls into Verilator remains your own.
- Any of your main() C++ code that calls into Verilator remains your own.
* If you change Verilator itself, for example, changing or adding a file
- If you change Verilator itself, for example, changing or adding a file
under the src/ directory in the repository, you must make the source code
available under the GNU Lesser Public License.
* If you change a header Verilator provides, for example, under include/ in
- If you change a header Verilator provides, for example, under include/ in
the repository, you must make the source code available under the GNU
Lesser Public License.
@@ -384,33 +385,33 @@ example of how to do this.
How do I get faster build times?
""""""""""""""""""""""""""""""""
* When running make, pass the make variable VM_PARALLEL_BUILDS=1, so that
- When running make, pass the make variable VM_PARALLEL_BUILDS=1, so that
builds occur in parallel. Note this is now set by default if an output
file is large enough to be split due to the :vlopt:`--output-split`
option.
* Verilator emits any infrequently executed "cold" routines into separate
- Verilator emits any infrequently executed "cold" routines into separate
__Slow.cpp files. This can accelerate compilation as optimization can be
disabled on these routines. See the OPT_FAST and OPT_SLOW make variables
and :ref:`Benchmarking & Optimization`.
* Use a recent compiler. Newer compilers tend to be faster.
- Use a recent compiler. Newer compilers tend to be faster.
* Compile in parallel on many machines and use caching; see the web for the
- Compile in parallel on many machines and use caching; see the web for the
ccache, sccache, distcc, or icecream packages. ccache will skip GCC runs
between identical source builds, even across different users. If ccache
was installed when Verilator was built, it is used, or see OBJCACHE
environment variable to override this. Also see the
:vlopt:`--output-split` option and :ref: `Profiling ccache efficiency`.
* To reduce the compile time of classes that use a Verilated module (e.g.,
- To reduce the compile time of classes that use a Verilated module (e.g.,
a top CPP file) you may wish to add a
:option:`/*verilator&32;no_inline_module*/` metacomment to your top-level
module. This will decrease the amount of code in the model's Verilated
class, improving compile times of any instantiating top-level C++ code,
at a relatively small cost of execution performance.
* Use :ref:`hierarchical verilation`.
- Use :ref:`hierarchical verilation`.
Why do so many files need to recompile when I add a signal?
@@ -498,12 +499,12 @@ equal, the best performance is when Verilator sees all of the design. So,
look at the hierarchy of your design, labeling instances as to if they are
SystemC or Verilog. Then:
* A module with only SystemC instances below must be SystemC.
- A module with only SystemC instances below must be SystemC.
* A module with a mix of Verilog and SystemC instances below must be
- A module with a mix of Verilog and SystemC instances below must be
SystemC. (As Verilator cannot connect to lower-level SystemC instances.)
* A module with only Verilog instances below can be either, but for best
- A module with only Verilog instances below can be either, but for best
performance should be Verilog. (The exception is if you have a design
that is instantiated many times; in this case, Verilating one of the
lower modules and instantiating that Verilated instances multiple times
+64 -60
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*****
Files
@@ -42,138 +43,141 @@ For --cc/--sc, it creates:
.. list-table::
* - *{prefix}*.json
- - *{prefix}*.json
- JSON build definition compiling (from --make json)
* - *{prefix}*.mk
- - *{prefix}*.mk
- Make include file for compiling (from --make gmake)
* - *{prefix}*\ _classes.mk
- - *{prefix}*\ _classes.mk
- Make include file with class names (from --make gmake)
* - *{prefix}*.h
- - *{prefix}*.h
- Model header
* - *{prefix}*.cpp
- - *{prefix}*.cpp
- Model C++ file
* - *{prefix}*\ ___024root.h
- - *{prefix}*\ ___024root.h
- Top-level internal header file (from SystemVerilog $root)
* - *{prefix}*\ ___024root.cpp
- - *{prefix}*\ ___024root.cpp
- Top-level internal C++ file (from SystemVerilog $root)
* - *{prefix}*\ ___024root\ *{__n}*.cpp
- - *{prefix}*\ ___024root\ *{__n}*.cpp
- Additional top-level internal C++ files
* - *{prefix}*\ ___024root__Slow\ *{__n}*.cpp
- - *{prefix}*\ ___024root__Slow\ *{__n}*.cpp
- Infrequent cold routines
* - *{prefix}*\ ___024root__Trace\ *{__n}*.cpp
- - *{prefix}*\ ___024root__Trace\ *{__n}*.cpp
- Wave file generation code (from --trace-\*)
* - *{prefix}*\ ___024root__Trace__Slow\ *{__n}*.cpp
- - *{prefix}*\ ___024root__Trace__Slow\ *{__n}*.cpp
- Wave file generation code (from --trace-\*)
* - *{prefix}*\ __Dpi.h
- - *{prefix}*\ __Dpi.h
- DPI import and export declarations (from --dpi)
* - *{prefix}*\ __Dpi.cpp
- - *{prefix}*\ __Dpi.cpp
- Global DPI export wrappers (from --dpi)
* - *{prefix}*\ __Dpi_Export\ *{__n}*.cpp
- - *{prefix}*\ __Dpi_Export\ *{__n}*.cpp
- DPI export wrappers scoped to this particular model (from --dpi)
* - *{prefix}*\ __Inlines.h
- - *{prefix}*\ __Inlines.h
- Inline support functions
* - *{prefix}*\ __Syms.h
- - *{prefix}*\ __Syms.h
- Global symbol table header
* - *{prefix}*\ __Syms.cpp
- - *{prefix}*\ __Syms.cpp
- Global symbol table C++
* - *{prefix}{each_verilog_module}*.h
- - *{prefix}{each_verilog_module}*.h
- Lower level internal header files
* - *{prefix}{each_verilog_module}*.cpp
- - *{prefix}{each_verilog_module}*.cpp
- Lower level internal C++ files
* - *{prefix}{each_verilog_module}{__n}*.cpp
- - *{prefix}{each_verilog_module}{__n}*.cpp
- Additional lower C++ files
For --hierarchical mode, it creates:
.. list-table::
* - V\ *{hier_block}*\ /
- - V\ *{hier_block}*/
- Directory to Verilate each hierarchical block (from --hierarchical)
* - *{prefix}*\ __hierVer.d
- - *{prefix}*\ __hierVer.d
- Make dependencies of the top module (from --hierarchical)
* - *{prefix}*\ _hier.mk
- - *{prefix}*\ _hier.mk
- Make file for hierarchical blocks (from --make gmake)
* - *{prefix}*\ __hierMkJsonArgs.f
- - *{prefix}*\ __hierMkJsonArgs.f
- Arguments for hierarchical Verilation (from --make json)
* - *{prefix}*\ __hierMkArgs.f
- - *{prefix}*\ __hierMkArgs.f
- Arguments for hierarchical Verilation (from --make gmake)
* - *{prefix}*\ __hierParameters.v
- - *{prefix}*\ __hierParameters.v
- Module parameters for hierarchical blocks
* - *{prefix}*\ __hier.dir
- Directory to store .dot, .vpp, .tree of top module (from --hierarchical)
- - *{prefix}*\ __hier.dir
- Directory to store .dot, .vpp, .tree of top module (from
--hierarchical)
In specific debug and other modes, it also creates:
.. list-table::
* - *{prefix}*.sarif
- - *{prefix}*.sarif
- SARIF diagnostics (from --diagnostics-sarif)
* - *{prefix}*.tree.json
- - *{prefix}*.tree.json
- JSON tree information (from --json-only)
* - *{prefix}*.tree.meta.json
- - *{prefix}*.tree.meta.json
- JSON tree metadata (from --json-only)
* - *{prefix}*\ __cdc.txt
- - *{prefix}*\ __cdc.txt
- Clock Domain Crossing checks (from --cdc)
* - *{prefix}*\ __stats.txt
- - *{prefix}*\ __stats.txt
- Statistics (from --stats)
* - *{prefix}*\ __idmap.txt
- - *{prefix}*\ __idmap.txt
- Symbol demangling (from --protect-ids)
* - *{prefix}*\ __ver.d
- - *{prefix}*\ __ver.d
- Make dependencies (from -MMD)
* - *{prefix}*\ __verFiles.dat
- - *{prefix}*\ __verFiles.dat
- Timestamps (from --skip-identical)
* - *{prefix}{misc}*.dot
- - *{prefix}{misc}*.dot
- Debugging graph files (from --debug)
* - *{prefix}{misc}*.tree
- - *{prefix}{misc}*.tree
- Debugging files (from --debug)
* - *{prefix}*\ __inputs.vpp
- - *{prefix}*\ __inputs.vpp
- Pre-processed verilog for all files (from --debug)
* - *{prefix}*\ _ *{each_verilog_base_filename}*.vpp
- - *{prefix}*\ _ *{each_verilog_base_filename}*.vpp
- Pre-processed verilog for each file (from --debug)
After running Make, the C++ compiler may produce the following:
.. list-table::
* - verilated{misc}*.d
- - verilated{misc}*.d
- Intermediate dependencies
* - verilated{misc}*.o
- - verilated{misc}*.o
- Intermediate objects
* - {mod_prefix}{misc}*.d
- - {mod_prefix}{misc}*.d
- Intermediate dependencies
* - {mod_prefix}{misc}*.o
- - {mod_prefix}{misc}*.o
- Intermediate objects
* - *{prefix}*\
- - *{prefix}*\
- Final executable (from --exe)
* - lib\ *{prefix}*.a
- - lib\ *{prefix}*.a
- Final archive (default lib mode)
* - libverilated.a
- - libverilated.a
- Runtime for verilated model (default lib mode)
* - *{prefix}*\ __ALL.a
- - *{prefix}*\ __ALL.a
- Library of all Verilated objects
* - *{prefix}*\ __ALL.cpp
- - *{prefix}*\ __ALL.cpp
- Include of all code for single compile
* - *{prefix}{misc}*.d
- - *{prefix}{misc}*.d
- Intermediate dependencies
* - *{prefix}{misc}*.o
- - *{prefix}{misc}*.o
- Intermediate objects
The Verilated executable may produce the following:
.. list-table::
* - coverage.dat
- Code coverage output, and default input filename for :command:`verilator_coverage`
* - gmon.out
- GCC/clang code profiler output, often fed into :command:`verilator_profcfunc`
* - profile.vlt
- - coverage.dat
- Code coverage output, and default input filename for
:command:`verilator_coverage`
- - gmon.out
- GCC/clang code profiler output, often fed into
:command:`verilator_profcfunc`
- - profile.vlt
- --prof-pgo data file for :ref:`Thread PGO`
* - profile_exec.dat
- - profile_exec.dat
- --prof-exec data file for :command:`verilator_gantt`
Verilator_gantt may produce the following:
.. list-table::
* - profile_exec.vcd
- - profile_exec.vcd
- Gantt report waveform output
+3 -2
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
######################
Verilator User's Guide
+9 -8
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _cmakeinstallation:
@@ -16,18 +17,18 @@ Linux).
Quick Install
=============
1. Install Python for your platform from https://www.python.org/downloads/.
2. Install CMake for your platform from https://cmake.org/download/ or
#. Install Python for your platform from https://www.python.org/downloads/.
#. Install CMake for your platform from https://cmake.org/download/ or
build it from source.
3. If the compiler of your choice is MSVC, then install
#. If the compiler of your choice is MSVC, then install
https://visualstudio.microsoft.com/downloads/. If the compiler of your
choice is Clang, then install https://releases.llvm.org/download.html or
build it from source.
4. For flex and bison use https://github.com/lexxmark/winflexbison to build
#. For flex and bison use https://github.com/lexxmark/winflexbison to build
and install.
5. For build on Windows using MSVC set environment variable WIN_FLEX_BISON
#. For build on Windows using MSVC set environment variable WIN_FLEX_BISON
to install directory. For build on Windows/Linux/OS-X using ninja set
the environment variable FLEX_INCLUDE to the directory containing
the CMake variable FLEX_INCLUDE_DIR to the directory containing
FlexLexer.h and ensure that flex/bison is available within the PATH.
To obtain Verilator sources download
+9 -7
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _installation:
@@ -64,7 +65,7 @@ In brief, to install from git:
#sudo apt-get install libgoogle-perftools-dev libjemalloc-dev numactl perl-doc
#sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
#sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
#sudo apt-get install zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
#sudo apt-get install zlibc zlib1g zlib1g-dev liblz4 liblz4-dev # Ubuntu only (ignore if gives error)
git clone https://github.com/verilator/verilator # Only first time
@@ -116,7 +117,7 @@ To build or run Verilator, you need these standard packages:
sudo apt-get install libgz # Non-Ubuntu (ignore if gives error)
sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev liblz4 liblz4-dev # Ubuntu only (ignore if gives error)
For SystemC:
@@ -170,7 +171,10 @@ once, after ``configure``:
.. code-block:: bash
# Create Python virutal environment in .venv:
# Install dependencies
sudo apt install python3-pip
# Create Python virtual environment in .venv:
make venv
# Or alternatively, to put it somewhere else:
@@ -381,12 +385,10 @@ the files:
make install
.. Docker Build Environment
.. include:: ../../ci/docker/buildenv/README.rst
.. Docker Run Environment
.. include:: ../../ci/docker/run/README.rst
+27 -32
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
***************
Input Languages
@@ -38,14 +39,6 @@ chandle, const, do-while, enum, export, final, import, int, interface,
logic, longint, modport, package, program, shortint, struct, time, typedef,
union, var, void, priority case/if, and unique case/if.
It also supports .name and .\* interconnection.
Verilator partially supports concurrent assert and cover statements; see
the enclosed coverage tests for the allowed syntax.
Verilator has limited support for class and related object-oriented
constructs.
SystemVerilog 2012 (IEEE 1800-2012) Support
-------------------------------------------
@@ -110,11 +103,11 @@ Time
With :vlopt:`--timing`, all timing controls are supported:
* delay statements,
* event control statements not only at the top of a process,
* intra-assignment timing controls,
* net delays,
* ``wait`` statements,
- delay statements,
- event control statements not only at the top of a process,
- intra-assignment timing controls,
- net delays,
- ``wait`` statements,
as well as all flavors of ``fork``.
@@ -136,26 +129,26 @@ simulation (perhaps using :vlopt:`--build`) and run it.
With :vlopt:`--no-timing`, all timing controls cause the :option:`NOTIMING`
error, except:
* delay statements - they are ignored (as they are in synthesis), though they
do issue a :option:`STMTDLY` warning,
* intra-assignment timing controls - they are ignored, though they do issue
- delay statements - they are ignored (as they are in synthesis), though
they do issue a :option:`STMTDLY` warning,
- intra-assignment timing controls - they are ignored, though they do issue
an :option:`ASSIGNDLY` warning,
* net delays - they are ignored,
* event controls at the top of the procedure,
- net delays - they are ignored,
- event controls at the top of the procedure,
Forks cause this error as well, except:
* forks with no statements,
* ``fork..join`` or ``fork..join_any`` with one statement,
* forks with :vlopt:`--bbox-unsup`.
- forks with no statements,
- ``fork..join`` or ``fork..join_any`` with one statement,
- forks with :vlopt:`--bbox-unsup`.
If neither :vlopt:`--timing` nor :vlopt:`--no-timing` is specified, all
timing controls cause the :option:`NEEDTIMINGOPT` error, except event
controls at the top of the process. Forks cause this error as well, except:
* forks with no statements,
* ``fork..join`` or ``fork..join_any`` with one statement,
* forks with :vlopt:`--bbox-unsup`.
- forks with no statements,
- ``fork..join`` or ``fork..join_any`` with one statement,
- forks with :vlopt:`--bbox-unsup`.
Timing controls and forks can also be ignored in specific files or parts of
files. The :option:`/*verilator&32;timing_off*/` and
@@ -363,13 +356,15 @@ appropriate width.
Assertions
----------
Verilator is beginning to add support for assertions. Verilator currently
only converts assertions to simple ``if (...) error`` statements, and
coverage statements to increment the line counters described in the
coverage section.
Verilator partially supports assertions and assertion-driven functional
coverage.
Verilator does not support SEREs yet. All assertion and coverage statements
must be simple expressions that complete in one cycle.
Coverage
--------
Verilator partially supports SystemVerilog functional coverage with
``covergroup``, ``coverpoint``, bins, cross coverage, and transition bins.
See :ref:`Covergroup Coverage`.
Encrypted Verilog
+9 -8
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
********
Overview
@@ -47,9 +48,9 @@ The best place to get started is to try the :ref:`Examples`.
uses the shorthand, e.g., "IEEE 1364-2005", to refer to the, e.g., 2005
version of this standard.
.. [#] SystemVerilog is defined by the `Institute of Electrical and
Electronics Engineers (IEEE) Standard for SystemVerilog - Unified
Hardware Design, Specification, and Verification Language`, Standard
1800, released in 2005, 2009, 2012, 2017, and 2023. The Verilator
documentation uses the shorthand e.g., "IEEE 1800-2023", to refer to
the, e.g., 2023 version of this standard.
.. [#] SystemVerilog is defined by the `Institute of Electrical and Electronics
Engineers (IEEE) Standard for SystemVerilog - Unified Hardware Design,
Specification, and Verification Language`, Standard 1800, released in
2005, 2009, 2012, 2017, and 2023. The Verilator documentation uses the
shorthand e.g., "IEEE 1800-2023", to refer to the, e.g., 2023 version of
this standard.
+99 -36
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _simulating:
@@ -65,7 +66,7 @@ The information in this report is:
.. describe:: "allocated 123 MB"
Total memory used during simulation in megabytes.
Peak resident memory used during simulation in megabytes.
.. _benchmarking & optimization:
@@ -152,7 +153,7 @@ experience depends on the use case, and some experimentation can pay
dividends. For a speedy debug cycle during development, especially on large
designs where C++ compilation speed can dominate, consider using lower
optimization to get to an executable faster. For throughput-oriented use
cases, for example, regressions, it is usually worth spending extra
cases, for example, regression testing, it is usually worth spending extra
compilation time to reduce total CPU time.
If you will be running many simulations on a single model, you can
@@ -184,7 +185,8 @@ Verilator supports adding code to the Verilated model to support
SystemVerilog code coverage. With :vlopt:`--coverage`, Verilator enables
all forms of coverage:
- :ref:`User Coverage`
- :ref:`Property Coverage`
- :ref:`Covergroup Coverage`
- :ref:`FSM Coverage`
- :ref:`Line Coverage`
- :ref:`Toggle Coverage`
@@ -193,30 +195,43 @@ When a model with coverage is executed, it will create a coverage file for
collection and later analysis, see :ref:`Coverage Collection`.
.. _user coverage:
.. _property coverage:
Functional Coverage
-------------------
Property Coverage
-----------------
With :vlopt:`--coverage` or :vlopt:`--coverage-user`, Verilator will
translate functional coverage points the user has inserted manually in
SystemVerilog code through into the Verilated model.
translate property coverage points the user has inserted manually in
SystemVerilog code into the Verilated model.
For example, the following SystemVerilog statement will add a coverage
point under the coverage name "DefaultClock":
For simple coverage points, use the ``cover property`` construct:
.. code-block:: sv
DefaultClock: cover property (@(posedge clk) cyc==3);
This adds a coverage point that tracks whether the condition has been
observed.
.. _covergroup coverage:
Covergroup Coverage
-------------------
With :vlopt:`--coverage` or :vlopt:`--coverage-user`, Verilator will
translate covergroup coverage points the user has inserted manually in
SystemVerilog code into the Verilated model. Verilator supports coverpoints
with value and transition bins, and cross points.
.. _fsm coverage:
FSM Coverage
------------
With :vlopt:`--coverage` or :vlopt:`--coverage-fsm`, Verilator can
instrument a conservative subset of single-process FSMs and report both
state coverage (`fsm_state`) and transition coverage (`fsm_arc`).
instrument a conservative subset of FSMs and report both state coverage
(`fsm_state`) and transition coverage (`fsm_arc`).
This feature is currently experimental and might change in subsequent
releases. In particular, the native FSM coverage extraction heuristics,
@@ -224,21 +239,70 @@ releases. In particular, the native FSM coverage extraction heuristics,
should be treated as subject to change while the interface settles.
FSM extraction is intentionally narrow. The current implementation targets
clocked, enum-driven state machines that can be recovered directly from the
RTL. It does not claim broad support for two-process FSMs, one-hot
inference, helper-function next-state recovery, or deeply nested control
recovery.
clocked state machines that can be recovered directly from the RTL. It
recognizes scalar enum, parameter, localparam, and selected literal state
encodings in these common forms:
- Single-process FSMs, whose state dispatch is written as ``case (state)``
or as a top-level ``if`` / ``else if`` chain comparing the same state
variable against known state values
- Two-process and three-block FSMs, where a clocked state register is
paired with a combinational next-state block using the same supported
``case`` or top-level ``if`` / ``else if`` dispatch forms
Scalar state encodings may be wider than 32 bits. This allows sparse state
encodings, such as high-Hamming-distance enum or localparam values, to be
preserved in the detected FSM model. Verilator uses the declared enum item
name, parameter name, or localparam name as the reported state label where
possible.
Simple input guards are supported when they appear inside a recognized
state branch, or as a top-level conjunction containing exactly one state
comparison, such as ``(state_q == IDLE) && ready``. Directly traceable
pre-decoded state aliases, such as ``assign idle_state = (state_q ==
IDLE)``, may also be used in these guarded predicates.
Verilator does not claim broad support for arbitrary predicate
decomposition, one-hot inference, helper-function next-state recovery,
deeply nested control recovery, or cross-module state alias tracing.
The following metacomments may be attached to the state variable to steer
the extracted coverage model:
- ``/*verilator fsm_state*/`` forces the variable to be treated as
FSM state.
- ``/*verilator fsm_reset_arc*/`` marks reset transitions as
user-visible reset arcs instead of defaulting to a hidden reset-only
summary.
- ``/*verilator fsm_arc_include_cond*/`` keeps conditional branch
arcs that would otherwise be skipped by the conservative extractor.
- ``/*verilator fsm_state*/`` forces the variable to be treated as FSM
state.
- ``/*verilator fsm_reset_arc*/`` marks reset transitions as user-visible
reset arcs instead of defaulting to a hidden reset-only summary.
- ``/*verilator fsm_arc_include_cond*/`` keeps conditional branch arcs that
would otherwise be skipped by the conservative extractor.
State registers may also be wrapped by a transparent instance, for example
a project flop wrapper or primitive. Such wrappers must be described
explicitly with a VLT command file action before Verilator will use their
data, state, clock, or reset connections for FSM extraction:
.. code-block:: sv
`verilator_config
fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i"
The same command may be placed in a separate ``.vlt`` file:
.. code-block:: sv
fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i"
Optional reset metadata may also be supplied:
.. code-block:: sv
fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i" \
-reset "rst_ni" -reset_value "ResetValue"
Reset arcs are emitted only when the configured reset port has an inferable
edge in the wrapper and the configured reset value parameter is statically
resolvable. If reset metadata is incomplete, Verilator warns and may still
emit FSM state and transition coverage, but reset arcs are omitted.
Reset transitions are included in the collected data either way. By
default, :command:`verilator_coverage` summarizes reset-only arcs rather
@@ -250,7 +314,6 @@ Annotated output produced by :command:`verilator_coverage --annotate` will
label FSM points with `fsm_state` and `fsm_arc`, and synthetic fallback
transitions with `SYNTHETIC DEFAULT ARC`.
.. _line coverage:
Line Coverage
@@ -370,11 +433,11 @@ coverage point insertions into the model and collect the coverage data.
To get the coverage data from the model, write the coverage with either:
1. Using :vlopt:`--binary` or :vlopt:`--main`, and Verilator will dump
#. Using :vlopt:`--binary` or :vlopt:`--main`, and Verilator will dump
coverage when the test completes to the filename specified with
:vlopt:`+verilator+coverage+file+\<filename\>`.
2. In the user wrapper code, typically at the end once a test passes, call
#. In the user wrapper code, typically at the end once a test passes, call
``Verilated::threadContextp()->coveragep()->write`` with an argument of
the filename for the coverage data file to write coverage data to
(typically "logs/coverage.dat").
@@ -439,12 +502,12 @@ how execution time is distributed in a verilated model.
With the :vlopt:`--prof-exec` option, Verilator will:
* Add code to the Verilated model to record execution flow.
- Add code to the Verilated model to record execution flow.
* Add code to save profiling data in non-human-friendly form to the file
- Add code to save profiling data in non-human-friendly form to the file
specified with :vlopt:`+verilator+prof+exec+file+\<filename\>`.
* In multithreaded models, add code to record each macro-task's start and
- In multithreaded models, add code to record each macro-task's start and
end time across several calls to eval. (What is a macro-task? See the
Verilator internals document (:file:`docs/internals.rst` in the
distribution.)
@@ -544,8 +607,8 @@ There are two forms of profile-guided optimizations. Unfortunately, for
best results, they must each be performed from the highest level code to
the lowest, which means performing them separately and in this order:
* :ref:`Thread PGO`
* :ref:`Compiler PGO`
- :ref:`Thread PGO`
- :ref:`Compiler PGO`
Other forms of PGO may be supported in the future, such as clock and reset
toggle rate PGO, branch prediction PGO, statement execution time PGO, or
@@ -611,7 +674,7 @@ multithreaded models.
Please see the appropriate compiler documentation to use PGO with GCC or
Clang. The process in GCC 10 was as follows:
1. Compile the Verilated model with the compiler's "-fprofile-generate"
#. Compile the Verilated model with the compiler's "-fprofile-generate"
flag:
.. code-block:: bash
@@ -622,10 +685,10 @@ Clang. The process in GCC 10 was as follows:
Or, if calling make yourself, add -fprofile-generate appropriately to
your Makefile.
2. Run your simulation. This will create \*.gcda file(s) in the same
#. Run your simulation. This will create \*.gcda file(s) in the same
directory as the source files.
3. Recompile the model with -fprofile-use. The compiler will read the
#. Recompile the model with -fprofile-use. The compiler will read the
\*.gcda file(s).
For GCC:
+19 -18
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
**********
Verilating
@@ -7,21 +8,21 @@ Verilating
Verilator may be used in five major ways:
* With the :vlopt:`--binary` option, Verilator will translate the design
- With the :vlopt:`--binary` option, Verilator will translate the design
into an executable, via generating C++ and compiling it. See
:ref:`Binary, C++ and SystemC Generation`.
* With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
- With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
the design into C++ or SystemC code, respectively. See :ref:`Binary, C++
and SystemC Generation`.
* With the :vlopt:`--lint-only` option, Verilator will lint the design to
- With the :vlopt:`--lint-only` option, Verilator will lint the design to
check for warnings but will not typically create any output files.
* With the :vlopt:`--json-only` option, Verilator will create JSON output
- With the :vlopt:`--json-only` option, Verilator will create JSON output
that may be used to feed into other user-designed tools.
* With the :vlopt:`-E` option, Verilator will preprocess the code according
- With the :vlopt:`-E` option, Verilator will preprocess the code according
to IEEE preprocessing rules and write the output to standard out. This is
useful to feed other tools and to debug how "\`define" statements are
expanded.
@@ -127,9 +128,9 @@ Usage
Users need to mark one or more moderate-size modules as hierarchy block(s).
There are two ways to mark a module:
* Write :option:`/*verilator&32;hier_block*/` metacomment in HDL code.
- Write :option:`/*verilator&32;hier_block*/` metacomment in HDL code.
* Add a :option:`hier_block` line in the :ref:`Verilator Control Files`.
- Add a :option:`hier_block` line in the :ref:`Verilator Control Files`.
Then pass the :vlopt:`--hierarchical` option to Verilator.
@@ -145,28 +146,28 @@ Limitations
Hierarchy blocks have some limitations, including:
* Internals of the hierarchy block cannot be accessed using dot (.) from
- Internals of the hierarchy block cannot be accessed using dot (.) from
the upper module(s) or other hierarchy blocks, except that ports of a
hierarchy block instance can be accessed from the directly enclosing
nested hierarchy block, or from the top level non-hierarchical portions
of the design if not a nested hierarchy block.
* Modport cannot be used at the hierarchical block boundary.
- Modport cannot be used at the hierarchical block boundary.
* The simulation speed is likely not as fast as flat Verilation, in which
- The simulation speed is likely not as fast as flat Verilation, in which
all modules are globally scheduled.
* Generated clocks may not work correctly if generated in the hierarchical
- Generated clocks may not work correctly if generated in the hierarchical
model and passed into another hierarchical model or the top module.
* Delays are not allowed in hierarchy blocks.
- Delays are not allowed in hierarchy blocks.
But, the following usage is supported:
* Nested hierarchy blocks. A hierarchy block may instantiate other
- Nested hierarchy blocks. A hierarchy block may instantiate other
hierarchy blocks.
* Parameterized hierarchy block. Parameters of a hierarchy block can be
- Parameterized hierarchy block. Parameters of a hierarchy block can be
overridden using ``#(.param_name(value))`` construct.
@@ -622,5 +623,5 @@ The information in this report is:
.. describe:: "allocated 123 MB"
Total memory used during build by Verilator executable (excludes
:vlopt:`--build` compiler's usage) in megabytes.
Peak resident memory used by the Verilator executable during build
(excludes :vlopt:`--build` compiler's usage) in megabytes.
+227 -31
View File
@@ -1,5 +1,6 @@
.. SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
..
SPDX-FileCopyrightText: 2003-2026 Wilson Snyder
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
===================
Errors and Warnings
@@ -96,21 +97,21 @@ List Of Warnings
.. option:: ALWCOMBORDER
.. TODO better example
Warns that an ``always_comb`` block has a variable that is set after it
is used. This may cause simulation-synthesis mismatches, as not all
simulators allow this ordering.
Warns that an ``always_comb`` block reads a variable before assigning it
later in the same block. Because statements in a procedural block execute
in source order, the read observes the variable's previous value for that
activation. This can imply latch/state-like behavior and is not purely
combinational.
.. code-block:: sv
always_comb begin
a = b;
b = 1;
y = a + tmp; // Reads the previous value of tmp
tmp = b;
end
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
If the new value of ``tmp`` is intended, assign ``tmp`` before reading it.
Suppressing this warning may make results vary between simulators.
.. option:: ALWNEVER
@@ -382,6 +383,9 @@ List Of Warnings
non-enumerated values (IEEE 1800-2023 12.5.3). Verilator checks that
illegal values are not hit, unless :vlopt:`--no-assert-case` was used.
Unique0 case statements will never cause this warning. (Although unique0
should be avoided in synthesizable code as may result in latch behavior.)
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
@@ -521,6 +525,48 @@ List Of Warnings
Suppressing this error will suppress the error message check; it will
simulate as if the ``const`` as not present.
.. option:: CONTASSINIT
Error that a continuous assignment is setting a variable with an initial
value. Use either the initial value or the continuous assignment, but not
both.
For example:
.. code-block:: sv
:emphasize-lines: 2,4
module t;
logic b = 1'b0;
logic a;
assign b = a; //<--- Error
endmodule
Results in:
.. code-block::
%Error-CONTASSINIT: example.sv:4:10: Continuous assignment to variable with initial value: 'b'
: ... note: In instance 't'
: ... Location of variable initialization
2 | logic b = 1'b0;
| ^
example.sv:4:10: ... Location of continuous assignment
4 | assign b = a;
| ^
%Error: Exiting due to 1 error(s)
The following is legal because the driven variable does not have a declaration
initializer:
.. code-block:: sv
module t;
logic b;
logic a = 1'b0;
assign b = a;
endmodule
.. option:: CONTASSREG
@@ -546,6 +592,10 @@ List Of Warnings
``covergroup``, ``coverpoint``, and coverage options, and the
construct was ignored.
This includes crosses whose normal-bin Cartesian product exceeds
``2**32 - 1`` tuples. The limit is checked during Verilation for both
automatic and explicit cross bins.
Disabling the :option:`UNSUPPORTED` error also disables this warning.
Ignoring this warning may make Verilator ignore lint checking on the
@@ -837,6 +887,22 @@ List Of Warnings
with a newline."
.. option:: FINALDLY
Error issued when a non-blocking assignment `<=` is used in a
`final` block.
This error can be disabled. If disabled, the assignment will be
executed as a `=` blocking assignment.
Faulty example:
.. include:: ../../docs/gen/ex_FINALDLY_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_FINALDLY_msg.rst
.. option:: FSMMULTI
Warns that the same always block contains multiple enum-typed case
@@ -956,6 +1022,13 @@ List Of Warnings
port list, since these are references to interfaces/modports declared at a higher level and are
already specialized. These types of accesses do not require waiving HIERPARAM.
.. option:: IEEEMAYDEPRECATE
This feature is not yet deprecated, but may be in a future version of the IEEE standard.
This warning is to alert users that they may want to avoid using this feature, as it
may be removed in a future version of the IEEE standard, and thus may not be supported
in future versions of Verilator.
.. option:: IFDEPTH
Warns that if/if else statements have exceeded the depth specified with
@@ -1126,11 +1199,14 @@ List Of Warnings
.. option:: INITIALDLY
.. TODO better example
Historical, never issued since version 5.050.
Warns that the code has a delayed assignment inside of an ``initial`` or
``final`` block. If this message is suppressed, Verilator will convert
this to a non-delayed assignment. See also :option:`COMBDLY`.
this to a non-delayed assignment. With :vlopt:`--timing`, delayed
assignments in ``initial`` blocks that also contain a `#` delay
control, or `@` even control statement are scheduled as
non-blocking assignments. See also :option:`COMBDLY`.
Ignoring this warning may make Verilator simulations differ from other
simulators.
@@ -1359,9 +1435,11 @@ List Of Warnings
.. option:: MULTIDRIVEN
Warns that the specified signal comes from multiple ``always``
blocks, each with different clocking. This warning does not look at
individual bits (see the example below).
Warns that the specified signal has multiple procedural drivers.
One case is when the signal comes from multiple ``always`` blocks,
each with different clocking. This warning does not look at individual
bits (see the example below).
This is considered bad style, as the consumer of a given signal may be
unaware of the inconsistent clocking, causing clock domain crossing
@@ -1375,11 +1453,74 @@ List Of Warnings
.. include:: ../../docs/gen/ex_MULTIDRIVEN_msg.rst
Ignoring this warning will only slow simulations; it will simulate
correctly. It may, however, cause longer simulation runtimes due to
Another case is when a variable written in an ``always_comb`` or
``always_ff`` block is also written by another process. IEEE 1800
requires variables written in these specialized always blocks to be
written only by that process.
Faulty ``always_ff`` example:
.. include:: ../../docs/gen/ex_MULTIDRIVEN_alwaysff_faulty.rst
To retain an initialization without adding another process, use a
declaration initializer (or, for synthesizable code, add a reset term):
.. code-block:: sv
logic q = 1'b0;
always_ff @(posedge clk) begin
q <= d;
end
A further case is when a signal named as a clocking block ``output`` is
also driven by a continuous assignment, or is named as an ``output`` of a
second clocking block. The clocking block drives the signal, so the design
and the testbench contend for it and the synchronous drive may be silently
lost. Declare the clocking block ``input`` if the intent is only to
observe the signal.
Ignoring this warning may hide clock domain crossing, timing, or
portability bugs. It may also cause longer simulation runtimes due to
reduced optimizations.
.. option:: MULTIDRIVENPROC
Warns that the whole of a variable is driven by more than one plain
``always`` block. Unlike the :option:`MULTIDRIVEN` cases, plain
``always`` blocks carry no ``always_comb``/``always_ff`` intent, so this
is legal SystemVerilog rather than an IEEE 1800 violation. It is,
however, typically a synthesis error: hardware cannot have a signal
driven by two separate sequential blocks, so the design usually will not
behave as the RTL simulation suggests.
Disabled by default as this is a code-style warning; it will simulate
correctly.
Faulty example:
.. include:: ../../docs/gen/ex_MULTIDRIVENPROC_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_MULTIDRIVENPROC_msg.rst
Also warns when a signal named as a clocking block ``output`` is driven
by a plain ``always`` block. Driving a signal from both a clocking block
and a plain ``always`` block is a deliberate idiom in some testbenches,
so it is reported as MULTIDRIVENPROC rather than under the on-by-default
:option:`MULTIDRIVEN`.
To fix, drive the signal from a single ``always`` block, or use
``always_ff``/``always_comb`` if the intent is a single specialized
process.
Does not warn for static variables used as loop induction variables:
.. include:: ../../docs/gen/ex_MULTIDRIVENPROC_loopidx.rst
.. option:: MULTITOP
.. TODO better example
@@ -1423,6 +1564,19 @@ List Of Warnings
(neither :vlopt:`--timing` nor :vlopt:`--no-timing` option was provided).
.. option:: NEVERMATCH
Warns that an SVA sequence is statically known to never match. Such a
sequence is legal SystemVerilog and is fully supported, the warning
only highlights a potential problem. For example, using the sequence as
the antecedent of an implication causes the implication to pass
vacuously. For an intersect sequence, ensure its operands can match
over a common length (IEEE 1800-2023 16.9.6).
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
.. option:: NEWERSTD
Warns that a feature requires a newer standard of Verilog or SystemVerilog
@@ -1504,6 +1658,25 @@ List Of Warnings
:vlopt:`--no-timing` option.
.. option:: NOTREDOP
Error that a logical not operator is directly followed by an
unparenthesized reduction operator, such as ``!|a``. The IEEE 1800-2023 Annex A
grammar requires the operand of ``!`` to be a primary expression, not an
unparenthesized reduction expression.
For example:
.. include:: ../../docs/gen/ex_NOTREDOP_msg.rst
Some simulators support this syntax as an extension, but it is recommended to fix
these to match IEEE. To do so, add parentheses around the reduction expression,
for example use ``!(|a)`` instead of ``!|a``.
Suppressing this error will suppress the error message check; it will simulate
correctly.
.. option:: NULLPORT
Warns that a null port was detected in the module definition port
@@ -1724,12 +1897,18 @@ List Of Warnings
.. include:: ../../docs/gen/ex_PROCASSINIT_fixed.rst
Alternatively, use an initial block for the initialization:
For non-``always_ff`` logic, alternatively use an initial block for
the initialization:
.. code-block:: sv
initial flop_out = 1; // <--- Fixed
Do not use a separate initial block for a variable assigned by an
``always_ff`` process, as IEEE 1800 requires an ``always_ff`` variable
to be written only by that process. Use a declaration initializer, or
initialize the variable from reset logic inside the ``always_ff``.
Disabled by default as this is a code-style warning; it will simulate
correctly.
@@ -1970,6 +2149,32 @@ List Of Warnings
simulators.
.. option:: SIMILARNAME
Warns that an entity name only differs from another in lexical case.
Faulty example:
.. include:: ../../docs/gen/ex_SIMILARNAME_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_SIMILARNAME_msg.rst
Only declarations that can reach a downstream VLSI tool as a name are
checked, that is nets, variables, instances, named blocks (``begin``,
``fork``, and generate blocks), functions and tasks. All of these can form
part of a flattened signal or scope name. Other declarations, such as
parameters, localparams, genvars and typedefs, are elaborated away, and so
are not checked.
Disabled by default as this is a code-style warning; it will simulate
correctly.
This is a warning as some downstream VLSI tools do
not distinguish net and gate names with the same case.
.. option:: SPECIFYIGN
Warns that Verilator does not support certain constructs in
@@ -2264,11 +2469,6 @@ List Of Warnings
the conflict. If you run with :vlopt:`--report-unoptflat`, Verilator will
suggest possible candidates for :option:`/*verilator&32;split_var*/`.
The UNOPTFLAT warning may also occur where outputs from a block of logic
are independent, but occur in the same always block. To fix this, use
the :option:`/*verilator&32;isolate_assignments*/` metacomment described
above.
Before version 5.000, the UNOPTFLAT warning may also have been due to
clock enables, identified from the reported path going through a clock
gating instance. To fix these, the clock_enable meta comment was used.
@@ -2303,14 +2503,10 @@ List Of Warnings
.. option:: UNPACKED
Warns that unpacked structs and unions are not supported because
:vlopt:`--structs-packed` was used, or by up through version 5.004.
Historical, never issued since version 5.004.
Ignoring this warning will make Verilator treat the structure as packed,
which may make Verilator simulations differ from other simulators. This
downgrading may also result in what would typically be a legal unpacked
struct/array inside an unpacked struct/array becoming an illegal
unpacked struct/array inside a packed struct/array.
Warned that unpacked structs and unions were not supported, or disabled
by the since-removed `--structs-packed` option.
.. option:: UNSATCONSTR
+239 -124
View File
@@ -113,9 +113,9 @@ pointer to the ``AstNode`` currently being processed.
There are notable sub-hierarchies of the ``AstNode`` sub-types, namely:
1. All AST nodes representing data types derive from ``AstNodeDType``.
#. All AST nodes representing data types derive from ``AstNodeDType``.
2. All AST nodes representing expressions (i.e.: anything that stands for,
#. All AST nodes representing expressions (i.e.: anything that stands for,
or evaluates to a value) derive from ``AstNodeExpr``.
@@ -425,8 +425,9 @@ logic.
To achieve this, we invoke ``V3Order::order`` on all of the combinational
and hybrid logic, and iterate the resulting evaluation function until no
more hybrid logic is triggered. This yields the `_eval_settle` function,
which is invoked at the beginning of simulation after the `_eval_initial`.
more hybrid logic is triggered. This yields the `_eval_stl` function, which
the runtime event loop iterates at the beginning of simulation, after the
`_eval_initial`.
Partitioning logic for correct NBA updates
@@ -500,51 +501,66 @@ and clock signals on separate evaluations, as was necessary with earlier
versions of Verilator).
Constructing the top level `_eval` function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Constructing the region evaluation functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To construct the top level `_eval` function, which updates the state of the
circuit to the end of the current time step, we invoke ``V3Order::order``
separately on the 'ico', 'act' and 'nba' logic, which yields the
`_eval_ico`, `_eval_act`, and `_eval_nba` functions. We then put these all
together with the corresponding functions that compute the respective
trigger expressions into the top level `_eval` function, which on the high
level has the form:
To update the state of the circuit to the end of the current time step, we
invoke ``V3Order::order`` separately on the 'ico', 'act' and 'nba' logic,
which yields the `_eval_body__ico`, `_eval_body__act`, and
`_eval_body__nba` functions. Each of these is then combined with the
function computing the respective trigger expressions into a single entry
point per region, `_eval_ico`, `_eval_act` and `_eval_nba`. A region entry
point evaluates one iteration of its region, and returns whether it did any
work, meaning the region has not converged yet and must be evaluated again.
On the high level, `_eval_act` has the form:
.. code-block:: C++
void _eval() {
// Update combinational logic dependent on top level inputs ('ico' region)
while (true) {
_eval__triggers__ico();
// If no 'ico' region trigger is active
if (!ico_triggers.any()) break;
_eval_ico();
}
// Iterate 'act' and 'nba' regions together
while (true) {
// Iterate 'act' region, this computes all derived clocks updaed in the
// Active scheduling region, but does not commit any NBAs that executed
// in 'act' region logic.
while (true) {
_eval__triggers__act();
// If no 'act' region trigger is active
if (!act_triggers.any()) break;
// Remember what 'act' triggers were active, 'nba' uses the same
latch_act_triggers_for_nba();
_eval_act();
}
// If no 'nba' region trigger is active
if (!nba_triggers.any()) break;
// Evaluate all other Active region logic, and commit NBAs
_eval_nba();
}
bool _eval_act() {
_eval_triggers_vec__act();
// Remember what 'act' triggers were active, 'nba' uses the same
latch_act_triggers_for_nba();
const bool execute = act_triggers.any();
// Compute all derived clocks updated in the Active scheduling region,
// but do not commit any NBAs that executed in 'act' region logic.
if (execute) _eval_body__act();
return execute;
}
The loops iterating these regions are not generated. They live in the
runtime library, in ``VerilatedEvalLoop``, and the model exposes its region
entry points to it as virtual methods of ``VerilatedModel``. The generated
model holds a ``VerilatedEvalLoop`` as a member, which its ``eval_step``
runs, and which on the high level has the form:
.. code-block:: C++
void VerilatedEvalLoop::evalImpl() {
// Update combinational logic dependent on top level inputs ('ico' region)
uint32_t icoIterCount = 0;
do {
if (++icoIterCount > m_convergeLimit) didNotConverge("Input combinational");
} while (m_model.evalIco(icoIterCount == 1));
// Iterate 'act' and 'nba' regions together
uint32_t nbaIterCount = 0;
do {
if (++nbaIterCount > m_convergeLimit) didNotConverge("NBA");
// Iterate the 'act' region to convergence
uint32_t actIterCount = 0;
do {
if (++actIterCount > m_convergeLimit) didNotConverge("Active");
} while (m_model.evalAct());
// Evaluate all other Active region logic, and commit NBAs
} while (m_model.evalNba());
}
The remaining regions ('inact', 'obs' and 'react') nest around these in the
same manner, each iterating the loops of all regions that precede it in the
SystemVerilog scheduling order. The runtime event loop calls every region
unconditionally, so scheduling emits an entry point for each one even when
the design has no logic in it. Such an entry point immediately returns
false, ending its loop after a single iteration.
Timing
------
@@ -666,23 +682,23 @@ The second visitor in ``V3Timing.cpp``, ``TimingControlVisitor``, uses the
information provided by ``TimingSuspendableVisitor`` and transforms each
timing control into a ``co_await``.
* event controls are turned into ``co_await`` on a trigger scheduler's
- event controls are turned into ``co_await`` on a trigger scheduler's
``trigger`` method. The awaited trigger scheduler is the one
corresponding to the sentree referenced by the event control. This
sentree is also referenced by the ``AstCAwait`` node, to be used later by
the static scheduling code.
* if an event control waits on a local variable or class member, it uses a
- if an event control waits on a local variable or class member, it uses a
local trigger which it evaluates inline. It awaits a dynamic trigger
scheduler multiple times: for trigger evaluation, updates, and
resumption. The dynamic trigger scheduler is responsible for resuming the
coroutine at the correct point of evaluation.
* delays are turned into ``co_await`` on a delay scheduler's ``delay``
- delays are turned into ``co_await`` on a delay scheduler's ``delay``
method. The created ``AstCAwait`` nodes also reference a special sentree
related to delays, to be used later by the static scheduling code.
* ``join`` and ``join_any`` are turned into ``co_await`` on a
- ``join`` and ``join_any`` are turned into ``co_await`` on a
``VlForkSync``'s ``join`` method. Each forked process gets a
``VlForkSync::done`` call at the end.
@@ -730,57 +746,49 @@ they wouldn't be evaluated and next coroutine after resumption would fire
the event `a` then it is impossible to get to know whether await or fire on
event `a` was called first - which is necessary to know.
There are two functions for managing timing logic called by ``_eval()``:
There are two functions for managing timing logic called by the 'act'
region:
* ``_timing_ready()``, which commits all coroutines whose triggers were
not set in the current iteration,
* ``_timing_resume()``, which calls `resume()` on all trigger and delay
- ``_timing_ready()``, which commits all coroutines whose triggers were not
set in the current iteration,
- ``_timing_resume()``, which calls `resume()` on all trigger and delay
schedulers whose triggers were set in the current iteration.
Thanks to this separation a coroutine:
* awaiting a trigger cannot be suspended and resumed in the same iteration
- awaiting a trigger cannot be suspended and resumed in the same iteration
(``test_regress/t/t_timing_eval_act.v``) - which is necessary to make
Verilator more predictable; this is the reason for introduction of 3rd
stage in `VlTriggerScheduler` and thanks to this it is guaranteed that
downstream logic will be evaluated before resumption (assuming that the
coroutine wasn't already triggered in previous iteration);
* cannot be resumed before it is suspended -
- cannot be resumed before it is suspended -
``test_regress/t/t_event_control_double_excessive.v``;
* firing cannot cannot be lost
(``test_regress/t/t_event_control_double_lost.v``) - which is possible when
triggers are not evaluated right before awaiting.
- firing cannot cannot be lost
(``test_regress/t/t_event_control_double_lost.v``) - which is possible
when triggers are not evaluated right before awaiting.
All coroutines are committed and resumed in the 'act' eval loop. With
timing features enabled, the ``_eval()`` function takes this form:
All coroutines are committed and resumed in the 'act' region. With timing
features enabled, the 'act' region entry point takes this form:
::
void _eval() {
while (true) {
_eval__triggers__ico();
if (!ico_triggers.any()) break;
_eval_ico();
}
while (true) {
while (true) {
_eval__triggers__act();
// Commit all non-triggered coroutines
_timing_commit();
if (!act_triggers.any()) break;
latch_act_triggers_for_nba();
// Resume all triggered coroutines
_timing_resume();
_eval_act();
}
if (!nba_triggers.any()) break;
_eval_nba();
bool _eval_act() {
_eval_triggers_vec__act();
// Commit all non-triggered coroutines
_timing_commit();
const bool execute = act_triggers.any();
if (execute) {
latch_act_triggers_for_nba();
// Resume all triggered coroutines
_timing_resume();
_eval_body__act();
}
return execute;
}
Forks
@@ -937,13 +945,15 @@ macro-task's dataset fits in one core's local caches.
To achieve spatial locality, we tag each variable with the set of
macro-tasks that access it. Let's call this set the "footprint" of that
variable. The variables in a given module have a set of footprints. We can
order those footprints to minimize the distance between them (distance is
the number of macro-tasks that are different across any two footprints) and
then emit all variables into the struct in ordered-footprint order.
variable. The variables in a given module have a set of footprints. We
group variables with identical non-empty footprints, emit those groups in
deterministic footprint-key order, then emit variables with no footprint
information last.
The footprint ordering is literally the traveling salesman problem, and we
use a TSP-approximation algorithm to get close to an optimal sort.
The first emitted variable in each footprint group is aligned to a
cache-line boundary. This avoids false sharing between different macro-task
footprints without building a complete pairwise-distance graph over all
footprints, which would use excessive memory on very large models.
This is an old idea. Simulators designed at DEC in the early 1990s used
similar techniques to optimize both single-thread and multithread modes.
@@ -1021,15 +1031,6 @@ Profile-guided optimization make this a bit better, by adjusting mtask
scheduling, but this does not yet guide the packing into mtasks.
Performance Regression
++++++++++++++++++++++
It would be nice if we had a regression of large designs, with some
diversity of design styles, to test on both single- and multithreaded
modes. This would help to avoid performance regressions, and also to
evaluate the optimizations while minimizing the impact of parasitic noise.
Per-Instance Classes
++++++++++++++++++++
@@ -1080,9 +1081,17 @@ solver gets a setup query, then the definition of variables, then all the
constraints (SMT assertions) about the variables. Since the solver has no
information about the class' PRNG state, if the problem is satisfiable, the
solution space is further constrained by adding extra random constraints,
and querying the values satisfying the problem statement. The constraint is
currently constructed as fixing a simple xor of randomly chosen bits of the
variables being randomized.
and querying the values satisfying the problem statement. The constraints
are currently built by the UniGen2 algorithm ("On Parallel Scalable Uniform
SAT Witness Generation", Chakraborty et al.). It first works out how many
random xor equations are needed to split the solution space into cells of a
size worth enumerating, then draws one cell and enumerates it, which gives
a near-uniform sample of the whole space. Both the estimate and the
leftover solutions are cached, so the following calls are answered without
asking the solver again. Cases outside its assumptions, such as ``randc``
variables or soft constraints, fall back to pinning every free bit to a
random value, or, when arrays are involved, to asserting four random xor
equations in a row.
The runtime classes used for handling the randomization are defined in
``verilated_random.h`` and ``verilated_random.cpp``.
@@ -1298,15 +1307,15 @@ the ``<description>`` field is ``<identifier> : <type>``, where
``<identifier>`` will be used as the base name of the generated operand
accessors, and ``<type>`` is one of:
1. An ``AstNode`` sub-class, defining the operand to be of that type,
#. An ``AstNode`` sub-class, defining the operand to be of that type,
always no-null, and with an always null ``nextp()``. That is, the child
node is always present, and is a single ``AstNode`` (as opposed to a
list).
2. ``Optional[<AstNode sub-class>]``. This is just like in point 1 above,
#. ``Optional[<AstNode sub-class>]``. This is just like in point 1 above,
but defines the child node to be optional, meaning it may be null.
3. ``List[AstNode sub-class]`` describes a list operand, which means the
#. ``List[AstNode sub-class]`` describes a list operand, which means the
child node may have a non-null ``nextp()`` and in addition the child
itself may be null, representing an empty list.
@@ -1393,7 +1402,7 @@ calling ``accept`` on ``AstIf`` will look in turn for:
There are three ways data is passed between visitor functions.
1. A visitor-class member variable. This is generally for passing "parent"
#. A visitor-class member variable. This is generally for passing "parent"
information down to children. ``m_modp`` is a common example. It's set
to NULL in the constructor, where that node (``AstModule`` visitor) sets
it, then the children are iterated, then it's cleared. Children under an
@@ -1403,7 +1412,7 @@ There are three ways data is passed between visitor functions.
visitor; otherwise exiting the lower for will lose the upper for's
setting.
2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
#. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
visitor) has five user attributes, which may be accessed as an integer
using the ``user1()`` through ``user4()`` methods, or as a pointer (of
type ``AstNUser``) using the ``user1p()`` through ``user4p()`` methods
@@ -1434,7 +1443,7 @@ There are three ways data is passed between visitor functions.
so it's ok to call fairly often. For example, it's commonly called on
every module.
3. Parameters can be passed between the visitors in close to the "normal"
#. Parameters can be passed between the visitors in close to the "normal"
function caller to callee way. This is the second ``vup`` parameter of
type ``AstNUser`` that is ignored on most of the visitor functions.
V3Width does this, but it proved messier than the above and is
@@ -1627,7 +1636,7 @@ There are some traps to avoid when running regression tests
Hat/Fedora/Centos offer *perl-Pod-Perldoc*', while Debian/Ubuntu/Linux
Mint offer \`perl-doc'.
- Running regression may exhaust resources on some Linux systems,
- Running regression tests may exhaust resources on some Linux systems,
particularly file handles and user processes. Increase these to
respectively 16,384 and 4,096. The method of doing this is
system-dependent, but on Fedora Linux it would require editing the
@@ -1701,7 +1710,7 @@ can have significant variance. Experience shows that a ~20% time difference
can be reliably measured on GitHub hosted runners, and smaller differences
are noticeable over a few days of reruns as trends emerge from the noise.
Code coverage
Code Coverage
-------------
Code coverage for developing Verilator itself can be collected using
@@ -1750,6 +1759,31 @@ example, to see coverage of changes compared to upstream, use:
make coverage-view COVERAGE_BASE=origin/master
Code Coverage Results
---------------------
When code coverage is complete, line coverage should be at 100%. Branch
coverage is not required to be at 100%, but all uncovered branches should
be understood as to why.
For lines which are impossible, use ``// LCOV_EXCL_LINE``, or ``//
LCOV_EXCL_START`` and ``// LCOV_EXCL_STOP`` regions.
For branches which are impossible, use the ``VL_UNCOVERABLE(condition)``
macro around uncoverable conditions, otherwise use ``//
LCOV_EXCL_BR_LINE``.
The assertions ``UASSERT`` and similar are automatically excluded from
coverage, and as such should not require exclusion meta comments.
As getting to complete code coverage typically takes many passes,
developers should please iterate coverage improvements using a personal
machine, or a personal branch on GitHub with personal action runners,
rather than the Verilator GitHub runners, to avoid lots of mail to watchers
and CI queue blockage.
Fuzzing
-------
@@ -2099,19 +2133,19 @@ To print a node:
``src/.gdbinit`` and ``src/.gdbinit.py`` define handy utilities for working
with JSON AST dumps. For example:
* ``jstash nodep`` - Perform a JSON AST dump and save it into GDB value
- ``jstash nodep`` - Perform a JSON AST dump and save it into GDB value
history (e.g. ``$1``)
* ``jtree nodep`` - Perform a JSON AST dump and pretty print it using
- ``jtree nodep`` - Perform a JSON AST dump and pretty print it using
``astsee_verilator``.
* ``jtree $1`` - Pretty print a dump that was previously saved by
- ``jtree $1`` - Pretty print a dump that was previously saved by
``jstash``.
* ``jtree nodep -d '.file, .timeunit'`` - Perform a JSON AST dump, filter
- ``jtree nodep -d '.file, .timeunit'`` - Perform a JSON AST dump, filter
out some fields and pretty print it.
* ``jtree 0x55555613dca0`` - Pretty print using address literal (rather
- ``jtree 0x55555613dca0`` - Pretty print using address literal (rather
than actual pointer).
* ``jtree $1 nodep`` - Diff ``nodep`` against an older dump.
- ``jtree $1 nodep`` - Diff ``nodep`` against an older dump.
A detailed description of ``jstash`` and ``jtree`` can be displayed using
``gdb``'s ``help`` command.
@@ -2177,30 +2211,65 @@ When the bisection ends, the first value that makes the discriminator
command fail is printed, which identifies the exact offending application
of the transform.
Debugging Non-Deterministic Results
-----------------------------------
The Verilator binary should be deterministic, producing the same Verilated
C++ and stdout when run multiple times with the same inputs. A common
source of non-determinism is (mis-)use of pointers in container
comparisons, causing arbitrary changes im memory layout to make container
comparisons differ, and in turn creating differences in Ast layout, and
ultimately different C++ code.
To debug this, compile Verilator with the `VL_ALLOC_RANDOM_CHECKS` define,
then Verilator may be run with a seed e.g. `-debug-alloc-random 22` and
`-debug-alloc-random 33` which will randomly change the memory allocation
order. If multiple seeds are run, `verilator_difftree` may then be used to
see where netlists start to differ. Once the Ast difference is determined,
the debugging tips above can then further isolate the C++ code causing a
specific node to be created or changed.
The typical fix is to add a comparison operator to the problematic
container, e.g. compare using `AstNodeComparator` or by `name()`.
The following script is an example of this debugging:
.. code-block:: bash
# Before this: ./configure CXX="g++ -DVL_ALLOC_RANDOM_CHECKS" && make -j
# Example script for finding nondeterminism
cd $VERILATOR_ROOT
set -e
t=t_split_var_0 # Test name
test_regress/t/$t.py --debug --debug-alloc-random 33 --dumpi-tree 9 --obj-suffix .33
test_regress/t/$t.py --debug --debug-alloc-random 66 --dumpi-tree 9 --obj-suffix .66
bin/verilator_difftree test_regress/obj_vlt/$t{.33,.66} | grep -v CFILE | grep -v "^ " | grep -v /tmp | grep -v @@
Adding a New Feature
====================
Generally, what would you do to add a new feature?
1. File an issue (if there isn't already) so others know what you're
#. File an issue (if there isn't already) so others know what you're
working on.
2. Make a testcase in the test_regress/t/t_EXAMPLE format, see `Testing`.
#. Make a testcase in the test_regress/t/t_EXAMPLE format, see `Testing`.
3. If grammar changes are needed, look at the IEEE 1800-2023 Appendix A, as
#. If grammar changes are needed, look at the IEEE 1800-2023 Appendix A, as
src/verilog.y generally follows the same rule layout.
4. If a new Ast type is needed, add it to the appropriate V3AstNode*.h.
#. If a new Ast type is needed, add it to the appropriate V3AstNode*.h.
Follow the convention described above about the AstNode type hierarchy.
Ordering of definitions is enforced by ``astgen``.
5. Now you can run ``test_regress/t/t_<newtestcase>.py --debug`` and it'll
#. Now you can run ``test_regress/t/t_<newtestcase>.py --debug`` and it'll
probably fail, but you'll see a
``test_regress/obj_dir/t_<newtestcase>/*.tree`` file which you can
examine to see if the parsing worked. See also the sections above on
debugging.
6. Modify the later visitor functions to process the new feature as needed.
#. Modify the later visitor functions to process the new feature as needed.
Adding a New Pass
@@ -2243,9 +2312,6 @@ IEEE 1800-2023 31 Timing checks
IEEE 1800-2023 32 SDF annotation
No longer relevant with static timing analysis tools.
IEEE 1800-2023 33 Config
Little industry use.
Test Driver
===========
@@ -2347,7 +2413,7 @@ driver.py Non-Scenario Arguments
.. option:: --quiet
Suppress all output except for failures and progress messages every 15
seconds. Intended for use only in automated regressions. See also
seconds. Intended for use only in automated regression testing. See also
``--rerun``, and ``--verbose`` which is not the opposite of ``--quiet``.
.. option:: --rerun
@@ -2689,6 +2755,55 @@ xsim_flags / xsim_flags2 / xsim_run_flags
only for use with the Xilinx XSim simulator.
Version Release Process
=======================
This section documents the process to release a new version. This is not
intended to be run by other than the primary repository admins.
#. If activity requires, announce release pending as GitHub issue.
#. Check all test suites pass:
- rtlmeter (or wait until overnight cron passes).
- sv-tests (run manually or wait a few days and check proper version was
tested).
- uvm (currently requires private accellera access).
- verilator-ext-tests: ``make pull && make clean && make test``
#. Check documentation:
- ``nodist/log_changes # and update Changes``
- ``make spelling # and check warnings``
- ``make docs # and check warnings``
#. Prepare release:
- edit ``Changes`` to update version banner.
- edit ``configure.ac`` to change version number and "devel" to proper
ISO-format date.
- edit ``CMakeLists.txt`` version number.
#. Test and release:
- ``git commit -am "Version bump"``
- ``make distclean && autoconf && ./configure && make test``
- ``make maintainer-dist``
#. Wait for GitHub CI build actions to pass.
#. File announcement issue at verilator-announce, pasting in ``Changes``
information.
#. Devel release:
- edit ``Changes``, ``configure.ac``, ``CMakeLists.txt`` to devel and
devel version number.
- ``git commit -am "devel release"``
- ``make distclean && autoconf && ./configure && make test``
- ``git push``
#. Merge GitHub pull requests tagged ``status:merge-after-release``.
#. Check ``docs/guide/deprecations.rst`` for things due to remove.
Distribution
============

Some files were not shown because too many files have changed in this diff Show More