Commit Graph

10368 Commits

Author SHA1 Message Date
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 7fe2ddda0b VVP: array-pattern object values for class queue properties
Support IVL_EX_ARRAY_PATTERN in object evaluation for queue-typed class properties: build an empty queue and append pattern elements, matching darray array-pattern object handling. Fix vec4 stack use so %queue/append_word/v is not double-popped. Update class queue locator regression to use direct c.q = '{...} assignment.

Made-with: Cursor
2026-04-28 22:17:13 +05:00
mjoekhan c189cc2642 SystemVerilog: honor with-clause for class queue min/max
Route class queue-property min/max calls with `with (...)` through predicate-based locator elaboration so filtered extrema behave consistently with queue and darray locator semantics.

Made-with: Cursor
2026-04-28 21:45:35 +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 789bff4861 VVP: support array-pattern objects in dynamic-array property assignment
Handle IVL_EX_ARRAY_PATTERN in object evaluation by constructing a dynamic-array object and filling elements, so direct class property assignments like c.d = '{...}; codegen correctly without requiring a temporary variable.

Made-with: Cursor
2026-04-28 20:51:16 +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
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
mjoekhan d19b989212 vvp: fix opcode_table sort for bsearch (class queue property ops)
Keep mnemonics in strict lexicographic order: move %qpop/prop/* after
%qpop/f/v, and %delete/prop/* with other %delete/* entries. An
unsorted table made bsearch miss %store/prop/qf/v and friends, so
simulations saw Invalid opcode despite correct codegen.

Document the sorting invariant above opcode_table.

Made-with: Cursor
2026-04-13 23:21:24 +05:00
mjoekhan 8cde2d286c gitignore: ignore local devel/ scratch and notes
Made-with: Cursor
2026-04-13 23:02:30 +05:00
mjoekhan 19d3e74467 SV: class queue/darray properties, method chains, %p, and VPI/tgt-vvp support
- Elaborate whole-queue/darray class properties; allow queue-typed properties;
  PECallFunction chaining and PCallTask NetExpr bases; const-eval deferral
- ivl_type_queue_max() for queue bounds; tgt-vvp &PQ codegen and eval paths
- vvp: PropQueue handles, opcodes, vthread/vpi_darray for property queues
- vpi: %p/%P pretty print, array handles in $display compiletf

Made-with: Cursor
2026-04-13 23:01:03 +05:00
Cary R 9b0d46b4bf Update to the latest GTKWave files 2026-03-27 19:16:23 -07:00
Cary R 1248394a5d Fix possible parallel build race with compile and dep directory 2026-03-27 18:38:34 -07:00
Cary R fa518a3409 Remove versioned manual pages during `make clean` 2026-03-27 18:38:34 -07:00
Cary R. aa417d7575
Merge pull request #1315 from vowstar/fix/dep-mkdir-race
Fix parallel build race with dep/ directory
2026-03-27 18:20:06 -07:00
Huang Rui f20865a5ea Include mach-o/dyld.h for _NSGetExecutablePath on macOS
driver/main.c uses _NSGetExecutablePath in the __APPLE__ code path
but does not include the header that declares it, causing a build
failure on macOS.

Signed-off-by: Huang Rui <vowstar@gmail.com>
2026-03-27 11:45:32 +08:00
Huang Rui ac3ef217c3 Fix parallel build race with dep/ directory
Pattern rules that move .d files into dep/ do not depend on the dep
directory target, so parallel make can attempt the move before the
directory exists.

Add dep as an order-only prerequisite to all affected pattern rules.

Bug: https://bugs.gentoo.org/880921
Bug: https://bugs.gentoo.org/911647
Bug: https://bugs.gentoo.org/917344
Closes: https://github.com/steveicarus/iverilog/issues/1314
Signed-off-by: Huang Rui <vowstar@gmail.com>
2026-03-27 11:29:24 +08:00
Martin Whitaker 6767a07956 Merge branch 'SiB64-strict-parameter-declaration'
Pulled from https://codeberg.org/SiB64/iverilog strict-parameter-declaration
with further enhancements.
2026-03-21 20:53:12 +00:00
Martin Whitaker 42d0c3fd4a Update test suite to cover -gno-strict-declaration options. 2026-03-21 20:50:18 +00:00
Martin Whitaker 5da8894590 Fix documentation for -Wno-declaration-after-use. 2026-03-21 20:21:05 +00:00
Martin Whitaker 4c315b32d4 Change strict-net-declaration to strict-net-var-declaration.
Internally the compiler uses 'net' for both nets and variables, but
we should make it clear to the user that this option applies to both.
2026-03-21 20:18:53 +00:00
Martin Whitaker dc0d162fa9 Report declaration position when warning about declaration after use. 2026-03-21 19:35:29 +00:00
Martin Whitaker 29e128ed94 Only warn about declaration after use once for each data object. 2026-03-21 18:25:15 +00:00
Martin Whitaker 475f098cab Minor grammar and white space fixes in documentation. 2026-03-21 17:20:27 +00:00
Stephan I. Böttcher 7d438b66c8 add option -gno-strict-declaration
The new option allows parameter, net and events to be used before
declaration.  With variants

 -gno-strict-net-declaration for nets and events,
 -gno-strict-parameter-declaration for parameters.
2026-03-18 18:01:54 +01:00
Stephan I. Böttcher 54f17a2cb1 Add warning class -Wno-declaration-after-use
With `-ggno-strict-parameter-declaration` a warning is issued for
parameter use before declaration.  This warning suppressed with
the new class `-Wno-declaration-after-use`, instead of `-Wno-anachronisms`.
2026-03-18 12:46:42 +01:00
Stephan I. Böttcher 42f7d3a922 strict_param_decl: dedup use after decl test 2026-03-18 12:08:39 +01:00
Stephan I. Böttcher 1f8991e382 Emit a warning with -gno-strict-parameter-declaration
When a parameter is used before declaration, a warning is printed,
unless `-Wno-anachronisms`.
2026-03-17 20:32:06 +01:00
Stephan I. Böttcher ab74cafa20 Add option -gno-strict-parameter-declaration
The standards requires that parameters must be declared
before they are used.  Using -gno-strict-parameter-declaration
will allow using a parameter before declaration, e.g., in a port
declaration, with the parameter declared in the body of the
module.  Prior to version 13 this was allowed, so there is a large body
of existing code depending on the pre version 13 behaviour.
2026-03-17 19:39:51 +01:00
Cary R. ff2f4c6864
Merge pull request #1303 from aelmahmoudy/rename-manpage
Rename manpage to iverilog.1 to match executable name
2026-03-08 15:17:54 -07:00
Cary R. d3bda52d69
Fix man page entry for Icarus Verilog documentation 2026-03-08 15:07:02 -07:00
Cary R d64bf0b0b3 Update to the latest GTKWAve files 2026-03-08 14:51:32 -07:00
Cary R c836236b28 Add Copyright to a couple LGPL2 files 2026-03-08 14:07:04 -07:00
Cary R. 462a15dcbb
Merge pull request #1302 from aelmahmoudy/fix-typos
Fix typo: contributer -> contributor
2026-03-05 19:08:39 -08:00
أحمد المحمودي (Ahmed El-Mahmoudy) 57385f9ac6 Rename manpage to iverilog.1 to match executable name 2026-03-05 23:38:16 +01:00
أحمد المحمودي (Ahmed El-Mahmoudy) f9a0542a49 Fix typo: contributer -> contributor 2026-03-05 22:48:57 +01:00
Martin Whitaker 14a25bfe92 Update the copy of ax_prog_cc_for_build.m4 embedded in aclocal.m4
This correctly generates the EXEEXT variable when cross-compiling and
using autoconf 2.70+ (issue #1301).
2026-03-05 17:52:09 +00:00
Martin Whitaker 4dfac864ce Remove duplicated typeders and functions from t-dll.h and t-dll.c
These duplicate the contents of ivl_dlfcn.h
2026-03-05 12:01:03 +00:00
Martin Whitaker 3f936d2d8b Merge duplicated ivl_dlfcn.h files.
The vvp/ivl_dlfcn.h and cadpli/ivl_dlfcn.h files are essentially the
same, but have diverged a bit over the years. Merge them into a single
shared file at the top level. Use the static prefix for all inline
functins (currently only used in the cadpli version) as that will fix
issue #1301. We now require the compiler to support at least C99, so
can use "inline", not "__inline__".
2026-03-05 11:55:56 +00:00
Cary R b8de0499a9 Update vvp examples to match the correct version 2026-03-02 10:48:10 -08:00
Cary R 98391b56bc Update example to match new version 2026-03-01 15:31:50 -08:00
Cary R aec9fe98ab Development is now V14 2026-03-01 15:16:47 -08:00
Cary R 9d0f6fc995 Add CREATE_BRANCH.sh script 2026-03-01 14:48:46 -08:00
Cary R 68ba79eb7a Update the default suffix to be dev for master 2026-03-01 14:43:58 -08:00
Cary R 42d591d296 Update install docs and remove a doc build warning 2026-03-01 14:41:22 -08:00