Commit Graph

4340 Commits

Author SHA1 Message Date
Bartłomiej Chmiel 31e73f1645
Support simple cycle delay sequence expressions inside assertion properties (#6508)
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2025-10-10 16:16:15 +02:00
Wilson Snyder 4f1d8a1b15 Tests: Revert bad expect test 2025-10-10 07:59:55 -04:00
Artur Bieniek a7f4ff7b06
Tests: Set higher timeout with ASAN (#6546)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-10-10 06:37:53 -04:00
Wilson Snyder 3027f67b6f Internals/Tests: Cleanup some missing dev coverage items 2025-10-09 22:33:04 -04:00
Wilson Snyder 41b05cb1f8 Fix intent error on quoted strings (#6544). 2025-10-09 21:24:27 -04:00
Geza Lore 9dc0cf5a7c
Internals: Use a V3Graph for the hierarchical plan (#6545)
I stared this because the emitted makefiles for hierarchical verilation
were non-deterministic (iterating unordered_map indexed by pointers).
Then I realized that the V3HierPlan is just a dependency graph encoded
in a slightly idiosyncratic way. We do have a data structure to use for
that instead.

With that the output should always be deterministic + have nicer dumps.
2025-10-09 21:41:23 +02:00
Igor Zaworski 1a91ab02cf
Fix passing typedef value as parameter (#6543) 2025-10-09 10:08:06 -04:00
Geza Lore 7b4ad29260 Testing: Ignore non-deterministic tests in `make test-snap`
Added tests with expectedly unstable output to ignore list for
`make test-snap` and `make test-diff`.
2025-10-09 10:34:31 +01:00
Geza Lore e33b24fad2 Fix Dfg circular driver tracing with partial assignments 2025-10-09 09:31:19 +01:00
Geza Lore 49c51af841
Deprecate '--make cmake' option (#6540) 2025-10-08 09:40:17 -04:00
Artur Bieniek 222a3655ba
[#84482] Fix inconsistent force assignment (#6541)
Signed-off-by: Artur Bieniek <abieniek@internships.antmicro.com>
2025-10-08 09:39:50 -04:00
Geza Lore c8c53f9a18 Tests: Remove sanitize option and parameter
Fixes #6536
2025-10-08 08:51:42 +01:00
Geza Lore 838b8a2bec Internals: Remove dead code, fix or sign off coverage
Remove/fix/signoff uncontroversial code coverage holes. Also added a
couple TODOs that should be investigated at some point
2025-10-08 08:24:06 +01:00
Wilson Snyder 1a8f9f0483 Improve `lint_off` to allow multiple messages and comments (#2755 partial). 2025-10-07 22:49:42 -04:00
Wilson Snyder 2631af977a Tests: Update t_lint_historical.v 2025-10-07 22:44:39 -04:00
Wilson Snyder 165622a9e9 Add NORETURN warning on functions without return values (#6534). 2025-10-07 21:06:11 -04:00
Wilson Snyder f979e459e8 Add error on ranges with tristate values (#6534). 2025-10-07 20:36:50 -04:00
Wilson Snyder bfe39ce5bc Fix `--trace-max-width` and increase to 4096. (#2385). 2025-10-07 18:50:31 -04:00
Wilson Snyder 717667034b Fix loop exits on $finish 2025-10-06 19:19:15 -04:00
Wilson Snyder 5229ce8660 Fix error on circular structure typedef 2025-10-06 18:45:56 -04:00
Bartłomiej Chmiel 9f5d22b21f
Fix parsing of `eventually[]` and pexpr memory leaks (#6530)
* Fix parsing of eventually[]
* Fix parser memory leaks for pexpr

Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
2025-10-06 15:42:40 +02:00
Wilson Snyder f09c30df35
Internals: Refector to create single V3Number::emitC. Fix some double emit issues (#6528). 2025-10-04 07:23:13 -04:00
Todd Strader defe282fe8
Fix always_ff on constant (#6519) 2025-10-03 13:16:12 -04:00
Geza Lore ce0a05691b
Internals: Improve coverage flow (#6526)
See addes "Code coverage" section in docs/internals.rst
2025-10-03 17:18:24 +01:00
Geza Lore 62dbbbba85 Internals: Rename --enable-asan to --enable-dev-asan and related 2025-10-03 12:26:48 +01:00
Ryszard Rozak 2c74765246
Fix find_index methods of associative arrays (#6525)
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
Co-authored-by: Nikolai Kumar <nkumar@mips.com>
2025-10-02 12:05:24 -04:00
Bartłomiej Chmiel cb5c56dac4
Internals: fix assertion type dumping (#6523) 2025-10-02 12:03:45 -04:00
Geza Lore 4d518873d0 Fix stray net delay in parser
Fixes #6500
2025-10-01 10:19:39 +01:00
Szymon Gizler e21c4fbbb5
Fix .vlt public_flat* and others to support long identifier names (#6516) 2025-09-30 16:55:11 -04:00
Ryszard Rozak 09518ee207
Support aliases with more operands (#6501) 2025-09-29 13:23:51 -04:00
Geza Lore 603f4c615a
Improve Loop unrolling (#6480) (#6493)
This patch implements #6480. All loop statements are represented using
AstLoop and AstLoopTest.

This necessitates rework of the loop unroller to handle loops of
arbitrary form. To enable this, I have split the old unroller used for
'generate for' statements and moved it into V3Param, and subsequently
rewrote V3Unroll to handle the new representation. V3Unroll can now
unroll more complex loops, including with loop conditions containing
multiple variable references or inlined functions.

Handling the more generic code also requires some restrictions. If a
loop contains any of the following, it cannot be unrolled:
- A timing control that might suspend the loop
- A non-inlined call to a non-pure function

These constructs can change the values of variables in the loop, so are
generally not safe to unroll if they are present. (We could still unroll
if all the variables needed for unrolling are automatic, however we
don't do that right now.)

These restrictions seem ok in the benchmark suite, where the new
unroller can generally unroll many more loops than before.
2025-09-29 15:25:25 +01:00
Igor Zaworski 83f4db956b
Fix side effects when using select (#6460) 2025-09-29 08:20:54 -04:00
Wilson Snyder bdae48f6ae
Optimize duplicate 'if' and '?:' conditions (#3807) (#6495) 2025-09-29 08:18:54 -04:00
Wilson Snyder 3b049ab9ee Tests: Add t_lint_always_comb_automatic (#2862) 2025-09-28 21:23:15 -04:00
Wilson Snyder 21b42c4463 Fix LATCH warning with CASEINCOMPLETE (#3301). 2025-09-28 21:13:42 -04:00
Wilson Snyder ca0a679413 Format 2025-09-27 20:59:44 -04:00
Wilson Snyder a7e6efb4c0 Internals: Some prep from branch towards multitrace (#5813 prep) 2025-09-27 20:54:26 -04:00
Wilson Snyder 7ef3b808ea Fix false BLKSEQ on non-edged sensitivity list (#6492). 2025-09-27 20:50:32 -04:00
Wilson Snyder b3350a4f3b Add error on `virtual new` (#6486). 2025-09-26 21:23:40 -04:00
Wilson Snyder 1761622e14 Fix unused parameterized class causing internal error (#4013). 2025-09-26 20:50:47 -04:00
Ryszard Rozak 500312c050
Support for simple alias statements (#6339) 2025-09-26 15:19:48 +02:00
Wilson Snyder 4ad1dde723 Internals: Emit newlines for AstCStmt automatically. No functional change intended. 2025-09-26 08:25:47 -04:00
Wilson Snyder 21dbdbf69d Tests: Auto-skip when not in root repo 2025-09-25 21:08:24 -04:00
Wilson Snyder 269476df6e Add FUNCTIMCTL now as a named error, so can disable (#6385). 2025-09-25 19:19:31 -04:00
Wilson Snyder 87224db145 Test: Update t_interface_parent_scope (#1623) 2025-09-25 10:50:32 -04:00
Todd Strader aa6fbd35db
Add HIERPARAM error code (#6456) (#6484) 2025-09-25 10:27:26 -04:00
Wilson Snyder c9e021924f Support class package reference on pattern keys (#5653). 2025-09-25 06:52:42 -04:00
Wilson Snyder 28ee2ebb30 Fix PROTOTYPEMIS error on implicit logic (#6482). 2025-09-23 22:28:21 -04:00
Wilson Snyder fd12ab3413 Fix interface exposure with `--public-depth` or `--trace-depth` (#5758). 2025-09-23 22:05:51 -04:00
Wilson Snyder d972b7465a Add error on function invoking time-controlling statements (#6385). 2025-09-23 20:16:23 -04:00
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