Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "vunit-python-bridge"
version = "0.1.0"
version = "0.2.0"
description = "A VUnit package making Python callable from VHDL."
urls = {homepage = "https://github.com/VUnit/vunit-python-bridge"}
readme = "README.md"
Expand Down
24 changes: 24 additions & 0 deletions release_notes/0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

## Breaking changes

- `import_module_from_file` resolves a relative path against the directory of the testbench file, like `exec_file`, rather than against the working directory of the simulator. It must be called after `test_runner_setup`. Callers that relied on a path relative to the working directory must pass an absolute path instead. See #7. (#9)
- A relative file name given to `exec_file` or `import_module_from_file` before `test_runner_setup` has completed is reported as a failure, instead of being taken from the working directory of the simulator. (#12)
- `arg(value : string)` and `kwarg(kw, value : string)` now produce a valid Python string literal: quotes, backslashes and control characters in the text are escaped. Callers that escaped the text themselves (for example passing `\n` to get a newline) now get that text escaped again, and must pass the plain text instead. (#16)
- An `integer_array_t` is indexed in NumPy like in VUnit, `get(a, x, y, z)` being `a[x, y, z]` with shape `(width, height, depth)`, instead of `a[y, x, z]` with shape `(height, width, depth)`. This applies to arguments and returned arrays. Code indexing 2D or 3D arrays in Python must swap its first two indices, and an array from an image library, which index rows first, needs `a.swapaxes(0, 1)`. (#26)

## Features

- VUnit's `dict_t` is supported in both directions: `eval_dict` and `call_dict`, aliased `eval` and `call`, return a Python dict as a new `dict_t`, and `arg(dict_t)` and `kwarg(kw, dict_t)` pass a `dict_t` to Python as a dict. Values are integers, reals, strings, booleans, integer vectors, `integer_array_t` (NumPy arrays) and nested dicts. It needs `get_key` and `get_value_type` of `dict_pkg`, so VUnit 5.0.0.dev15 or later is required. (#11)
- `base_path` returns a base directory set with `vunit_python_bridge.set_relative_file_base()` or `VUNIT_PYTHON_BRIDGE_FILE_BASE`, for file names that work at any time, for example in verification components. (#12)
- The bridge library is no longer built in or copied to the VUnit output path, which may not allow executing files, but to `~/.vunit-python-bridge` in the home directory of the user, on every platform. This includes the prebuilt Windows DLLs. `VUNIT_PYTHON_BRIDGE_LIBRARY_DIR` selects another directory on every platform. When the directory cannot be written, the setup fails and asks for the variable to be set. (#13)
- Python 3.15 is supported, with a prebuilt bridge DLL for Windows. (#24)
- conda-forge Pythons are supported: their `python` executable links Python statically, but the bridge now uses the shared `libpython` they also ship. (#34)

## Bug fixes

- A library directory the simulator cannot load the bridge library from is reported as such when the package is set up: on Linux and macOS one on a file system mounted `noexec`, e.g. a tmpfs in a container, and on Windows one where an execution policy (AppLocker, Windows Defender Application Control) blocks the library. The simulator only reports that it failed to load it. Any other reason the library does not load is reported by the setup with the reason the system gives, rather than by NVC or GHDL as "cannot load VHPIDIRECT shared library" with no reason. (#13)
- An `integer_array_t` argument made before `test_runner_setup`, for example in a constant during elaboration, is reported as a failure naming the call, instead of crashing the simulator (NVC: "foreign function vpy_push_array not found", GHDL: CONSTRAINT_ERROR). See #17. (#29)

## Miscellaneous

- The package manifest uses the `requires` expression of VUnit 5.0.0.dev15 instead of the deprecated `requires-vunit` and `requires-vhdl` fields. (#36)
1 change: 0 additions & 1 deletion release_notes/news.d/11.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/12.breaking.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/12.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/13.bugfix.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/13.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/16.breaking.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/24.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/26.breaking.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/29.bugfix.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/34.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/36.misc.md

This file was deleted.

1 change: 0 additions & 1 deletion release_notes/news.d/9.breaking.md

This file was deleted.

Loading