py4hw
py4hw is an HDL library based on python to create digital circuits (mainly) following a structural design methodology. It is highly influenced by some principles used in JHDL but using the power of Python.
When people see Python and HDL in the same sentence they automatically associate it with two ideas:
- This is an attempt to generate Verilog from Python code with an HLS approach
- This will generate terribly inefficient Verilog
The answer to both questions is NO. py4hw is NOT [yet] intended to be a python HLS tool. It actually starts from a bottom-up approach modelling basic logic gates. In fact, you can generate Verilog code at a very fine-grain.
Features
- Cycle-based Simulation
- Clear separation of design styles
- Structural
- Behavioural
- Combinational
- Sequential (RTL)
- Algorithmic
- Schematic Rendering
- Interactive Simulation
- Verilog Generation (for Structural, Combinational and Sequential design styles)
- WaveDrom generation
- Library of predefined circuits
- Pypi based distribution
- Jupyter Notebook integration
- Integration with edalize
- Support for existing Hardware platforms (Terasic DE0, and DE1SoC so far)
Follow the jump start tutorial in a jypyter notebook! or access the static html version here
Contributing
Contributors are more than welcome :-)
I've identifyied a number of low-effort aspects that should be done
- change the use of nbwavedrom by wavedrom
- correct synchronization of wire names and waveforms in WaveformWindow and support for scrolling, zooming and paning.
- avoid complete redrawing in interactive workbench
..and other high effort tasks
- improve the place & route algorithm in the schematic viewer
- collapse interfaces in the schematic viewer
- support additional hardware platforms
- transpile algorithmic into RTL
Publications
Cite as
@conference{castells2023streamlining,
author = {David Castells-Rufas and Gemma Rotger and David Novo},
title = {Streamlining FPGA Circuit Design and Verification with Python and py4hw},
booktitle = {XI Southern Programmable Logic Conference},
year = 2023,
month = mar,
address = {San Luis, Argentina},
doi = {10.5281/zenodo.8325670}
}
Metadata
Release files for py4hw 2026.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py4hw-2026.8.tar.gz | 176.5 kB | Without provenance | Details for py4hw-2026.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py4hw-2026.8-py3-none-any.whl | Python 3 | none | any | Details for py4hw-2026.8-py3-none-any.whl |
Total release size: 365.5 kB
Release files / py4hw-2026.8.tar.gz
| Download URL | py4hw-2026.8.tar.gz |
|---|---|
| Size | 176.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c1764ad54228077c9d9b0124bee5c04b14776a8199e4bf1202de799ac20e470
|
|
BLAKE2b-256 checksum How to use checksums |
b2b07fe255e234b582d4caa9eb8bd2e4f356360fe27e49e381703ab014585b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / py4hw-2026.8-py3-none-any.whl
| Download URL | py4hw-2026.8-py3-none-any.whl |
|---|---|
| Size | 189.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d03ea3cad0ba9c9a841e0dda9527d202e6b8e07288a0d4731035d8a18ca968b3
|
|
BLAKE2b-256 checksum How to use checksums |
ebc260b9d332d6f28dffc465ac582190b5a5ee55d580d3693fcdc0be6d9a5181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for py4hw 2026.8
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.