Repository navigation
Conversation
An integer_array_t argument is transferred to Python when it is made, which the bridge library cannot do during elaboration: NVC aborted with "foreign function vpy_push_array not found" and GHDL with a CONSTRAINT_ERROR. Before test_runner_setup, p_stage_array now reports a failure naming the call instead. See VUnit#17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ru551n
commented
Oct 14, 2026
| python_logger, | ||
| operation & " failed:" & LF & | ||
| "An integer_array_t argument cannot be made before test_runner_setup, for example in a constant. " & | ||
| "Make it in a process after test_runner_setup." |
Collaborator
Author
| variable staged_id : integer; | ||
| begin | ||
| -- The bridge library cannot be called during elaboration, see #17 | ||
| if get_phase = test_runner_entry then |
Collaborator
Author
There was a problem hiding this comment.
Make it check for get_phase < test_runner_entry instead
Collaborator
Author
| variable offset, n : natural := 0; | ||
| variable staged_id : integer; | ||
| begin | ||
| -- The bridge library cannot be called during elaboration, see #17 |
Collaborator
Author
There was a problem hiding this comment.
Remove, the code is obvious
Collaborator
Author
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ru551n
commented
Oct 14, 2026
| failure( | ||
| python_logger, | ||
| operation & " failed:" & LF & | ||
| "An integer_array_t argument cannot be made before test_runner_setup, for example in a constant." |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| "An integer_array_t argument cannot be made before test_runner_setup, for example in a constant." | |
| "An integer_array_t argument cannot be made before test_runner_setup." |
Collaborator
Author
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An
integer_array_targument made during elaboration, for example in a constant, now fails with a clear error instead of crashing the simulator. Fixes #17.Before, the simulation stopped before it started with a message from inside the simulator, which pointed nowhere near
arg:** Fatal: (init): foreign function vpy_push_array not foundraised CONSTRAINT_ERROR : synth-vhdl_foreign.adb:267 index check failedNow it fails early, on the Python logger, naming the call:
How
VHDL can't tell elaboration from simulation, so the check uses the VUnit runner phase: before
test_runner_setup,p_stage_arrayreports the failure and returns without calling the bridge library. This coversargandkwargand every other way an array is staged. The rule is a bit stricter than "not during elaboration": an array argument made in a process beforetest_runner_setupis also rejected.This is the small alternative to #18, which defers the transfer so that such arguments just work.
Tests
tests/tb_elaboration_array.vhd, the reproduction from integer_array_t argument made during elaboration crashes the simulation #17.tests/run.pyexpects it to fail and checks that the output has the new error, so a crash still fails the run. Without the fix it fails on NVC with that check.Docs
types.rststates the rule.unreleased.md.🤖 Generated with Claude Code