Skip to main content

HWToolkit (hwt),

the library for hardware development in Python

CircleCI Coverage Status PyPI version Documentation Status Google group Python version Join the chat at https://gitter.im/hwt-community/community

Keywords

  • Metaprogramming (Hardware Construction Language HCL, templatization) + HLS.
  • Simulator API, UVM
  • Buildtool, IP core generator

How HWT can help you?

  • The lower layer (IR, HDL serializers) is a shield against a problems related to VHDL/Verilog. It is checking for correctness and synthetisability and removing specific of HDLs.
  • The system level and HLS layer allows you to quickly build desing generators with advance optimisation techniques of your choice.
  • Simulator API and it's UVM simulation environment is just python object with C++ binding. This makes it easy to use while not sacrificing performance.
  • Rich type system can describe also data locality and packet features. This significantly simplifies configuration of component which are working with packets or any data over remote bus.
  • HWT is not compiler nor transpiler but it is actually a core library. It contains only necessary stuff and you can can modify/extend any part any time. Because the word of HW developement is always full of unexpected situations.

Features

  • Hardware Construction Language (HCL) (example simple, showcase). It is somewhere between HLS and HDL. It offers HLS style of coding but at the same time it allows you to manipulate HDL objects. This means it is a little bit slower to write a prototype than you would in HLS, but you always know what, how and why is happening.
  • Digital circuit simulator with UVM like verification environment (example usage CAM, structWriter_test.py)
  • Tools for static analysis (resourceAnalyzer, example usage cntr_test.py)
  • Serializers to export HWT designs into multiple target HDLs (verilog, VHDL, system-c, IP-core packager, hwt itself...)

HWT uses hilevel-netlists for internal representation of target design. Optimized netlists are generated from usual code statements, function calls, statements etc (hw processes are automatically resolved). This netlist is easy to use and easy to modify or analyse by user if there is something missing in main library. Also serialization modes allows to tweaks how component should behave during serialization.

HWT performs no HLS planing or schedueling. HWT is also good as API for code generating by more advanced tools. Hierarchy of components/interfaces/types is not limited. User specifed names are checked for collision with target language.

HWT designs are objects. No specific exceution is required, just run python3, import the thing and use to_rtl metod or other (take a look at examples).

HWT ecosystem

hwt_ecosystem_packages.png

Installation

This library is a regular python package. You can install it using:

# system-wide, use -u for local use only
sudo pip3 install hwt

# or directly from git
pip3 install --upgrade --force-reinstall --no-cache-dir -r https://raw.githubusercontent.com/Nic30/hwt/master/doc/requirements.txt git+git://github.com/Nic30/hwt.git@master#egg=hwt

Then you are able to use functions and classes defined in the hwt library from a python console or script. Installation of hwtLib is recomended as it contains common interfaces, agents, components etc...

FAQ

  • Where is the entry point of the compiler?
    • This is not a compiler, it is library of the objects which can be converted to Verilog/VHDL and back.
  • How do I get Verilog/VHDL?
  • How do I define my interface type, protocol and simulation agent?
    • Derive from any Interface class. example
  • I do have c structure of UDP header, how do I send/recieve UDP packet over AXI-stream interface?
    • Define HStruct type composed of eth_header_t, IPv4_header_t and HStream(uint8_t) and use AxisFrameGen. There is and example of ping responder

