Commit Graph

133 Commits

Author SHA1 Message Date
mjoekhan 70d1de0dbd ivtest: address review — restore LXT for br_gh710b, tidy br1005 vlog95 list
- br_gh710b: use -lxt again; gold files back to LXT output
- regress-ivl1: drop br1005 comment line
- regress-vlog95: move br1005 CE entry to class section after br1004

Made-with: Cursor
2026-04-30 10:32:30 +05:00
mjoekhan 506b4f2757 ivtest: fix regressions after class queue and darray ordering work
- br1005: remove CE from regress-ivl1; gold is simulation PASSED; add CE
  override in regress-vlog95.list for vlog95_reg.pl
- always_*_warn: gold matches 'ordering/delete' synthesis message
- br_gh710b: drop -lxt (default VCD) so tests pass without libbz2; update gold

Made-with: Cursor
2026-04-29 22:47:31 +05:00
mjoekhan 0696847c4a Merge branch 'master' of https://github.com/muhammadjawadkhan/iverilog 2026-04-29 11:56:39 +05:00
mjoekhan c17472b494 SV: sort(), rsort(), shuffle() for queues and dynamic arrays
Implement ordering methods in elaboration, VVP codegen, runtime opcodes,
and vvp_darray implementations (including class property paths). Add
regressions and class locator checks; document behavior in README.

Made-with: Cursor
2026-04-29 10:15:49 +05:00
mjoekhan e597156d4d SV: implement reverse() for queues and dynamic arrays
Lower a.reverse() and q.reverse() to $ivl_darray_method$reverse with new
VVP opcodes %reverse/obj and %reverse/prop/obj. Implement reverse_elems()
on vvp_darray and queue storage types; dispatch queues via peek<vvp_queue>
before vvp_darray so virtual overrides apply.

Includes regressions for standalone arrays/queues and class properties.
README_sv_queue_locators.txt documents behavior and tests.

Made-with: Cursor
2026-04-29 00:48:56 +05:00
mjoekhan 701c5f8a07 SystemVerilog: support product() with expressions on arrays
Enable queue/darray product() with (expr) by lowering to a dedicated _with sfunc, evaluating the expression per item, and reducing through a new %queue/product/obj/v runtime opcode. Add regressions and docs for queue and dynamic-array product_with behavior.

Made-with: Cursor
2026-04-28 23:48:59 +05:00
mjoekhan 03512faee6 SystemVerilog: add integral product() reduction on arrays
Implement queue/darray product() reduction (including class property paths) via new %queue/product/v and %queue/product/prop/v opcodes, with elaboration/codegen support and regressions for queue, dynamic-array, and class-property usage.

Made-with: Cursor
2026-04-28 23:32:45 +05:00
mjoekhan 0568961f6b SystemVerilog: support sum() with expressions on arrays
Enable queue/darray sum() with (expr) by lowering to a dedicated _with sfunc, evaluating the with-expression per item, and reducing appended values via new %queue/sum/obj/v runtime support. Add regressions for queue and dynamic-array sum_with and update locator docs.

Made-with: Cursor
2026-04-28 22:59:54 +05:00
mjoekhan f9e3f9a3e4 SystemVerilog: integral sum() reduction for queues and dynamic arrays
Add $ivl_queue_method$sum elaboration, eval_vec4 lowering (%queue/sum/v and property variant), and VVP runtime that sums words with Verilog-style vec4 addition. Empty arrays yield 0. Regressions: sv_queue_sum, sv_darray_sum; document in README_sv_queue_locators.

Made-with: Cursor
2026-04-28 22:29:40 +05:00
mjoekhan 0cd7205585 SystemVerilog: support locator methods on class queue properties
Enable queue locator elaboration for class properties typed as queues (not only dynamic arrays), and add regression coverage for class queue property find/unique/min/max behavior.

Made-with: Cursor
2026-04-28 21:36:01 +05:00
mjoekhan 7cac25cbd1 SystemVerilog: add unique()/unique_index() with predicates
Enable unique and unique_index locator methods with `with (...)` for queues, dynamic arrays, and class dynamic-array properties, including VVP opcode/runtime support and regression coverage.

Made-with: Cursor
2026-04-28 21:10:11 +05:00
mjoekhan 8f18edd20d SystemVerilog: class darray property locator methods and VVP prop fixes
Add class dynamic-array property support for locator methods (find*, unique*, min/max, with predicates) by elaborating dynamic-array property method calls to queue-method sfuns. Extend VVP property paths to treat property values as queue-or-darray sources, not queue-only, and fix object-stack handling in property locator loops so temporary accumulator objects do not hide the class object.

Add regression coverage for class dynamic-array property locators and update locator-method test documentation/listing.

Made-with: Cursor
2026-04-28 20:38:10 +05:00
mjoekhan 3ccba27edb SystemVerilog: darray unique methods and min/max with(predicate)
Add dynamic-array unique() and unique_index() support and extend queue/darray min() and max() to accept locator with(...) predicates. Generate dedicated _with sfuns for min/max, emit VVP code for filtered scans, and reduce through new object-stack min/max opcodes.

Cover the new behavior with ivtest regressions for darray unique and queue/darray min/max with predicates, and update locator method documentation.

Made-with: Cursor
2026-04-28 16:57:23 +05:00
mjoekhan 30b4afa7d2 SystemVerilog: add min/max locator methods for queue and darray
Implement queue and dynamic-array min()/max() for integral vec4 element types, with VVP support for both queue-backed and darray-backed storage and regressions in ivtest. Keep min/max as no-arg methods and document current behavior alongside existing locator tests.

Made-with: Cursor
2026-04-28 16:42:54 +05:00
Martin Whitaker ca756322a7 Add regression test for issue #1323. 2026-04-15 16:44:35 +01:00
mjoekhan 20bd360aec SystemVerilog: queue/darray locator methods (find*, unique*) and VVP darray support
Implement array locator methods for SystemVerilog queues and dynamic arrays:
find, find_index, find_first, find_first_index, find_last, find_last_index,
unique, and unique_index. Support both value arguments (equality) and
with (predicate) forms using implicit item and index in the iterator scope.

Elaboration returns queue-typed results for first/last/index locators per LRM
(empty queue when no match). Fix assignment compatibility between queues and
dynamic arrays where element types match.

VVP: extend %queue/size, %queue/word, %queue/find*, and %queue/unique* paths
so nets holding vvp_darray (including atom-backed int[]) are handled, not
only vvp_queue_vec4. Queue types still subclass vvp_darray; resolve vec4
queues before plain dynamic arrays. Fall back to the legacy get_queue_object
path for non-vec4 queues. Document opcode and source file touchpoints in
ivtest/ivltests/README_sv_queue_locators.txt.

Add vvp regressions: sv_queue_find*, sv_queue_unique, sv_queue_find_locators_ext,
sv_darray_find_locators.

