Skip to main content

py4hw

PyPI version

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:

  1. This is an attempt to generate Verilog from Python code with an HLS approach
  2. 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}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py4hw-2026.3.tar.gz (157.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py4hw-2026.3-py3-none-any.whl (168.6 kB view details)

Uploaded Python 3

File details

Details for the file py4hw-2026.3.tar.gz.

File metadata

  • Download URL: py4hw-2026.3.tar.gz
  • Upload date:
  • Size: 157.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for py4hw-2026.3.tar.gz
Algorithm Hash digest
SHA256 23e199a1351d6e9fd295bdb61f5ac245bb3d956493816f23087acf3b71796c20
MD5 c2500ac4873a92dea9d3fa6df9ef7b9c
BLAKE2b-256 c96b6b540d6c59d65b8dbf1214c729e5284f2c53e0ee2c6a19f54113e423a4b0

See more details on using hashes here.

File details

Details for the file py4hw-2026.3-py3-none-any.whl.

File metadata

  • Download URL: py4hw-2026.3-py3-none-any.whl
  • Upload date:
  • Size: 168.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for py4hw-2026.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f623aff8f443a64311f2a475df5da88d4a992ee25ae56b7907f9b3fbc5ca6a59
MD5 faa55ef110c314aa79646c73ac959551
BLAKE2b-256 114dcb386e1dba85238881fe53b3b9d066487c0769809d9f418aa668a3d4f81a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2026.3 This release

2 files

2026.2

2 files

2026.1

2 files

2025.5

2 files

2025.4

2 files

2025.3

2 files

2024.4

2 files

2024.3

2 files

2024.1

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page