Commit Graph

587 Commits

Author SHA1 Message Date
Geza Lore a4c5d2e29c Fix ENUMVALUE error when overriding enum param from CLI using -G/-pvalue 2025-10-30 12:04:12 +00:00
Wilson Snyder b652009235 Internals: Fix name of some static and thread variables. No functional change. 2025-10-27 20:49:41 -04:00
Geza Lore 0ead54b17e
Support dotted access to ports of a direct hier_block instance. (#6595)
Accessing the ports of hier_block instances directly under the current
hier_block (or top level) work just fine (the heir stub .sv has them),
and this can simplify hooking up dotted references into hier blocks:
push part of the reference under the hier block into the hier block, and
wire it to a port, then resolve the rest of the reference to the port of
the instance.
2025-10-25 18:39:21 +01: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
Ryszard Rozak e00403351c
Fix references to interfaces containing generate blocks (#6579) 2025-10-22 08:37:43 +02:00
Wilson Snyder 14e3448ba6 Fix `with` inside a `with` 2025-10-21 00:40:47 -04:00
Ryszard Rozak af2327aaf4
Fix hierarchical references with parameterized modules and interfaces (#5649) (#6566) 2025-10-17 09:06:46 -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 71941cc673 Fix incorrect nested interface-class error (#6549). 2025-10-11 19:07:37 -04:00
Wilson Snyder 078275034d Internals: Parse randsequence but still unsupported (#6131 partial) 2025-10-11 10:47:46 -04:00
Igor Zaworski 1a91ab02cf
Fix passing typedef value as parameter (#6543) 2025-10-09 10:08:06 -04: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
Geza Lore e04f51ebd2
Internals: Change AstAssignVarScope into AstAliasScope (#6280) (#6512)
Rename and make it derive from AstNode instead of AstNodeAssign.

Small step towards #6280. No functional change.
2025-09-30 06:40:17 +01:00
Ryszard Rozak 09518ee207
Support aliases with more operands (#6501) 2025-09-29 13:23:51 -04:00
Ryszard Rozak 500312c050
Support for simple alias statements (#6339) 2025-09-26 15:19:48 +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
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 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 d7f4dbfd13 Fix class.randomize without parens. 2025-09-16 18:56:04 -04: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 2b3bf5f51d Fix false missing implementation warning. 2025-09-16 07:48:20 -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 12c524ac06 Internals: Refactoring (#6433 prep). No functional change intended. 2025-09-14 21:50:19 -04:00
Wilson Snyder e348c9c344 Internals: Create common function for inlinedDots handling 2025-09-13 19:35:56 -04:00
Geza Lore f1396fbced
Fix memory leaks - batch 2 (#6417) 2025-09-10 22:42:45 +01: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
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
Wilson Snyder f57d1255e9 Fix import error format 2025-09-09 18:32:04 -04: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
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
Ryszard Rozak 107f64e53b
Fix segfault when modport variable is unresolved (#6386) 2025-09-05 14:27:46 +02: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
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
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
Igor Zaworski b95a974ff1
Support generic interfaces (#6272) 2025-08-22 06:44:35 -04:00
Wilson Snyder 047a12cc62 Fix variables hiding package imports (#6289). 2025-08-13 18:05:37 -04:00
Wilson Snyder 60cbbf0ec1 Add error on mismatching prototypes (#6207). 2025-08-11 19:50:47 -04:00
Wilson Snyder eb80db9397 Clarify extern error message 2025-08-10 08:38:26 -04:00
Wilson Snyder c005486acf Support by ignoring delay2 on UDPs 2025-08-05 17:34:42 -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 dca504c706 Internals: Use UINFOTREE istead of dumpTree 2025-08-02 13:44:40 -04:00
Szymon Gizler 61f4c97f40
Support unassigned virtual interfaces (#5265) (#6245) 2025-08-01 12:39:13 +02:00
Wilson Snyder bd1ac03828 Add I/O versus data declaration checking. 2025-07-31 18:38:50 -04:00