Commit Graph

3970 Commits

Author SHA1 Message Date
Krzysztof Bieganski 5349b51e71
Allow pure functions in sensitivity lists (#6393)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-10 17:37:34 +02:00
Artur Bieniek 1923d23cff
Fix resolving default params upon instantiation or reference (#4497) (#6388)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
Co-authored-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-10 07:58:15 -04:00
Geza Lore c6b0918db5
Improve Dfg variable removal and temporary insertion (#6401)
Combined Dfg variable elimination into the regularization pass that runs
before converting back to Ast. This avoids introducing some unnecessary
temporaries.

Added replacing of variables with constants in the Ast if after the
Dfg passes they are known to be constants. This is only done in final
scoped Dfg application.

Avoid introducing temporaries for common sub-expressions that are
cheaper to re-compute than store in a temporary variable.

Enable removal of redundant unpacked array variables.

Also fixes #6394 as this patch involved changes to that code.
2025-09-10 12:38:49 +01:00
Wilson Snyder 220a3faf7c Fix parameter implicit type from string (#6414). 2025-09-09 19:49:11 -04:00
Wilson Snyder a9f95f2f08 Fix false CONSTVAR error on initializers (#4992). 2025-09-09 19:27:43 -04:00
Wilson Snyder f8f5f8f84b Commentary: Fix warning documentation, add consistency test. 2025-09-09 19:14:48 -04:00
Wilson Snyder f57d1255e9 Fix import error format 2025-09-09 18:32:04 -04:00
Geza Lore dd11d5a598
Fix memory leaks - batch 1 (#6411) 2025-09-09 22:39:44 +01:00
Geza Lore 5ffa05fba0
Fix AddressSanitizer issues (#6406)
These are all genuine bugs, brief descriptions.

1. V3OrderCFuncEmitter.h used to delete a node early that was still
   reference in a graph dump later. Not a big deal, it can be deleted
   later at the end of V3Order.

2. V3Param.cpp: this one is tricky. The variable referenced by
   AstVarXRef was deleted at the end of `visit(AstGenCase*)`, but then
   `visit(AstVarXRef*)` checks `nodep->varp()` (already deleted) to see
   if it's in an interface.

3. V3String::wildMatch is sometimes called with an empty 's' (the string
   we are matching against tha pattern 'p'), in which case it used to go
   off into the woods. Added check on call. An arbitrary number of `*`
   will still match the empty string.

4. V3Task.cpp: There was an error reported for an unsupported construct,
   then a subsequent SEGV. Just signal the error upward so we bail on an
   error in a more graceful way.

5. verylog.y: Some unsupported constructs failed to set the parsed node,
   so some memory thrash made it into some code downstream. Just parse
   these into nullptr.

Also increased the timeout on one test, which sometimes tripped with
asan on GCC during heavy host load.
2025-09-09 13:55:00 +01:00
Krzysztof Bieganski 0743d84bcc
Fix timing control under fork under function (#6407)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-09 14:12:24 +02:00
Wilson Snyder b45cf5960a Tests: Imporove t_covergroup_unsup (#6133) 2025-09-09 07:32:58 -04:00
Geza Lore 056c3ee331
Testing: Add --enable-asan configure option to compile with AddressSanitizer (#6404) 2025-09-09 08:55:49 +01:00
Wilson Snyder c6ffd22c45 Improve interface parent error wording (#5357) 2025-09-08 07:21:03 -04:00
Geza Lore 6bc48fcdb3
Improve Dfg type system (#6390)
Added a mini type system for Dfg using DfgDataType to replace Dfg's use
of AstNodeDType. This is much more restricted and represents only the
types Dfg can handle in a canonical form. This will be needed when
adding more support for unpacked arrays and maybe unpacked structs one
day.

Also added an internal type checker for DfgGraphs which encodes all the
assumptions the code makes about type relationships in the graph. Run
this in a few places with --debug-check. Fix resulting fallout.
2025-09-07 20:38:50 +01:00
Krzysztof Bieganski 46f8003c4e
Fix import of class with default params (#6396)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-06 21:21:50 +02:00
Wilson Snyder 3549fd1aa0 Add parsing of `$assert*`, `$coverage*` and `$q_*` as still unsupported. 2025-09-06 10:31:08 -04:00
Wilson Snyder 0d1f036f17 Add error on non-packed struct randc (#5999). 2025-09-06 08:24:19 -04:00
Wilson Snyder f41e36b99f Commentary: Convert docs examples to 2 space indents. 2025-09-06 07:51:49 -04:00
Wilson Snyder 85454f6083 Fix wire array with initial assignment (#6391). 2025-09-05 17:31:17 -04:00
Artur Bieniek 905c0c4f6d
Optimize dead functions without references (#6380) 2025-09-05 13:23:43 -04:00
Jakub Wasilewski a364704e3a
Improve `covergroup with function sample` handling (#6387) 2025-09-05 13:16:30 -04:00
Ryszard Rozak 107f64e53b
Fix segfault when modport variable is unresolved (#6386) 2025-09-05 14:27:46 +02:00
Geza Lore a966e6aa13
Improve automatic selection of logic for Dfg synthesis (#6370)
Reduce set of synthesized logic to be more in-line with what Dfg used to
handle before + drivers of circular variables. This was always the
intention but the previous algorithm was both a bit too eager, and also
missed some circular variables. We can add back more heuristics based on
performance measurements for non-circular logic later.
2025-09-05 08:14:48 +01:00
Wilson Snyder feea221f39 Fix COVERAGEIGN-ignored `get_inst_coverage` and other covergroup methods (#6383). 2025-09-04 22:18:56 -04:00
Geza Lore 63993436c9
Fix driver tracing of partially assigned variable (#6364) (#6378)
Fixes #6364
2025-09-04 15:02:33 +01:00
Wilson Snyder 4e091a1cf1 Tests: Ignore all bots in t_dist_contributors.py 2025-09-04 06:56:48 -04:00
Igor Zaworski 4070db9990
Fix rand variable inside constraint (#6315) 2025-09-04 06:19:08 -04:00
Wilson Snyder bd7f6d3c19 Fix randomize local after parameters applied (#6371). 2025-09-03 20:04:41 -04:00
Wilson Snyder 929d2ad83a Fix package imports not found after parameters applied (#6373). 2025-09-03 19:45:43 -04:00
Geza Lore a6f26b85b3
Internals: Improve DFG implementation details (#6355)
Large scale refactoring to simplify some of the more obtuse internals of
DFG. Remove multiple redundant internal APIs, simplify representation of
variables, fix potential unsoundness in circular decomposition. No
functional change intended.
2025-09-02 16:50:40 +01:00
Wilson Snyder 67f26508ba Support `$sscanf %t` 2025-09-01 14:40:22 -04:00
Wilson Snyder 33b838f139 Support 'this.super' 2025-09-01 13:07:02 -04:00
Krzysztof Bieganski f58b323736
Wrap forked processes in begins early (#6343) (#6354)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-01 17:25:57 +02:00
Wilson Snyder 4bf2d0d755 Tests: More uvm_dpi testing (#4566) 2025-09-01 08:32:13 -04:00
Wilson Snyder 9953851287 Tests: Add t_math_synmul and t_math_wallace from verilator_ext_tests 2025-08-31 11:12:14 -04:00
Wilson Snyder c73259d2f0 Tests: Upgrade some failing tests without expected .out files. 2025-08-31 11:12:14 -04:00
Wilson Snyder 6a14facf48 Tests: Fix version miscompare in t_uvm_dpi 2025-08-30 18:10:13 -04:00
Wilson Snyder b6ecffeb60 Support recursive constant functions. 2025-08-30 07:45:35 -04:00
Wilson Snyder 712ff95a48 Internals: Remove unneeded return, cleanup param test. No functional change 2025-08-30 07:42:41 -04:00
Wilson Snyder fbfd1f12dd Tests: Fix sarif reruns 2025-08-29 21:36:54 -04:00
Krzysztof Bieganski 40dda323fe
Fix upcasting class type parameters (#6344)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-08-29 21:20:09 -04:00
Wilson Snyder 91ae4c35b7 Add error on force/release non-constant selects. 2025-08-29 21:19:37 -04:00
Wilson Snyder 91d138248d Tests: Favor all caps for tests' parameters. No test change. 2025-08-29 18:33:14 -04:00
Szymon Gizler 8868d459a2
Fix broken support of unassigned virtual interfaces (#6253) (#6338)
* Fix broken support of unassigned virtual interfaces

Unassigned virtual interface support added by #6245 is broken - PR marks
dead module as alive - we can't do that as once a module is dead it
needs to remain dead because earlier steps (e.g. port resolution) have
already been skipped.

This commit handles unassigned virtual interfaces at the beginning of
first pass of LinkDot (so it is never marked as dead, and no linking
steps are getting skipped).

Fixes #6253.

* Apply suggestions from code review

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Apply 'make format'

* Revert add of redundant iterateChildren() call

* Add original test case

---------

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
Co-authored-by: github action <action@example.com>
2025-08-28 09:03:46 -04:00
Geza Lore 1043a6c6be
Fix splitting of assignments to SC variables (#6329) (#6336)
SC variables can only be assigned whole, so do not split up
concatenation assignments in V3FuncOpt.

Fixes #6329
2025-08-28 08:48:51 +01:00
Wilson Snyder 409e036eca Add error on gate primitive connection width mismatch 2025-08-27 22:28:09 -04:00
Wilson Snyder e32108713d Fix randomize on function-local variable (#6234). 2025-08-27 21:25:40 -04:00
Wilson Snyder 54efa86a6c Fix error on too many UDP port inputs 2025-08-27 07:48:33 -04:00
Ryszard Rozak ac21d25d43
Support simple disable within task (#6334) 2025-08-26 10:39:24 -04:00
Geza Lore a841a962ce
Optimize interfaces in Dfg (#6332)
Interfaces that have no corresponding virtual interface references can
be safely optimized by Dfg after V3Scope. Enabling it to do so.
2025-08-26 11:24:15 +01:00