Commit Graph

2236 Commits

Author SHA1 Message Date
Cary R. 8cf4507fcb
Merge branch 'master' into master 2026-05-22 18:15:37 -07:00
Cary R aafda65b99 Cppcheck cleanup 2026-05-21 05:21:35 -07:00
Ralf Habacker 9d3101fd19 vvp: build and install libvvp as a versioned shared library
It uses a dedicated LIBVVP_SOVERSION specified in onfigure.ac
for the SONAME and full library version.

For linking, a pkg-config file is generated, and when building on
Windows, an import library is created that can be used with both
GCC and MSVC compilers.

On non-Windows platforms, all object files are compiled with -fPIC
to ensure compatibility with shared libraries.

On Windows use 'lib' prefix for library name with MinGW compiler
only. Other compiler like MSVC normally are not using any library
prefix.

With this commit the build rules for the vpp executable has been
cleaned too because the complex structure of the manually created
Makefile.in made it very difficult to extract specific parts of
them.
2026-05-13 10:45:04 +02:00
Ralf Habacker 4014db47e0 vvp: introduce variable names for object files used by the vvp library 2026-05-13 10:45:04 +02:00
Ralf Habacker 3e7135aabb vvp: add DLLIB to LIBS to simplify build rules 2026-05-13 10:45:04 +02:00
Ralf Habacker 38a24e71b5 vpp: install missing include directory when installing from 'vvp' directory
This fixes an issue unrelated to the addition of support for
versioned VVP library.
2026-05-13 10:45:04 +02:00
Ralf Habacker 46a329f16f vvp: cleanup doc related rules 2026-05-12 10:31:19 +02:00
Cary R 5240790480 Fix/update latest cppcheck issues 2026-05-10 14:47:40 -07:00
Cary R 3d8f906bdd Update Copyright that was missed for a few files 2026-05-08 05:35:16 -07:00
Lars-Peter Clausen 48242818b3 vvp: Improve reduction operator performance
The vvp reduction operators evaluate their input bit by bit. This is
expensive for wide vectors.

Add word wide reduction helpers to `vvp_vector4_t` and use them for both
reduction functors and vthread reduction opcodes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-07 21:26:17 -07:00
Cary R. 33a6d58258
Merge pull request #1341 from larsclausen/vvp-vector-ops-speed-up
vvp: Use word wide bitwise logical ops
2026-05-06 20:37:49 -07:00
Lars-Peter Clausen 0f454ff548 vvp: Use word wide vector operations for logic functors
The logic functors combine their input vectors bit by bit.

Use the in-place `vvp_vector4_t` operators for the vector operation and
invert the result once for the inverted functors.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-06 13:19:53 -07:00
Lars-Peter Clausen cf53479ba2 vvp: vthread: Use word wide vector operations
The vthread binary logic opcodes update vectors bit by bit.

Use the in-place `vvp_vector4_t` operators instead. This reuses the word
wide implementation and avoids per-bit `value()` and `set_bit()` calls.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-06 13:19:53 -07:00
Lars-Peter Clausen 41c3423209 vvp: Implement `vvp_vector4_t` xor operator
`vvp_vector4_t` has word wide in-place operators for and and or, but not
for xor.

Add `operator ^=` using the same internal word representation.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-06 13:19:53 -07:00
Ralf Habacker 9b42bf0df6 Makefile.in, vvp/Makefile.in: introduce ivl_includedir
This variable was introduced to avoid conflicts with
the existing `includedir` variable, which is used for
the general include directory.
2026-05-02 14:02:59 +02:00
mjoekhan 96ca470f55 Windows VPI: route vpip_format_pretty through vpip_routines_s
MinGW links system.vpi against libvpi; add format_pretty to the jump
table and libvpi thunk (bump vpip_routines_version to 2).
2026-05-01 00:42:12 +05:00
Ralf Habacker 92d345ddb2 Use autoconf variables in generated man and pdf output 2026-04-30 09:11:21 +02: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 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
Ralf Habacker 047974bdb6 Fix test error with --enable-libvvp
When running `make check` on a UNIX-like operating system
with the specified `configure` option, `vvp` was unable to
find the required shared library.

This commit ensures that the runtime linker can locate the library.

This fixes issue #1313.
2026-04-28 13:36:47 +02: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 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 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
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 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 15d6e83f8d Cleanup cppcheck 2026-02-24 23:53:57 -08:00
Cary R 4af84bfaad Fix sdf_interconnect4 failure and reenable 2026-02-24 22:24:17 -08:00
Cary R 71c8963922 Cleanup space issues 2026-02-19 23:48:10 -08:00
Cary R b46fbe0892 Another const declaration that can be added 2026-02-19 23:40:42 -08:00
Cary R 5e1f1055e1 Add more const declarations 2026-02-19 23:40:34 -08:00
Cary R. de3e50e486
Merge pull request #1249 from FlinkbaumFAU/improve_interconnect_handling
Improve INTERCONNECT handling for SDF Annotation
2026-02-19 23:06:28 -08:00
Cary R 7786fb67c3 Fix manual PDF generation 2026-02-08 23:07:56 -08:00
Cary R f071957736 New cppcheck cleanup 2026-02-08 22:41:47 -08:00
Cary R a838d5143d cleanup Makefile and add complete man PDF generation 2026-02-08 22:41:35 -08:00
Cary R 4cc6ae35dd Fix the valgrind cleanup of automatic array vars 2026-02-06 21:35:13 -08:00
Cary R 9da5c1868f New cppcheck cleanup 2026-02-06 15:06:28 -08:00
Cary R 826672705e Move all simulation callback decls to the header 2026-02-06 09:48:41 -08:00
Cary R e9f26a2f11 Declare vpiPostsim() in a header file 2026-02-06 01:59:11 -08:00
Cary R 8f7b2a23eb pthread_exit() is no longer needed and fixes vvp return 2026-02-06 01:55:36 -08:00