Commit Graph

10390 Commits

Author SHA1 Message Date
Lars-Peter Clausen 81222402c7 Add regression tests for package variable lifetimes
Check that package variables can use explicit static lifetime. Check that
automatic lifetime is rejected for package variables.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-07 22:14:20 -07:00
Lars-Peter Clausen c2b63e69a4 Allow lifetime specifier for variables declared in packages
The LRM allows to add a lifetime specified for variables declared in
package scope. It is not particular useful since only static lifetime is
allowed. But it is legal syntax, so support it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-07 22:14:20 -07:00
Cary R. 99c7a9f940
Merge pull request #1338 from larsclausen/byte-array-string-literal
Support assignment of string literals to byte arrays
2026-05-06 20:44:13 -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 6ffb4b9a3a Add regression tests for string literals assigned to byte arrays
Check that string literals can be assigned to byte arrays. Check that
invalid target array types are reported as errors.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-06 19:20:47 -07:00
Cary R. e9cffe506b
Merge pull request #1340 from rhabacker/followup-for-1331
Makefile.in: remove obsolete dependency
2026-05-06 18:48:01 -07:00
Cary R. e02eb2a4d8
Merge pull request #1339 from rhabacker/fix-build-rules
Fix incomplete build rules for generating header files
2026-05-06 18:47:37 -07:00
Cary R. 68244563ca
Merge pull request #1335 from rhabacker/cleanup-iverilog-vpi
iverilog-vpi: Consolidate creation in driver-vpi
2026-05-06 18:47:05 -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 f8e20f5a09 Makefile.in: remove obsolete dependency
Fixup for commit 49eaafe88 from #1331
2026-05-05 08:16:33 +02:00
Ralf Habacker d59e2c97ba Add missing autoconf macro for generating header stamp files
Fixes #1334

Fixup for commit 804e06cce.
2026-05-05 01:16:12 +02:00
Lars-Peter Clausen 272cf91eae Support assignment of string literals to byte arrays
SystemVerilog defines a special case that allows to assign string literals
to byte arrays. Each character of the string is copied to 1 element of the
byte array.

The size of string literal and the byte array does not have to match. If
the string literal is longer it is truncated. If it is shorter it will be
padded with null-bytes.

The assignment is done left aligned, the first character ends up in the
left most entry of the array. This means the order will differ whether the
array is declared with ascending or descending element order.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-03 19:48:38 -07:00
Lars-Peter Clausen 8519a30354 Add regression test for unpacked array output port expressions
Check that assignment patterns cannot be connected directly to unpacked
array output ports.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-03 17:31:09 -07:00
Lars-Peter Clausen d39e81e1d1 Reject non-assignable unpacked array output port expressions
Output port expressions must support continuous assignment. Assignment
patterns for unpacked array output ports are currently elaborated as
temporary arrays and the connection is silently discarded.

Report an error instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-03 17:31:09 -07:00
Lars-Peter Clausen be3be03fec Add regression test for drive strength net declarations
Check that drive strength can be specified between the net type and the
data type in a net declaration and that vector gate arrays resolve
strengths correctly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-03 17:30:56 -07:00
Lars-Peter Clausen 11c619e265 Fix drive strength in net declaration parsing
The drive strength of a net must be declared between the net type and the data type. E.g.

    wire (weak0, strong1) [7:0] x;

The current implementation expects the drive strength after the data type. Update the parser to fix this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-05-03 17:30:56 -07:00
Ralf Habacker 181cb7b2ed iverilog-vpi: Consolidate creation in driver-vpi
This change standardizes the creation of iverilog-vpi-related
targets, which now follow the same pattern as the iverilog targets
in the 'driver' subdirectory.
2026-05-02 14:03:00 +02: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
Ralf Habacker 0846198602 Makefile.in, driver/Makefile.in: fix setup of generated doc types for iverilog*
This resolves an issue where the man page is built even if
the 'man' program is not installed.
2026-05-02 14:02:59 +02:00
Cary R 6c52271afa Reorder check-installed targets 2026-04-30 08:31:50 -07:00
Cary R. ed7240b392
Merge pull request #1332 from rhabacker/ivtest-in-build-system
Ivtest in build system
2026-04-30 08:22:24 -07:00
Ralf Habacker c14c73dd9a ivtest: Integration of regression tests into the build system
Replace .github/test.sh with a unified set of targets installed
via `make check-*` in ivtest/, thereby removing CI-specific test
coordination. This avoids duplication in the regression logic and
ensures consistent execution between local and CI environments.
PLI1-dependent tests are now correctly controlled via
`configure --enable-libveriuser`.

Currently, the regression suite still depends on an iverilog package,
which must be installed manually at the location specified with
`configure --prefix=*`. Afterward, the complete regression suite
(VVP, VPI, and Python tests) can be run via `make check-installed`
and individual checks can be run with `check-installed-vpi`,
`check-installed-vvp` and `check-installed-vvp-py`.
2026-04-30 17:04:53 +02:00
Cary R. 03cac78504
Merge pull request #1331 from rhabacker/version-base-fixup
Move the use of version.exe to the build system
2026-04-30 08:02:07 -07:00
Ralf Habacker 49eaafe886 Remove support for creating 'version.exe' from the build system
Since this functionality has now been taken over by the build system
and is no longer needed, it can be removed from the build system.
2026-04-30 09:11:21 +02:00
Ralf Habacker 731891b58f Update documentation to clarify that 'version.exe' is no longer used 2026-04-30 09:11:21 +02:00
Ralf Habacker 92d345ddb2 Use autoconf variables in generated man and pdf output 2026-04-30 09:11:21 +02:00
Ralf Habacker 10b5f70e71 Move version info into configure.ac and generate version_base.h from template 2026-04-30 09:11:18 +02:00
Ralf Habacker 68f461f5a9 configure.ac: Sort and reformat the list of generated config files
If there is only one file per line, it is easier to add additional files.
2026-04-30 07:29:03 +02:00
Cary R 6f3beca5fb FST can dump packages 2026-04-29 20:59:19 -07:00
Cary R. 15989f3d62
Merge pull request #1329 from rhabacker/fix-1313
Fix test error with --enable-libvvp
2026-04-28 08:21:43 -07:00
Cary R. db06b37243
Merge pull request #1328 from rhabacker/split-aclocal
Split aclocal macros into m4 files for aclocal-managed autoconf setup
2026-04-28 08:15:34 -07: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
Ralf Habacker e8a4cc7c9e configure: explicitly require C++11
Newer autoconf/toolchains may default to newer C++ standards
(e.g. C++23). Explicitly enforce C++11 to preserve expected
behavior.
2026-04-28 13:15:17 +02:00
Ralf Habacker 804e06cce9 Split aclocal macros into m4 files for aclocal-managed autoconf setup
Future updates are handled via aclocal --install or autoreconf,
no manual edits to aclocal.m4 required.
2026-04-28 13:15:07 +02:00
Martin Whitaker ca756322a7 Add regression test for issue #1323. 2026-04-15 16:44:35 +01:00
Martin Whitaker eed88fc61f ivlpp: Ensure def_buf is allocated when calling macro_start_args()
macro_start_args() inserts a null string for arg 0 at the start of def_buf.
This allows macro_finish_arg() to calculate the length of the first actual
argument (arg 1). But macro_start_args() relied on def_buf having already
been allocated, which isn't the case when all the macros are pre-defined.

This fixes issue #1323.
2026-04-15 16:24:32 +01: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