Commit Graph

4340 Commits

Author SHA1 Message Date
Wilson Snyder 734e7a9526 Add error on function invoking task. 2025-09-23 19:51:34 -04:00
Artur Bieniek f719d66129
Fix timeprecision backward assignment (#6469)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-09-23 17:17:07 -04:00
Geza Lore 800af37975
Internals: Refactor generate construct Ast handling (#6280) (#6470)
Internals: Refactor generate construct Ast handling (#6280)

We introduce AstNodeGen, the common base class of AstGenBlock,
AstGenCase, AstGenFor, and AstGenIf, which together represent all SV
generate constructs. Subsequently remove AstNodeFor, AstNodeCase
(AstCase is now directly derived from AstNodeStmt) and adjust internals
to work on the new representation.

Output is identical modulo hashes do to changed AstNode type ids, no
functional change intended.

Step towards #6280.
2025-09-23 19:49:01 +01:00
Ryszard Rozak be0392a2b2
Fix splitting hierarchically referenced variables (#6475) 2025-09-23 10:16:49 -04:00
Wilson Snyder b794c7c8d4 Add error on parameter values from hierarchical paths (#1626) (#6456). 2025-09-22 22:24:45 -04:00
Geza Lore 40ca0527db
Internal: Refactor AstAssignAlias (#6280) (#6473)
Rename AstAssignAlias to AstAlias and make it derive from AstNode
instead of AstNodeStmt.

Replace AstAlias with AstAssignW in V3LinkDot::linkDotScope, which is
the last place we need to be aware of the alias construct. Using
AstAssignW dowstream enables further optimization while preserving the
same functionality.
2025-09-22 16:30:26 -04:00
Wilson Snyder a647747260 Add IMPLICITSTATIC also on procedure variables. 2025-09-21 19:52:19 -04:00
Wilson Snyder e0e0fb08a5 Fix missing BLKSEQ when connecting module port to array (#2973). 2025-09-21 13:02:50 -04:00
Wilson Snyder 006b45526b Tests: Rename t_lint_blkseq. No test change. 2025-09-21 12:56:01 -04:00
Wilson Snyder 9697a5ce6d Add verilator_gantt profiling of DPI imports (#3084). 2025-09-21 11:37:44 -04:00
Wilson Snyder 53b8a5b027 Add error on zero/negative unpacked dimensions (#1642). 2025-09-21 09:41:58 -04:00
Wilson Snyder ed380f08fe Tests: Add t_forceable_public flat (#3955) 2025-09-20 23:06:41 -04:00
Wilson Snyder 9af8e76e87 Fix assertion on streaming from queues 2025-09-20 20:52:46 -04:00
Wilson Snyder af54a26b43 Fix parsing of `with (...) {...}` but still unsupported 2025-09-20 19:59:31 -04:00
Wilson Snyder 580a843474 Fix randomize inside module without any classes 2025-09-20 17:13:54 -04:00
Wilson Snyder b237eec801 Add error on string addition 2025-09-20 13:47:17 -04:00
Wilson Snyder 19ca140165 Improve adding model error message 2025-09-20 11:32:15 -04:00
Wilson Snyder bfc438c455 Tests: Add t_param_default_override (#4920) 2025-09-20 11:32:15 -04:00
Wilson Snyder d3b085ab8a Fix t_sarif (#6463 partial) 2025-09-20 11:32:15 -04:00
Geza Lore d1eda66668
Deprecate clocker attribute and --clk option (#6463)
The only use for the clocker attribute and the AstVar::isUsedClock that
is actually necessary today for correctness is to mark top level inputs
of --lib-create blocks as being (or driving) a clock signal. Correctness
of --lib-create (and hence hierarchical blocks) actually used to depend
on having the right optimizations eliminate intermediate clocks (e.g.:
V3Gate), when the top level port was not used directly in a sensitivity
list, or marking top level signals manually via --clk or the clocker
attribute. However V3Sched::partition already needs to trace through the
logic to figure out what signals might drive a sensitivity list, so it
can very easily mark all top level inputs as such.

In this patch we remove the AstVar::attrClocker and AstVar::isUsedClock
attributes, and replace them with AstVar::isPrimaryClock, automatically
set by V3Sched::partition. This eliminates all need for manual
annotation so we are deprecating the --clk/--no-clk options and the
clocker/no_clocker attributes.

This also eliminates the opportunity for any further mis-optimization
similar to #6453.

Regarding the other uses of the removed AstVar attributes:
- As of 5.000, initial edges are triggered via a separate mechanism
  applied in V3Sched, so the use in V3EmitCFunc.cpp is redundant
- Also as of 5.000, we can handle arbitrary sensitivity expressions, so
  the restriction on eliminating clock signals in V3Gate is unnecessary
- Since the recent change when Dfg is applied after V3Scope, it does
  perform the equivalent of GateClkDecomp, so we can delete that pass.
2025-09-20 15:50:22 +01:00
Wilson Snyder 50dfdcb6cc Support digits in `$sscanf` field width formats (#6083). 2025-09-20 10:26:36 -04:00
Wilson Snyder 7f85d7f453 Add error on localparam value from hierarchical path (#6456). 2025-09-20 09:59:48 -04:00
Wilson Snyder f970485e19 Fix some missing E_UNSUPPORTED errors 2025-09-20 08:19:42 -04:00
Wilson Snyder e5e7e844c4 Tests: Fix assignment type mismatch (#6461) 2025-09-19 22:59:13 -04:00
Wilson Snyder 4e866fd710 Add error on module automatic variables. 2025-09-19 22:05:03 -04:00
Bartłomiej Chmiel bbcb9315f3
Fix loss of clock attribute in Dfg variable removal (#6453) 2025-09-19 14:44:34 +01:00
Artur Bieniek 08be65a7dd
Optimize dead functions in more cases (#6430)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-09-19 09:36:57 -04:00
Artur Bieniek c1ac2a79db
Resolve data types of method calls without parenthesis (#6457)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-09-19 07:43:22 -04:00
Wilson Snyder 46e56ca6fc Fix elaboration displays with some `%p` (#6451). 2025-09-18 08:35:07 -04:00
Wilson Snyder c15489b711 Fix associative array default type resolution 2025-09-17 23:39:47 -04:00
Wilson Snyder 7f871467bf Internals: Cleanup assertion 2025-09-17 23:38:00 -04:00
Wilson Snyder 3a039df351 Tests: Strictly test exit codes (no unexpected core dumps) 2025-09-17 21:01:11 -04:00
Wilson Snyder 542ffcca60 Prevent internal error on pattern mismatch 2025-09-17 21:01:11 -04:00
Wilson Snyder 57c82b9c34 Fix false unique assertions on `else ;` (#6450). 2025-09-17 17:43:36 -04:00
Artur Bieniek 3c8b8b65d0
Fix relinking super functions to parametrized class (#6431) (#6438)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-09-17 08:07:04 -04:00
Wilson Snyder b10c6293d9 Fix elaboration displays with `%m` (#6445). 2025-09-16 20:50:15 -04:00
Wilson Snyder d7f4dbfd13 Fix class.randomize without parens. 2025-09-16 18:56:04 -04:00
Geza Lore f39d6e6108
Deprecate sensitivity list on public_flat_rw attributes (#6443)
These are no longer required for correct scheduling. They are still
accepted for backward compatibility, but have no effect on simulation
and are dropped in the front-end. Also removed the then redundant
AstAlwaysPublic class.

Fixes #6442
2025-09-16 22:38:53 +01:00
Geza Lore a44907b700
Fix memory leaks - batch 4 (#6439) 2025-09-16 19:22:36 +01:00
Ryszard Rozak c856380fac
Support modports referencing clocking blocks (#4555) (#6436) 2025-09-16 13:25:40 -04:00
Wilson Snyder 9187b4d552 Fix internal error on out-of-bounds real array access. 2025-09-16 08:18:51 -04:00
Bartłomiej Chmiel dca555b6d7
Fix pre/post increments in assertions (#6434) 2025-09-15 10:50:31 -04:00
Wilson Snyder 39a9a00299 Fix external function declarations with class typedef references (#6433 expanded). 2025-09-14 23:52:48 -04:00
Wilson Snyder 218af5500b Fix external function declarations with class typedef references (#6433). 2025-09-14 21:53:13 -04:00
Wilson Snyder 5e4668c146 Support get/set_randstate as class method. 2025-09-14 10:33:50 -04:00
Wilson Snyder 4b5e602392 Tests: Skip for reloc t_lint_assigneqexpr_bad 2025-09-14 10:33:27 -04:00
Wilson Snyder a2b6aca288 Tests: Refactor to create test.root variable. No test change. 2025-09-14 08:43:52 -04:00
Wilson Snyder b455f9b591 Add ASSIGNEQEXPR when use `=` inside expressions (#5567). 2025-09-14 08:28:47 -04:00
Wilson Snyder ff0bf0a5e3 Tests: Add testcase (#4998) 2025-09-13 10:45:05 -04:00
Wilson Snyder 663a9a3add Add waiver for foreach SIDEEFFECT in future UVM 2025-09-13 10:21:42 -04:00
Bartłomiej Chmiel be813e96dd
Fix hierarchical `--prof-pgo` (#6213) 2025-09-13 10:19:00 -04:00
Wilson Snyder 907047d823 Tests: Remove unneeded AUTOARGS. No test change. 2025-09-13 09:28:43 -04:00
Wilson Snyder 62d403c060 Internals: Reformat verilated_std.sv. No functional change. 2025-09-13 09:10:51 -04:00
Wilson Snyder 419e775dfb Tests: Support ANSI input in driver 2025-09-13 08:53:23 -04:00
Artur Bieniek 1f61351e8f
Fix resolving parameters (#6388) (#6418) (#6421) (#6438) (#6429)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-09-12 14:24:07 -04:00
Wilson Snyder 8b7a841f09 Tests: Relax contributors for multi-language names 2025-09-12 08:43:45 -04:00
Wilson Snyder 1308be28fe Tests: Rename t_class_link* 2025-09-12 08:37:15 -04:00
Artur Bieniek 990ee994db
Fix resolving parameters (#6388) (#6418) (#6421) 2025-09-12 07:18:12 -04:00
Bartłomiej Chmiel 9a6b24fca4
Fix parsing for sequence expressions (#6427)
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
2025-09-12 07:17:26 -04:00
Wilson Snyder 04aa6ebb42 Tests: t_dynarray (#2618) 2025-09-11 20:05:49 -04:00
Geza Lore 4866cfa09f
Fix deep shift pattern performance (#6379) (#6420) 2025-09-11 11:10:14 -04:00
Geza Lore 56927fb955
Fix memory leaks - batch 3 (#6419) 2025-09-11 12:01:36 +01:00
Geza Lore f1396fbced
Fix memory leaks - batch 2 (#6417) 2025-09-10 22:42:45 +01:00
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
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 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
Wilson Snyder ac2859bf24
Internals: Upgrade to clang-format-18 (#6333) 2025-08-25 20:47:48 -04:00
Wilson Snyder 703f0d8c5d Commentary: spelling 2025-08-25 18:47:08 -04:00
Geza Lore 02e64f0795
Optimize multiplexers in Dfg synthesis (#6331)
The previous algorithm was designed to handle the general case where a
full control flow path predicate is required to select which value to
use when synthesizing control flow join point in an always block.

Here we add a better algorithm that tries to use the predicate of
the closest dominating branch if the branch paths dominate the joining
paths. This is almost universally true in synthesizable logic (RTLMeter
has no exceptions), however there are cases where this is not
applicable, for which we fall back on the previous generic algorithm.

Overall this significantly simplifies the synthesized Dfg graphs and
enables further optimization.
2025-08-25 13:47:45 +01:00
Igor Zaworski c2cac8a7fd
Fix of localize for super constructors with function calls as arguments (#6330) 2025-08-25 06:55:11 -04:00
Wilson Snyder ac2a75fbb5 Support future sampled value functions. 2025-08-23 21:16:53 -04:00
Wilson Snyder 7affb3e580 Internals: Add $past variable statistic 2025-08-23 21:10:46 -04:00
Wilson Snyder b226be7f98 Fix to select UDPs when they are the only candidate for a top module. 2025-08-23 15:20:58 -04:00
Aleksander Kiryk a9aa2f11b8
Improve testing on FreeBSD (#6328)
* Skip profiling tests on non-glibc platforms

* Enforce dumb terminal in tests

* Include POSIX headers whenever __unix__ macro is defined

* Treat no procfs as normal condition

* Respect MAKE variable when running make
2025-08-23 10:49:03 -04:00
Aleksander Kiryk 34315a4f70
Fix FreeBSD missing headers (#6326)
* Include missing libgen.h

* Include missing cinttypes
2025-08-23 10:38:18 -04:00
Geza Lore 1c86ff0af2
Fix corner case bugs in module and variable inlining (#6322)
There were a couple corner case bugs in V3Inline, and one in Dfg when
dealing with inlining of modules/variables.

V3Inline:
- Invalid code generated when inlining an input that also had an
  assignment to it (Throws an ASSIGNIN, but this is sometimes reasonable
  to do, e.g. hiererchical reference to an unonnected input port)
- Inlining (aliasing) publicly writeable input port.
- Inlining forcable port connected to constant.

Dfg:
- Inining publicly writeable variables

The tests that cover these are the same and fixing one will trigger the
other bug, so fixing them all in one go. Also cleanup V3Inline to be less
out of order and rely less on unique APIs only used by V3Inine (will
remove those in follow up patch).

Small step towards #6280.
2025-08-22 21:43:49 +01:00
Igor Zaworski f506aa878b
Fix of inline constraints with member selects (#6321) 2025-08-22 07:58:03 -04:00
Igor Zaworski b95a974ff1
Support generic interfaces (#6272) 2025-08-22 06:44:35 -04:00
Artur Bieniek b19215770b
Fix direct NBA to dynamically-sized variable (#6310) 2025-08-22 06:21:13 -04:00
Wilson Snyder 457fcc267b Support elaboration-time printing of unpacked array with `%p` (#4732). 2025-08-21 21:44:31 -04:00
Wilson Snyder e202cb31d8 Change `$display("%p")` to remove space after `}`. 2025-08-21 21:33:05 -04:00
Igor Zaworski 631714c50a
Fix expression type comparison (#6316) 2025-08-21 06:26:30 -04:00
Geza Lore 327d55d13d
Internals: Fix remaining cppcheck errors (#6319)
Fixed the non const-related issue and added suppressions for the const
ones. With that `make cppcheck` should be clean.
2025-08-21 09:43:37 +01:00
Wilson Snyder bd91b619ad Support `$fread` with missing start (#6125). 2025-08-20 21:19:42 -04:00
Wilson Snyder dc5a17fea0 Support unpacked array `with` methods (#6134). 2025-08-20 21:01:34 -04:00
Ryszard Rozak 3d3462b209
Support disabling a fork from within that fork (#6314) 2025-08-20 12:21:07 -04:00
Igor Zaworski 11667160f2
Fix static vars under member select (#6313) 2025-08-20 11:23:16 -04:00
Ryszard Rozak 95c8b7bb00
Support separate coverage counters for toggles 0->1 and 1->0 (#6086) 2025-08-20 07:31:04 -04:00
Geza Lore 636a6b8cd2
Optimize complex combinational logic in DFG (#6298)
This patch adds DfgLogic, which is a vertex that represents a whole,
arbitrarily complex combinational AstAlways or AstAssignW in the
DfgGraph.

Implementing this requires computing the variables live at entry to the
AstAlways (variables read by the block), so there is a new
ControlFlowGraph data structure and a classical data-flow analysis based
live variable analysis to do that at the variable level (as opposed to
bit/element level).

The actual CFG construction and live variable analysis is best effort,
and might fail for currently unhandled constructs or data types. This
can be extended later.

V3DfgAstToDfg is changed to convert the Ast into an initial DfgGraph
containing only DfgLogic, DfgVertexSplice and DfgVertexVar vertices.

The DfgLogic are then subsequently synthesized into primitive operations
by the new V3DfgSynthesize pass, which is a combination of the old
V3DfgAstToDfg conversion and new code to handle AstAlways blocks with
complex flow control.

V3DfgSynthesize by default will synthesize roughly the same constructs
as V3DfgAstToDfg used to handle before, plus any logic that is part of a
combinational cycle within the DfgGraph. This enables breaking up these
cycles, for which there are extensions to V3DfgBreakCycles in this patch
as well. V3DfgSynthesize will then delete all non synthesized or non
synthesizable DfgLogic vertices and the rest of the Dfg pipeline is
identical, with minor changes to adjust for the changed representation.

Because with this change we can now eliminate many more UNOPTFLAT, DFG
has been disabled in all the tests that specifically target testing the
scheduling and reporting of circular combinational logic.
2025-08-19 15:06:38 +01:00
Geza Lore 0bf9fc270f
Iternals: Remove AstAssignPre/AstAssignPost (#6307)
Replace with AstAlwaysPre/AstAlwaysPost with AstAssign under them.

Step towards #6280
2025-08-19 09:27:59 +01:00
Wilson Snyder c90f9e53b7
Add ALWNEVER warning, for `always @*` that never execute (#6291) (#6303) 2025-08-18 12:00:53 -04:00
Artur Bieniek 53c59e7ac7
Fix referencing module variables above classes (#6304)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-08-18 08:51:25 -04:00
Wilson Snyder 88046c8063 Internals: Rename AstSenTree pointers to sentreep. No functional change intended except JSON. 2025-08-17 19:14:34 -04:00
Wilson Snyder eaecdf7477 Tests: Improve check for member brace initialization. 2025-08-17 14:40:10 -04:00
Geza Lore f6edf26eb2
Fix hierarchical NBAs (#6286) (#6300)
NBAs targeting a variable in a different scope are now allocated
temporary variables for captured values in the scope of the NBA, not the
scope of the target variable.

Fixes #6286
2025-08-17 19:35:40 +01:00
Wilson Snyder b14539569f Internals: Check and enforce member brace initialization. No functional change intended 2025-08-17 13:20:52 -04:00
Wilson Snyder 7126293086 Support enum.next with a parameter 2025-08-16 21:06:35 -04:00
Wilson Snyder 48a12fb0f4 Document and test `+verilator+rand+reset+2` usage (#6285 partial) 2025-08-16 11:47:19 -04:00
Wilson Snyder 340d1aff4a Tests: Cleanup to favor '--binary'. No test change intended. 2025-08-16 09:26:42 -04:00
Geza Lore d273e2cbd0 Internals: Do not astgen useless Dfg vertex subtypes 2025-08-15 20:06:58 +01:00
Geza Lore 9c11f5e05d Fix DFG circular driver tracing 2025-08-15 10:20:20 +01:00
Mateusz Gancarz e753480b19
Fix no matching function calls for randomized `VlWide` in unpacked and dynamic arrays (#6290) 2025-08-14 05:19:33 -07:00