Commit Graph

1029 Commits

Author SHA1 Message Date
Ali Hammoud 0d3848c554
Merge edea97a63f into a0b89dde8e 2026-02-15 21:54:44 +01:00
Wilson Snyder 9ba625225d Internals: Minor cleanups preparing for initialization fixes. No functional change. 2026-02-08 17:54:04 -05:00
Wilson Snyder a05cbd8382 Support structure initial values (#6130).
Fixes #6130.
2026-02-01 13:44:20 -05:00
Wilson Snyder 7ca113a84f Fix non-inlined function return value clearing (#6982). 2026-02-01 11:57:09 -05:00
Wilson Snyder 7c6c6a684b Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
Artur Bieniek a7db9ee32f
Add error when accessing a non-static class field from a static function (#6948) 2026-01-23 10:18:24 -05:00
Wilson Snyder ac4f9f013e Fix static call after covergroup (#6916 repair) 2026-01-18 19:58:33 -05:00
Jose Drowne 3a080ef543
Add IEEE 4-state type lint checks (#3645 partial) (#6895) 2026-01-18 11:00:25 -05:00
Jose Drowne 12080dfcb1
Internals: Add AST nodes for tagged union parsing (#6867 partial) (#6881) 2026-01-17 14:15:52 -05:00
Wei-Lun Chiu 3b6674386c
Support unbounded '$' in inside range expressions (#6935) (#6938) 2026-01-17 12:03:00 -05:00
github action f6532728f6 Apply 'make format' 2026-01-17 15:35:34 +00:00
emmettifelts e6be548f72
Fix segfault after assignment pattern XOR error (#6928) (#6931) 2026-01-17 10:34:36 -05:00
Artur Bieniek 4563501192
Fix error when calling non-static method (#6916) 2026-01-14 08:40:57 -05:00
Yutetsu TAKATSUKASA b926fcb762
Improve signedness of packed array (#6901) (#6902)
* Tests: Add a test whether signedness of a packed array is properly implemented.

* Fix signedness of a packed array when named type is not used.

* Fix signedness of the entire packed array.
2026-01-10 09:06:37 +09:00
Wilson Snyder 3b1a7af74d Fix WIDTHEXTEND suppression on add/sub with single-bit signal. 2026-01-09 00:25:12 -05:00
Ryszard Rozak 97d5844f2e
Support dynamic array elements in std::randomize (#6896) 2026-01-08 09:02:28 -05:00
Jakub Wasilewski 72a6da5ac8
Support complex expressions as std::randomize arguments (#6860) 2026-01-05 14:37:36 -05:00
Wilson Snyder 13327fa9c0 Copyright year update. 2026-01-01 07:22:09 -05:00
Wilson Snyder 4775399716 Commentary: spelling 2025-12-28 21:30:16 -05:00
Wilson Snyder 7a2b20cff3 Fix formatting of %p to be spaceless 2025-12-26 21:45:52 -05:00
Krzysztof Bieganski a2fcd37c08
Fix unsupported `if` virtual interface warning (#6558) (#6861) 2025-12-23 10:12:34 -05:00
Ali Hammoud edea97a63f Partially support IEEE 1800-2017 section 10.9.1 apply default recursively (#4589) 2025-12-21 22:26:46 -05:00
Wilson Snyder c2c00888d6 Fix firing array selects of events (#6829). 2025-12-18 20:45:22 -05:00
Wilson Snyder 24e43f4ddd Internals: Add assertion at expected expressions (#6829 partial) 2025-12-18 20:37:11 -05:00
Alex Solomatnikov 8da8ca4203
Fix error on resized lvalues with warning suppressed (#6497) (#6816) 2025-12-15 06:49:32 -05:00
Wilson Snyder 075d624b29 Add SUPERNFIRST error on super.new on non-first statement (#6784). 2025-12-09 19:22:59 -05:00
Wilson Snyder a3f913c5b1 Fix randomize call in parameterized class 2025-12-08 20:26:53 -05:00
Wilson Snyder ae480c5f76 Fix enum item references in class extends with parameters. 2025-12-07 15:26:52 -05:00
Wilson Snyder 4b02e32314 Fix DPI under param class (#6733 partial) 2025-12-07 13:30:54 -05:00
Wilson Snyder 35a794687b Internals: Add some additional dangling checks. No functional change intended 2025-12-07 13:25:37 -05:00
Wilson Snyder cfada791e6 Internals: Fix leak in covergroup, last commit 2025-12-05 04:14:24 -05:00
Wilson Snyder 2f4b178957 Support parsing only of covergroup.option.option_name 2025-12-04 21:55:55 -05:00
Yilou Wang 1fc86fd2f1
Fix randomize called within func/task (#6144) (#6753)
Co-authored-by: Udaya Raj Subedi <075bei047.udaya@pcampus.edu.np>
2025-12-04 07:18:07 -05:00
Wilson Snyder 7957701db8 Suppress unsupported for unused constant sequences 2025-12-03 21:23:48 -05:00
Wilson Snyder b9b6eb61d9 Support randsequence (#6131) 2025-11-30 09:04:42 -05:00
Yilou Wang f4654a451b
Support array reference arguments into 'std::randomize()' (#6384) (#6719) 2025-11-26 15:50:24 +03:00
Wilson Snyder 840c8f5782 Internals: Auto-set useRandimizeMethods if new a AstRandCase. No functional change 2025-11-23 17:14:19 -05:00
github action 59bc4cf66b Apply 'make format' 2025-11-16 03:53:48 +00:00
Jean-Nicolas Strauss 6454a8802e
Fix stream operator widening (#6693) (#6697) 2025-11-15 22:52:52 -05:00
Yilou Wang 048c97f0ae
Support `std::randomize(){...}` (#4706) (#6573) 2025-11-14 14:32:01 -05:00
Wilson Snyder c493982511 Spelling fixes 2025-11-08 16:09:45 -05:00
Bartłomiej Chmiel 5adecb9fa3
Support multi-expression sequences (#6639) 2025-11-06 08:42:27 -05:00
Wilson Snyder 08330f5fe2 Fix constant-arrayed instance parameters (#6614). 2025-10-30 19:18:47 -04:00
Geza Lore d864057a60
Internals: Refactor AstNodeBlock representation (#6280) (#6588)
Internals: Refactor AstNodeBlock representation (#6280)

AstNodeBlock now has 2 child lists: 'declsp' to hold declarations within
the block, and 'stmtsp' to hold the procedural statements.

AstBegin is then just a simple subtype of AstNodeBlock.

AstFork is a proper superset of AstNodeBlock (and also AstBegin), and
adds 'forksp' which hold the parallel statements. Having the sequential
'stmtsp' in AstFork is required to properly implement variable
initializers in fork blocks (IEEE 1800-2023 9.3.2), this makes that
clear, while also separating the non AstNodeStmt declarations
(for #6280). The actual fork branches in 'AstFork::forkps()' are all
AstBegin nodes. This is required as lowering stages will introduce
additional statements in each parallel branch. (We used to wrap AstFork
statements into AstBegin in 3 different places, now they always are
AstBegin and this is enforced via the type checker/V3Broken).

Also fixes incorrect disabling of forked processes from within the `fork`.
2025-10-24 14:00:07 +01:00
Geza Lore cf275b6e58
Internals: Refactor text based Ast constructs (#6280) (#6571)
Remove the large variety of ways raw "text" is represented in the Ast.
Particularly, the only thing that represents a string to be emitted in
the output is AstText.

There are 5 AstNodes that can contain AstText, and V3Emit will throw an
error if an AstText is encountered anywhere else:
- AstCStmt: Internally generated procedural statements involving raw
  text.
- AstCStmtUser: This is the old AstUCStmt, renamed so it sorts next to
  AstCStmt, as it's largely equivalent. We should never create this
  internally unless used to represent user input. It is used for $c,
  statements in the input, and for some 'systemc_* blocks.
- AstCExpr: Internally generaged expression involving raw text.
- AstCExprUser: This is the old AstUCFunc, renamed so it sorts next to
  AstCExpr. It is largely equivalent, but also has more optimizations
  disabled. This should never be created internally, it is only used for
  $c expressions in the input.
- AstTextBlock: Use by V3ProtectLib only, to generate the hierarchical
  wrappers.

Text "tracking" for indentation is always on for AstCStmt, AstCExpr, and
AstTextBlock, as these are always generated by us, and should always be
well formed.

Tracking is always off for AstCStmtUser and AstCExprUser, as these
contain arbitrary user input that might not be safe to parse for
indentation.

Remove subsequently redundant AstNodeSimpleText and AstNodeText types.

This patch also fixes incorrect indentation in emitted waveform tracing
functions, and makes the output more readable for hier block SV stubs.

With that, all raw text nodes are handled as a proper AstNodeStmt or
AstNodeExpr as required for #6280.
2025-10-21 12:41:29 +01:00
Wilson Snyder 14e3448ba6 Fix `with` inside a `with` 2025-10-21 00:40:47 -04:00
Geza Lore 61c64e4a3b
Internals: Make AstCExpr always cleanOut (#6280) (#6570)
There was exactly one place in V3Task, handling DPI arguments when we
relied on cleanOut of AstCExpr being false for masking. Made that code
do the relevant masking via a few new run-time functions, which also
eliminates some special cases in the relevant V3Task functions.
2025-10-19 09:44:33 +01:00
Igor Zaworski 5c412e5e81
Support impure expressions in `inside` (#6562) 2025-10-17 09:08:57 -04:00
Geza Lore eb53bca6fd
Internals: Make AstAssignW a procedural statement (#6280) (#6556)
Initial idea was to remodel AssignW as Assign under Alway. Trying that
uncovered some issues, the most difficult of them was that a delay
attached to a continuous assignment behaves differently from a delay
attached to a blocking assignment statement, so we need to keep the
knowledge of which flavour an assignment was until V3Timing.

So instead of removing AstAssignW, we always wrap it in an AstAlways,
with a special `keyword()` type. This makes it into a proper procedural
statement, which is almost equivalent to AstAssign, except for the case
when they contain a delay. We still gain the benefits of #6280 and can
simplify some code. Every AstNodeStmt should now be under an
AstNodeProcedure - which we should rename to AstProcess, or an
AstNodeFTask). As a result, V3Table can now handle AssignW for free.
Also uncovered and fixed a bug in handling intra-assignment delays if
a function is present on the RHS of an AssignW.

There is more work to be done towards #6280, and potentially simplifying
AssignW handing, but this is the minimal change required to tick it off
the TODO list for #6280.
2025-10-14 09:05:19 +01:00
Wilson Snyder 01157d414b Optimize constant string arguments before Emit, and cleanup V3EmitV 2025-10-12 20:09:03 -04:00