A Python package that recursively resolves sources.yml files and exports an HDL build list. An external tool supplies module repositories at target/dependency/ / by default; the library root is configurable. This package does not fetch repositories.
Requires Python 3.10 or newer:
For the resolver and exporter alone, use pip install . . Their only runtime dependency is PyYAML. The test extra installs pytest and VUnit.
From the package directory:
Alternatively, use .venv/bin/python -m fpgather with the same arguments.
--project-root locates the project directory.
--libraries-root selects the directory containing the library folders. It defaults to target/dependency and accepts an absolute path or a path relative to --project-root . The same root applies at every inclusion depth.
--work-lib-name sets the entry manifest's library. Its tool-independent default is work . VUnit rejects that reserved name, so select a concrete name such as top_lib for VUnit. --library remains an alias.
--tool selects the target tool; vunit and ghdl are supported.
--file-type selects the output format , not a source suffix filter. Use csv for VUnit or sh for GHDL.
--output selects the CSV location. Each run regenerates the CSV and its .settings.json companion file.
The Python resolver has the corresponding default: resolve(entry, project_root=root, library="work") . Pass libraries_root="vendor" to use /vendor/ / , or supply an absolute path to a shared library directory. The CLI equivalent is --libraries-root vendor ; source paths remain relative to their YAML file. Additional tool/format combinations can be added to the registry in src/fpgather/exporters.py without changing dependency resolution.
Export a Bash analysis script with --tool ghdl --file-type sh . Configure --build-dir , --ghdl and repeatable --ghdl-option=FLAG arguments as needed. Each source retains its language version by default. --ghdl-standard highest uses the newest selected version for all sources; --ghdl-standard 2008 explicitly selects one common version. VUnit exports are unaffected.
See GHDL CLI and Python examples for a complete runnable example, standard compatibility, supported flags and build directory behavior.
syntax_version is optional. Omitting it always means version 1, including after future upgrades. Explicit unsupported versions are rejected.
Source paths are relative to the YAML file containing them.
Dependency paths are relative to / / at every inclusion depth. The default is /target/dependency/ / .
Each library can reference multiple manifests.
Definitions are inherited by child manifests. Local definitions override inherited values only within that subtree; siblings are unaffected.
if: debug requires boolean true . A comparison mapping checks equality; multiple entries in that mapping are combined with AND.
Missing definitions and false conditions skip the entry. A skipped source or dependency file does not need to exist. Conditions do not execute code.
Strings and numbers are not coerced, and true is distinct from 1 .
Language defaults apply only to sources in the declaring manifest. A file's language_version overrides its suffix default. Versions are strings.
Dependencies are processed first; list order is preserved. A shared source appears once per library. Conflicting versions, cycles, missing active files and invalid YAML produce errors with file context.
Library names are normalized to lowercase; their directory names must match.
An explicit stack supports deep inclusion graphs without Python recursion.
Original source paths
The CSV contains absolute paths to the original files , including their original suffixes. The exporter never copies, moves or renames HDL files. Only the CSV and its settings file are written.
In the supplied example, all six selected files remain under test/ :
The CSV prefixes these paths with the absolute package directory. optional.vhd remains in its original directory but is excluded because optional_feature is undefined. No source path points into test/build/ .
CSV and settings can be stored in a temporary directory or moved together without rebasing source paths. Original sources must exist when imported.
The CSV has no header and exactly two columns: library,path . It cannot represent per-file language versions or explicit source types.
For the supplied .vhd example, use the provided helper:
The helper reads sources.settings.json , passes each original path directly to VUnit with file_type="vhdl" and its individual vhdl_standard , and adds explicit dependencies to preserve the resolved order. A hash detects mismatched CSV/settings. Original files are imported without changing their name or location.
VUnit's native add_source_files_from_csv(csv_path, vhdl_standard="2008") works directly for recognized suffixes such as .vhd and .vhdl when one common standard is sufficient. It does not infer VHDL from .hdl and cannot apply individual language versions. The supplied .vhd fixture can be imported directly with the native method. Use the helper to retain its mixed VHDL-2008 and VHDL-1993 standards.
The VUnit exporter supports VHDL-1993, -2002, -2008 and -2019, including aliases 93 , 02 , 08 and 19 . It treats .hdl as VHDL. Unsupported languages or standards are rejected explicitly; the resolver itself is tool-independent.
Reference: VUnit CSV import .
Python code uses four-space indentation, a 79-character code line limit, 72-character and docstring lines, snake_case functions and variables, PascalCase classes, grouped imports, and type hints on public functions. Ruff formats the code and checks PEP 8 style, import ordering and common Python errors. Configuration lives in pyproject.toml .
To apply formatting, run .venv/bin/ruff format . .
Tests use isolated copies of the three-level fixture under test/ and check typed conditions, inheritance, shared dependencies, language versions, errors, more than 1,000 levels, CLI behavior, original absolute paths and actual VUnit imports. Native CSV import is tested with recognized suffixes; the helper is tested with original .vhd files and mixed standards.
test/run.py regenerates the example CSV, verifies selection and compile order, checks native CSV import, imports the original paths with individual standards and prints the final CSV.
This is a Python testbench for the resolver. The seven original HDL files are intentionally empty, so no HDL simulation is performed or required.
Continuous integration
GitHub Actions runs on pushes, pull requests and manual dispatches. CI checks Ruff lint and formatting, runs the tests and VUnit import testbench on Python 3.10–3.14, and builds the wheel and source distribution. A dedicated GHDL job uses ghcr.io/vhdlivery/docker-ghdl:6.0.0-1 and installs the current checkout in a fresh Python environment. Package builds require this job to pass. The Python matrix skips real GHDL tests when GHDL is unavailable.
The build job validates package metadata with Twine and checks the installed wheel's CLI in a fresh environment. Successful builds are available as the distributions workflow artifact for seven days. CI requires no repository secrets and does not publish to PyPI. Publishing is handled separately below.
The release.yml workflow publishes when a GitHub release is published. It checks that the release tag equals v followed by the version in pyproject.toml , reruns the complete CI workflow on the release commit, and uploads those validated distributions using PyPI Trusted Publishing. Ordinary pushes and pull requests never publish packages.
Create a GitHub environment named pypi in this repository's settings.
Sign in to PyPI and open account publishing settings . Add a pending GitHub publisher with these exact values: PyPI project: fpgather Owner: VHDLivery Repository: fpgather Workflow filename: release.yml Environment: pypi For an existing project you own, add it under that project's publishing settings instead. No API token or GitHub secret is required.
PyPI project: fpgather
Workflow filename: release.yml
Environment: pypi For an existing project you own, add it under that project's publishing settings instead. No API token or GitHub secret is required.
Set the new version in pyproject.toml , commit and push the release changes.
Publish a GitHub release with the matching tag, initially v0.1.0 , targeting that commit. Publishing the release triggers the PyPI upload.
Check the Publish to PyPI workflow, then verify the release with python -m pip install fpgather==0.1.0 in a fresh environment.
A pending publisher does not reserve the project name. PyPI distribution filenames cannot be reused; subsequent releases need a new version.
Copyright (c) 2026 VHDLivery. Released under the MIT License .
Author: VHDLivery — vhdlivery@gmail.com .
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
