Skip to content

Introduction

Sunny Chen edited this page Feb 14, 2020 · 2 revisions

PyHCL(Python based Hardware Construction Language) is a hardware construction language embedded in Python, one of the most popular programming language. PyHCL is inspired by Chisel, a wonderful hardware design and verification frameworks based on Scala. The goal of PyHCL is to provide a more user friendly, more lightweight, more relaxed hardware design frameworks for all hardware developers. Also, PyHCL is the design part of the hardware development and verification framework: PyChip.

Inorder to get started to PyHCL, we first make a brief introduction of PyHCL's framework: PyHCL's front-end is a Python library for hardware design. The target language of PyHCL is FIRRTL(Flexible Intermediate Representation for RTL), and the generated FIRRTL code would compile to Verilog using the FIRRTL compiler.

This guide will introduce PyHCL starting with a simple example. Readers could build a preliminary impression of using PyHCL from this simple example. We will introduce the datatypes, builtin operators, and several common circuit elements of PyHCL. Then we give two case studies to show the readers how to use PyHCL to construct combinational and sequential circuits.

The advanced topics shows the advanced features of PyHCL, including parameterization, functional programming, and several useful pre-defined circuit modules. Mastering thses features will allow you to design your hardware easily and quickly.

So let's get started to PyHCL, with a commonly known simple example, a full adder.

>>Next(A Simple Example)