Commit Graph

8367 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
Krzysztof Bieganski 6c69210037
Fix multiple resolution of classes, broke recently (#6396) (#6410) (#6413)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2025-09-10 07:09:55 -04:00
Geza Lore 7f945bf89e
Optimize constant folding in wide expression expansion (#6381)
Do not apply V3Const in V3Expand after a function if nothing was
expanded in it.

Also fix statistics counter while at it.

Inspired by #6379, follow up from #6111
2025-09-10 11:45:08 +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
Wilson Snyder 1fd9f3ce92 Commentary: Changes update 2025-09-09 17:47:26 -04:00
Wilson Snyder 90e20cba3d Commentary: Update GitHub issue templates 2025-09-09 17:46:58 -04:00
Geza Lore dd11d5a598
Fix memory leaks - batch 1 (#6411) 2025-09-09 22:39:44 +01:00
Geza Lore 83ff8e13ba
Internals: Make bison output have correct debug info (#6409)
1. Move class V3ParseGrammar into V3ParseGrammar.h so editors understand
   it as c++ code
2. Fix #line directives in the bison output file

This together enables us to gdb through V3ParseGrammar, verilog.y, and
the bison generated C code step by step, with all source annotations in
the debug info pointing to the right place (e.g.: you will step to the
right place in verilog.y, then step back to the bison generated switch
statement/loop, and then step into calls in V3ParseGrammar as kind of
expected.
2025-09-09 15:47:45 +01:00
Geza Lore 77e5bb9ec9
CI: Run 24.04 clang build/test with --enable-asan (#6408) 2025-09-09 15:15:29 +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 a1167b3d55
Fix use after free in V3LinkDot (#6403) 2025-09-08 10:24:55 +01:00
Wilson Snyder e60f52ee0c Internals: Add CCall assertion 2025-09-07 17:18:23 -04:00
Wilson Snyder 72acb2edfd CI: rename workflow for consistency 2025-09-07 16:29:29 -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
Wilson Snyder f67534069c
CI: Avoid man page builds (#6402) 2025-09-07 13:32:34 -04:00
Wilson Snyder 4d671dc5d7 De-debug, as on wrong branch ;) 2025-09-07 11:27:48 -04:00
Wilson Snyder f851671c41 debug 2025-09-07 11:19:48 -04:00
Wilson Snyder d186dcdc32
ci: avoid man page builds (#6398) 2025-09-06 18:48:39 -04: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 819625de61 Lint cleanup 2025-09-06 09:04:05 -04:00
Wilson Snyder aa28a8d1e1 Fix cell scoping performance (#6059). 2025-09-06 08:35:07 -04:00
Wilson Snyder 0d1f036f17 Add error on non-packed struct randc (#5999). 2025-09-06 08:24:19 -04:00
Wilson Snyder b4a9ff4ffe Commentary: Changes update 2025-09-06 08:23:18 -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
Geza Lore 141de7b94a
Tests: Do not redirect interactive debugger stdout (#6389) (#6392) 2025-09-05 17:06:23 -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 a12caa4799 Internals: Remove double Class::Class 2025-09-04 19:18:02 +01: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 7d3c58d21c Docs: Notes about `--x-initial-edge` (#6377 comment) 2025-09-04 09:09:54 -04:00
dependabot[bot] 319ab84f90
Bump actions/checkout from 4 to 5 (#6374) 2025-09-04 08:21:26 -04:00
Wilson Snyder 4e091a1cf1 Tests: Ignore all bots in t_dist_contributors.py 2025-09-04 06:56:48 -04:00
dependabot[bot] e3acd528d8
Bump actions/create-github-app-token from 2.0.6 to 2.1.1 (#6375) 2025-09-04 06:21:48 -04:00
dependabot[bot] 43a03b1660
Bump docker/metadata-action from 4 to 5 (#6376) 2025-09-04 06:21:14 -04:00
Igor Zaworski 4070db9990
Fix rand variable inside constraint (#6315) 2025-09-04 06:19:08 -04:00
Geza Lore 5f0eb007b1
Internals: Squelch false GCC fallthrough warning (#6369) 2025-09-03 20:14:11 -04:00