You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make import_module_from_file resolve relative paths consistently with exec_file #7
Currently, exec_file resolves relative paths against the testbench directory using the shared VUnit runner state, while import_module_from_file passes its path directly to Python, resolving relative paths against the simulator’s working directory.
This makes importing Python models from verification components unnecessarily awkward: the component must receive an absolute path or obtain the testbench path explicitly.
Please make both APIs use the same path resolution:
Resolve relative paths against the top-level testbench directory.
Preserve absolute paths unchanged.
Allow calls from verification components and VHDL package procedures without passing tb_path or runner_cfg locally.
For example, after test_runner_setup, a component should be able to write:
import_module_from_file("models/filter.py", "filter_model");
result := call_integer("filter_model.compute", arg(21));
This should load models/filter.py relative to the top-level testbench directory.
The existing p_file_path helper used by exec_file could be shared with import_module_from_file.
Acceptance criteria:
Relative imports work from a child component after runner setup, even when the simulator’s working directory differs from the testbench directory.
Absolute paths and the optional session parameter retain their existing behavior.
import_run_script, which uses import_module_from_file internally, continues to work.
Documentation explains the path base and runner-setup requirement.
Release notes flag the change for callers relying on working-directory-relative imports.
Resolving paths relative to the calling component’s own VHDL source directory is outside the scope of this issue.
Activity
Resolve relative paths of import_module_from_file against the testben…