Commit Graph

10342 Commits

Author SHA1 Message Date
Andrew Pullin 25e259e495 Fix #1220: Allow uwire arrays as input ports
Uwire arrays were triggering assertion failures because they were
kept virtualized (pins array NULL) like reg arrays. However, unlike
reg arrays, uwire arrays used as input ports need their nexuses
initialized for the target code generation to work properly.

Two changes:
1. elab_sig.cc: Devirtualize pins for UNRESOLVED_WIRE (uwire) type,
   same as regular WIRE type.
2. t-dll-api.cc: Update assertion in ivl_signal_nex to also accept
   IVL_SIT_UWIRE when pins array is NULL.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin ad7f388b53 Fix #1134: Allow struct member access in unpacked array of packed structs
When accessing a member of a packed struct within an unpacked array
(e.g., `tests[0].a` where `tests` is `test_t tests[0:1]`), the
assertion `base_index.size()+1 == net->packed_dimensions()` would fail
because unpacked indices were incorrectly included in base_index.

The fix:
1. Separate unpacked indices from packed indices before calling
   check_for_struct_members()
2. Compute the word index for unpacked array access using
   normalize_variable_unpacked()
3. Pass the word index to check_for_struct_members(), which now
   creates NetESignal with the proper word selector

This allows expressions like `array_of_structs[i].member` to work
correctly, selecting the right array element before extracting the
packed struct member.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin a9a6756e11 Fix #521: Allow variable indices in outer packed dimensions
In multi-dimensional packed arrays, allow variable indices in the outer
(prefix) dimensions, not just the final dimension. For example:

  logic [3:0][3:0] a;
  for (int i=0; i<4; i++)
    a[i][3] = 1;  // Previously error, now works

The fix checks if any packed prefix indices are non-constant. If so,
use collapse_array_exprs() to compute the bit offset as an expression
rather than requiring constant indices.

This removes an artificial restriction that had no justification in
the IEEE standard, as noted by maintainers in the GitHub issue.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin 94267dd407 Fix #1268: Allow variables to be driven by primitive gate outputs
Per IEEE 1800-2017 6.5, variables can be written by one port, including
primitive gate outputs. The code incorrectly disallowed this with the
comment "Gates can never have variable output ports."

Changed elaborate_lnet/elaborate_bi_net calls for gate outputs to pass
true for var_allowed_in_sv, allowing variables as single-driver outputs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin 1db6a9809b Fix #1267: Allow wire logic connected to uwire port to have multiple drivers
TODO: Decide how resolved net types (tri0/tri1/triand/trior) should interact with uwire in a shared nexus.
2026-03-09 20:47:58 -07:00
Andrew Pullin b302bea697 Fix #1170: Skip $unit scope in tgt-sizer
The tgt-sizer target now skips IVL_SCT_PACKAGE scopes (the SystemVerilog
$unit compilation unit scope) instead of erroring. This allows sizer to
work with -g2012 and other SystemVerilog modes.

Includes regression test: br_gh1170

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin a58aae6e25 Fix #670: Allow class methods named same as class
Modified grammar in parse.y to use identifier_name instead of IDENTIFIER
in function/task declaration rules and hierarchy_identifier rule. This
allows TYPE_IDENTIFIER tokens (which class names become after definition)
to be used as method names.

Changes:
- Function declaration rules (lines 1585, 1605, 1631)
- Task declaration rules (lines 2445, 2472, 2501)
- hierarchy_identifier member access (line 4471)

Includes regression test: br_gh670

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07:00
Andrew Pullin c3bfcc418b Fix #1112: Report error for invalid $bits argument
When $bits() is called with an undefined identifier, the compiler now
properly reports an error instead of silently returning 0.

The fix checks if the argument expression has type IVL_VT_NO_TYPE after
test_width() processing (indicating the identifier couldn't be resolved),
and triggers elaboration to produce a proper error message.

Includes regression test: br_gh1112

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:47:58 -07: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
Cary R f3506a8c92 Update the test scripts to print the suffix being used 2026-03-01 14:37:51 -08:00
Cary R 9a7d852782 Fix some documentation links 2026-02-28 07:28:27 -08:00
Cary R 5d8fcdd7bc Specify the documentation is in english 2026-02-28 07:18:08 -08:00
Cary R 9d3cd045ef Update vvp_reg.py to use env to find python3 2026-02-28 07:06:10 -08:00
Cary R 5beeeee3fa Update the development documentation to match reality 2026-02-28 07:06:01 -08:00
Cary R d736cffc11 The MAKE_* scripts are obsolete 2026-02-28 05:35:32 -08:00
Cary R 2302fa37d5 Add V13 release notes 2026-02-27 21:17:43 -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 9b44d55e9a Make br_gh1248 SV safe 2026-02-20 01:23:27 -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 71c8963922 Cleanup space issues 2026-02-19 23:48:10 -08:00
Cary R 8385b13356 Add test for br_gh1248 2026-02-19 23:46:15 -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 911a20c134 Update blif check script to work with python3 2026-02-06 15:06:42 -08:00
Cary R 9da5c1868f New cppcheck cleanup 2026-02-06 15:06:28 -08:00
Cary R 827e08f8d3 Switch blif test to support python3 and use common program name 2026-02-06 09:48:52 -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