Made-with: Cursor
2026-04-15 00:59:58 +05:00
mjoekhan 24c1293801 Add SystemVerilog chained calls a().b() and regression
Implement call_chain_expr in the parser, PECallFunction chain prefixes,
elaboration for class methods on returned handles, and prefix class resolution
for width checks on multi-hop chains. Place call_chain_expr before bare
hierarchy_identifier in expr_primary so id ( is not reduced as a lone ident.

Document behavior and developer notes in devel/sv_call_chain.md (including
that iverilog uses the installed lib/ivl/ivl binary).

Add ivtest sv_call_chain_method1 normal test with -g2012.

Made-with: Cursor
2026-04-14 00:07:21 +05:00
mjoekhan 1a10f9d57b ivtest: regress class property queue push/pop methods
Add vvp regression for push_front, push_back, pop_front, pop_back on
queue-typed class fields. Catches vvp opcode_table sort regressions that
surface as Invalid opcode at runtime.

Made-with: Cursor
2026-04-13 23:25:34 +05:00
Martin Whitaker 42d0c3fd4a Update test suite to cover -gno-strict-declaration options. 2026-03-21 20:50:18 +00:00
Cary R 4af84bfaad Fix sdf_interconnect4 failure and reenable 2026-02-24 22:24:17 -08:00
Cary R 935f92da05 Disable sdf_interconnect4 until vpi_handle_multi() is working properly 2026-02-20 00:54:53 -08:00
Cary R 8385b13356 Add test for br_gh1248 2026-02-19 23:46:15 -08:00
Cary R 068f33b35a Remove memory leak when multi-bit module path delays fail 2026-01-21 20:50:32 -08:00
Cary R 4d0a277f3b Cleanup the python version of vlog95 2026-01-13 01:25:24 -08:00
Cary R 6651df6f2c Update the vlog95 python tests to pass more options 2026-01-08 01:36:30 -08:00
Cary R 7dbaa67a02 vlgo95: add partial array pattern support and other cleanup 2026-01-07 23:32:16 -08:00
Cary R 918976651a Fixes for vlog95 generation and gold file updates 2026-01-06 23:02:55 -08:00
Cary R e5943047da Add preliminary support for Python vlog95 testing 2025-12-30 19:44:06 -08:00
Cary R 1c6f0e768a Update vvp_reg.py to support strict, force-sv and with-valgrind 2025-11-22 13:31:27 -08:00
Martin Whitaker f5708a0322 Add regression test for issue #1286. 2025-11-11 22:00:06 +00:00
Martin Whitaker 1fdeb7b982 Add regression tests for $fmonitor tasks.
Also add a test for multiple $monitor task calls and $monitoron and
$monitoroff.
2025-10-05 12:37:30 +01:00
Martin Whitaker fd7029a299 Add regression tests for issue #1258. 2025-07-05 22:52:52 +01:00
Martin Whitaker aec91c7754 Add regression tests for issue #1256. 2025-07-05 18:21:32 +01:00
Martin Whitaker b7f9be9370 Add regression test for issue #1242. 2025-05-11 11:39:29 +01:00
Lars-Peter Clausen eb90bcf313 Add regression tests for invalid casts to real
Check that invalid casts to real are reported as an error.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2025-01-12 20:34:31 -08:00
Lars-Peter Clausen e2008c9c0e Add regression tests for nested lvalue object properties
Check that nested object properties of different types are supported as
lvalues.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2025-01-05 16:55:16 -08:00
Lars-Peter Clausen 9f8a8959a7 Add regression tests for assignment operators on queue and darray elements
Check that assignment operators work as expected on queue and dynamic array
elements.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2025-01-05 15:55:34 -08:00
Lars-Peter Clausen 7c970e91b9 Add regression tests for assignment operators on class properties
Check that assignment operators are supported for class properties.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2025-01-05 15:55:20 -08:00
Lars-Peter Clausen c22b375c86 Add regression test for logic class property default value
Check that class logic class properties get initialized to 'x.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2025-01-05 09:46:07 -08:00
Martin Whitaker f3abd94e9b Add regression test for issue #1184.
This checks the temporary fix of outputing a suitable "sorry" message.
2024-12-31 17:15:19 +00:00
Martin Whitaker 0119f0d1e8 Add regression test for vvp quiet flag. 2024-12-31 15:05:38 +00:00
Martin Whitaker 62727e8b2e Add regression tests for packed/unpacked array parameter declarations.
These are currently unsupported, so should result in a compiler error.
2024-11-15 21:10:51 +00:00
Martin Whitaker 6c8ed62a5a Add regression test for issue #1181. 2024-11-10 19:34:36 +00:00
Dag Lem ba7da9d5a5 Guard against overflow / wrap around of internal part-select bit address
Internally, the maximum address space of a vector is 31 bits + a sign bit
to signal invalid addresses (out of bounds or has one or more x or z bits).

This commit ensures that unsigned part-select bit addresses which would
otherwise overflow and wrap around within this address space are correctly
handled as out of bounds.
2024-09-16 23:50:24 +02:00
Martin Whitaker 2ab57a2b09 Add regression test for return type of $bits (issue #1163). 2024-09-07 17:56:15 +01:00
martinwhitaker 34ed6f6f97
Merge pull request #1168 from steveicarus/fix-vvp-cg-array-word-aliasing
Fix vvp cg array word aliasing
2024-09-07 17:04:57 +01:00
martinwhitaker 74ba42e2df
Merge pull request #1166 from larsclausen/fix-ix-load-sign
tgt-vvp: Use signedness of expression instead of signal for index load
2024-09-07 17:04:40 +01:00
Martin Whitaker ae78218c2f Add regression test for issue #1155. 2024-09-03 21:38:09 +01:00
Lars-Peter Clausen 841e5a9d9e ivtest: Add regression test to check that shift rhs is always unsigned
Add a regression test to check that the right-hand side of a shift
operation is always treated as unsigned, even if it is a signed registers
or a variation thereof.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 19:09:06 +02:00
Lars-Peter Clausen fa83f42cba ivtest: Add regression test for undefined intra-assignment delay
Check that assignments with undefined intra-assignment delay get executed
with zero delay. The assignment should not be skipped.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2024-09-02 14:11:29 +02:00