py4hw is a library to model, and simulate digital logic circuits. It promotes the use of structural and behavioural design styles to build hardware.
Project description
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 !
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}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py4hw-2025.4.tar.gz.
File metadata
- Download URL: py4hw-2025.4.tar.gz
- Upload date:
- Size: 110.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ab5db6fbe0a1570e56172af33e93ccc3563343b986aa311e5f6e52072d87f38
|
|
| MD5 |
e081eec521e94d5e50f58ae05a5b0cb4
|
|
| BLAKE2b-256 |
8ad6eb4a26d46ac3d60c726b9bdd1d2e4d6475026794a585f76b07cf3eb9c636
|
File details
Details for the file py4hw-2025.4-py3-none-any.whl.
File metadata
- Download URL: py4hw-2025.4-py3-none-any.whl
- Upload date:
- Size: 127.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
234067007556de232b4101852127316437c6a2625a75e83732a59382024461ae
|
|
| MD5 |
e1724f3a61dc96fa431fa324ffc3a76e
|
|
| BLAKE2b-256 |
df666543ff6c6ad8878c9ad36ed75492f58be1f058495ec802e7eb7bcbce4ec1
|