Similar projects

  • autofpga - C++, A utility for Composing FPGA designs from Peripherals
  • BinPy - Python, An electronic simulation library
  • blarney - Haskell, HCL
  • bsc - Haskell, C++, BSV - Bluespec Compiler
  • chisel - 2012-?, Scala, HCL
  • Chips-2.0 - , , FPGA Design Suite based on C to Verilog design flow
  • circt - 2020-?, C++/LLVM, compiler infrastructure
  • circuitgraph - Tools for working with circuits as graphs in python
  • concat - 2016-?, Haskell, Haskell to hardware
  • DUH - JS, simple convertor between verilog/scala/ipxact
  • DFiant 2019-?, Scala, dataflow based HDL
  • edalize - 2018-?, Python, abstraction layer for eda tools
  • garnet -2018-?, Python, Coarse-Grained Reconfigurable Architecture generator based on magma
  • hammer - 2017-?, Python, Highly Agile Masks Made Effortlessly from RTL
  • heterocl - 2017-?, C++, A Multi-Paradigm Programming Infrastructure for Software-Defined Reconfigurable Computing
  • hoodlum - 2016-?, Rust, HCL
  • ILAng - modeling and verification platform for SoCs where Instruction-Level Abstraction (ILA) is used as the formal model for hardware components.
  • :skull: jhdl - ?-2017, C++ Verilog/VHDL -> systemC, prototype
  • Kactus2 - IP-core packager
  • kratos - C++/Python, hardware generator/simulator
  • lgraph - C, generic graph library
  • llhd - Rust, HCL
  • livehd - mainly C++, An infrastructure designed for Live Hardware Development.
  • Lucid HDL in Alchitry-Labs - Custom language and IDE inspired by Verilog
  • magma - 2017-?, Python, HCL
  • migen - 2013-?, Python, HCL
  • mockturtle - logic network library
  • moore - Rust, HDL -> model compiler
  • MyHDL - 2004-?, Python, Process based HDL
  • nmigen -, Python, A refreshed Python toolbox for building complex digital hardware
  • OpenTimer - , C++, A High-Performance Timing Analysis Tool for VLSI Systems
  • percy - Collection of different synthesizers and exact synthesis methods for use in applications such as circuit resynthesis and design exploration.
  • PyChip-py-hcl - , Python, Chisel3 like HCL
  • pygears - , Python, function style HDL generator
  • PyMTL3 2018-?
  • PyMTL - 2014-?, Python, Process based HDL
  • PipelineC - 2018-?, Python, C++ HLS-like automatic pipelining as a language construct/compiler
  • PyRTL - 2015-?, Python, HCL
  • Pyverilog - 2013-? Python-based Hardware Design Processing Toolkit for Verilog HDL
  • rogue , C++/Python - Hardware Abstraction & Data Acquisition System
  • sail 2018-?, (OCaml, Standard ML, Isabelle) - architecture definition language
  • spatial - Scala, an Argon DSL like, high level abstraction
  • SpinalHDL - 2015-?, Scala, HCL
  • Silice - ?, C++, Custom HDL
  • :skull: SyDpy - ?-2016, Python, HCL and verif. framework operating on TML/RTL level
  • systemrdl-compiler - Python,c++, register description language compiler
  • UHDM - C++ SystemVerilog -> C++ model
  • :skull: Verilog.jl - 2017-2017, Julia, simple Julia to Verilog transpiler
  • veriloggen - 2015-?, Python, Verilog centric HCL with HLS like features
  • :skull: wyre - 2020-2020, Mupad, Minimalistic HDL

Related open-source

Board support libraries (Potential candidates for public integration)

Sources of informations in this area

Metadata

Release files for hwt 3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hwt 3.8
File Size Uploaded
hwt-3.8.tar.gz 170.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for hwt 3.8
File Interpreter ABI Platform
hwt-3.8-py3.9.egg Legacy Egg format - - Details
hwt-3.8-py3-none-any.whl Python 3 none any Details

Total release size: 995.5 kB

Release files / hwt-3.8.tar.gz

Download URL hwt-3.8.tar.gz
Size 170.4 kB
Tags Source
SHA-256 checksum
How to use checksums
889aeedbbf1cd495a794d1884c0cbf788aba12d9b6981e9ada08d95f8b6cafbc
BLAKE2b-256 checksum
How to use checksums
c053a33893f946d6e7b5226ee12107dcd16592fe8b331a5fecdea01472a4afc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

Release files / hwt-3.8-py3.9.egg

Download URL hwt-3.8-py3.9.egg
Size 587.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
0c0a526f4d95ed4e7c55e77da919b7c5b2f749b469e97d2c4e83711aeefd0bb6
BLAKE2b-256 checksum
How to use checksums
8577a08e52b9c4389e58bb0c8845ff2375622b972fa77eb16b511029ca939edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

Release files / hwt-3.8-py3-none-any.whl

Download URL hwt-3.8-py3-none-any.whl
Size 237.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc4b4c10421fe24b9dbe8c9134688cead8da2a54386ff8c49a9073d65b176a02
BLAKE2b-256 checksum
How to use checksums
ba037d704773c65ed4a94a53412fcec8508fddbe5de099f8c361c52ec944f710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

3.8 This release

3 release files

3.7

1 release file

3.6

1 release file

3.5

1 release file

3.4

1 release file

3.3

1 release file

3.2

1 release file

3.1

1 release file

3.0

1 release file

2.9

1 release file

2.8

1 release file

2.7

1 release file

2.6

1 release file

2.5

1 release file

2.4

1 release file

2.3

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.9

1 release file

1.8

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

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