ohsh is a humble command-line tool that works out which HDL source files
(SystemVerilog and VHDL) a design needs and in what order to compile them. Each
module gets a manifest.json that lists its sources and the modules it depends
on. ohsh reads the manifests and writes plain .src file lists, one per
library and language.
ohsh works alongside build flows such as hog, Vivado, Quartus, Questa, cocotb and VUnit. It does not run simulators, manage tool projects or parse your HDL.
Features
- Auto-discovers HDL module manifests anywhere under a project tree.
- Resolves module dependencies recursively, across libraries.
- Detects circular dependencies and exits with an error naming the cycle.
- Emits ordered, per-library source lists for SystemVerilog and VHDL.
- Writes the order to compile the libraries in.
- Checks that every listed source file exists.
- Pure Python with no runtime dependencies.
Installation
pip install ohsh
Or from a clone, which needs Python 3.9 or newer:
git clone https://github.com/logvik-org/ohsh.git
cd ohsh
pip install .
Usage
ohsh [OPTIONS] MODULE
ohsh will:
- Search for all
manifest*.jsonfiles starting from--top-dir. - Resolve dependencies for
MODULE(the top-level). - Generate ordered SystemVerilog and VHDL source lists per library.
- Write them as
<lib>_systemverilog.src/<lib>_vhdl.srcin the output directory. - Write the library compile order to
libraries.src.
Options
| Option | Description | Default |
|---|---|---|
-t, --top-dir |
Project top-level directory, the base for manifest discovery. | cwd |
-w, --work |
Library for the top module, which work in its manifest refers to. |
work |
-o, --output |
Directory for the .src lists and libraries.src, created if missing. |
cwd |
-v, --verbose |
Show progress (-v) or debug details (-vv). |
quiet |
--log-file PATH |
Also write logs to a file (no log file is written by default). | none |
--version |
Print version and exit. | |
-h, --help |
Show help and exit. |
Manifest actions
These options work on the manifests under --top-dir instead of writing source
lists. They read the sources to find which design units each file declares and
uses. --fix and --check work on all modules, or on MODULE and its
dependencies when one is given. See
Create, fix and check manifests.
| Option | Description | Default |
|---|---|---|
--create |
Write a manifest for every source directory that has none. | |
--fix |
Add missing dependencies to the manifests and sort their sources. | |
--check |
Report manifests that --fix would change, exit 104 if there are any. |
|
--exclude PATTERN |
With --create, skip directories matching this glob pattern. |
none |
-y, --yes |
With --create, write every manifest without asking. |
ask |
--no-deps |
With --fix or --check and MODULE, leave its dependencies alone. |
Example
Give each module a manifest.json next to its sources:
project/
├── accumulator/
│ ├── accumulator.vhd
│ └── manifest.json
└── adder/
├── adder.vhd
└── manifest.json
{
"module": "accumulator",
"sources": ["accumulator.vhd"],
"dependencies": {
"work": ["adder"]
}
}
{
"module": "adder",
"sources": ["adder.vhd"]
}
Then run ohsh in the project directory with the top module's name:
cd project
ohsh accumulator
It writes work_vhdl.src with the sources in compile order:
/path/to/project/adder/adder.vhd
/path/to/project/accumulator/accumulator.vhd
and libraries.src with the libraries to compile (here only work). Modules
with SystemVerilog sources go to <lib>_systemverilog.src in the same way. See
the manifest file format
for dependencies across libraries.
libraries.src lists the library names, one per line, in the order to compile
them: each library comes after the libraries it uses. Compile the libraries in
this order rather than hard-coding it. If libraries depend on each other in a
loop (a module in libA uses libB and a module in libB uses libA), no
such order exists. ohsh then logs a warning and writes a best-effort order,
which works for tools that sort files themselves (such as Vivado or Quartus
projects) but may fail with tools that compile one library at a time.
Documentation
The full documentation is at ohsh.readthedocs.io:
- Getting started
- Manifest file format
- Integrations with simulators and build tools
- Create, fix and check manifests
- Exit codes
- Contributing and development
License
Licensed under the Apache License 2.0. See LICENSE and NOTICE.
Author
Ola Groettvik - GitHub
Metadata
Release files for ohsh 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ohsh-0.3.0.tar.gz | 25.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ohsh-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.3 kB
Release files / ohsh-0.3.0.tar.gz
| Download URL | ohsh-0.3.0.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35690806156c284e04fa1a65155fce0da11570634f31cb294c4e5df7e126bfef
|
|
BLAKE2b-256 checksum How to use checksums |
59541c5d1afd36a238c867de27f50e0f01cfe2fe4c9b71bb29e41b2b1d51c79c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / ohsh-0.3.0-py3-none-any.whl
| Download URL | ohsh-0.3.0-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a12c59a661f2a6262b28e11631350ebdf5769089bd7ffd15cc6ddda1a588e47c
|
|
BLAKE2b-256 checksum How to use checksums |
c636bfe2db206d52d97d9e58f921195d0c084f084bea9bb3fe5b20f75d0a65ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency log