Commit Graph

972 Commits

Author SHA1 Message Date
Wilson Snyder 5229ce8660 Fix error on circular structure typedef 2025-10-06 18:45:56 -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
Wilson Snyder 3b623dc12e Internals: Refactor to create VCMethod (#3715). No functional change intended. 2025-09-27 08:22:17 -04:00
Wilson Snyder b3350a4f3b Add error on `virtual new` (#6486). 2025-09-26 21:23:40 -04:00
Ryszard Rozak 500312c050
Support for simple alias statements (#6339) 2025-09-26 15:19:48 +02:00
Wilson Snyder c9e021924f Support class package reference on pattern keys (#5653). 2025-09-25 06:52:42 -04:00
Geza Lore 63f5f5c328
Internals: Remove redundant AstNode methods (#6481)
AstNode::isFirstInMyListOfStatements
AstNode::isStandaloneBodyStmt
2025-09-24 09:53:39 +02: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
Wilson Snyder a647747260 Add IMPLICITSTATIC also on procedure variables. 2025-09-21 19:52:19 -04:00
Wilson Snyder 53b8a5b027 Add error on zero/negative unpacked dimensions (#1642). 2025-09-21 09:41:58 -04:00
Wilson Snyder af54a26b43 Fix parsing of `with (...) {...}` but still unsupported 2025-09-20 19:59:31 -04:00
Wilson Snyder b237eec801 Add error on string addition 2025-09-20 13:47:17 -04:00
Geza Lore e0e8503151
Internals: Make all AstBegin constructor arguments explicit (#6464) 2025-09-20 13:16:03 -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 542ffcca60 Prevent internal error on pattern mismatch 2025-09-17 21:01:11 -04:00
Wilson Snyder b10c6293d9 Fix elaboration displays with `%m` (#6445). 2025-09-16 20:50:15 -04:00
github action 841254e9e8 Apply 'make format' 2025-09-16 23:02:39 +00:00
Wilson Snyder d7f4dbfd13 Fix class.randomize without parens. 2025-09-16 18:56:04 -04:00
Geza Lore ef458be855
Fix memory leaks in assignment pattern processing (#6437). 2025-09-16 12:31:16 -04:00
Wilson Snyder 5e4668c146 Support get/set_randstate as class method. 2025-09-14 10:33:50 -04:00
Geza Lore 56927fb955
Fix memory leaks - batch 3 (#6419) 2025-09-11 12:01:36 +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
Geza Lore dd11d5a598
Fix memory leaks - batch 1 (#6411) 2025-09-09 22:39:44 +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
Artur Bieniek 905c0c4f6d
Optimize dead functions without references (#6380) 2025-09-05 13:23:43 -04:00
Geza Lore 5161cea8cd
Internals: Improve astgen type enums to be switch statement friendly (#6362)
- Remove _ENUM_END, so -Wswitch does not demand it's covered. Use the
  new NUM_TYPES constexpr member instead.
- Remove 'at' prefix. This seems historical and is not particularly  useful.
- Fix some cppcheck warts while at it
2025-09-03 13:56:11 +01:00
Wilson Snyder 91ae4c35b7 Add error on force/release non-constant selects. 2025-08-29 21:19:37 -04:00
Wilson Snyder 409e036eca Add error on gate primitive connection width mismatch 2025-08-27 22:28:09 -04:00
Wilson Snyder ac2859bf24
Internals: Upgrade to clang-format-18 (#6333) 2025-08-25 20:47:48 -04:00
Wilson Snyder ac2a75fbb5 Support future sampled value functions. 2025-08-23 21:16:53 -04:00
Wilson Snyder b96f35b8fe Internals: Add AstToStringN (#4732 prep) 2025-08-21 21:09:10 -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 dc5a17fea0 Support unpacked array `with` methods (#6134). 2025-08-20 21:01:34 -04: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
Wilson Snyder 7126293086 Support enum.next with a parameter 2025-08-16 21:06:35 -04:00
Geza Lore 6f69c990fd
Internals: Remove AstCondBound and AstNodeCond (#6293) (#6294)
Fixes #6293
2025-08-15 15:49:06 -07:00
Wilson Snyder 60cbbf0ec1 Add error on mismatching prototypes (#6207). 2025-08-11 19:50:47 -04:00
Wilson Snyder 6a225d5d00 Internals: Remove AstSysFuncAsTask 2025-08-08 05:09:54 -04:00
Wilson Snyder 870c398094 Fix incorrect Non-ANSI I/O declaration conflict error (#6258) broke with #bd1ac038 2025-08-05 16:33:28 -04:00
Wilson Snyder 52ac3b3a0d Add error on too many pattern members for structure 2025-08-03 17:26:51 -04:00
Wilson Snyder dca504c706 Internals: Use UINFOTREE istead of dumpTree 2025-08-02 13:44:40 -04:00
Igor Zaworski 2b62f5a625
Add error when trying to assign class object to variable of non-class types (#6237) 2025-07-30 09:48:02 +02:00
Wilson Snyder 0da9f6eb03 Fix queue typedef with unbounded slice (#6236). 2025-07-28 19:36:52 -04:00