Skip to main content

VHDL and System Verilog parser written in c++

Project description

hdlConvertor

CircleCI Win Build status PyPI version Python version Gitter Coverage Status(generated code)

This library is a System Verilog and VHDL parser, preprocessor and code generator for Python/C++. It contains:

  • ANTLR4 generated VHDL/(System) Verilog parser with full language support.
  • Convertors from raw VHDL/SV AST to universal HDL AST (hdlConvertor::hdlAst and it's python equivalent.).
  • Convertors from this HDL AST to SV/VHDL/JSON and other formats.
  • Compiler focused utils for manipulation with HDL AST.
    • HdlAstVisitor, id resolution, sensitivity detection, vhdl <-> verilog type conversion, ...

overview

Supported languages:

Installation

Linux: Installing dependencies (Ubuntu 20.10)

# we recommend to use gcc>=9, Visual Studio 2017 or equivalent
sudo apt install build-essential uuid-dev cmake default-jre python3 python3-dev python3-pip libantlr4-runtime-dev antlr4 ninja-build

Installing this library

# note this may be older version than you see in repo
sudo pip3 install hdlConvertor

# or download repository and run
sudo pip3 install --upgrade --force-reinstall --no-cache-dir git+https://github.com/Nic30/hdlConvertorAst.git
sudo pip3 install -r requirements.txt
sudo python3 setup.py install

# if you are using version from git rather uninstall
# old library first if required
# sudo pip3 uninstall hdlConvertor

Installer also supports other options which may be usefull

python setup.py install --prefix /tmp/python_install/ --build-type Debug -- -DANTLR_JAR_LOCATION=/antlr-4.7.1-complete.jar -- VERBOSE=1

You can also install only C++ library/generate .deb package (nothing specific, just normal cmake-based library)

mkdir build && cd build
cmake .. && cmake . --build
cpack # to generate .deb package

Windows:

Take a look at appveyor.yml and doc/windows_installation_and_build.rst. It is required to download antlr4 first and have visual studio or other c++ compiler installed.

Usage

The HDL AST (the parsed code) is represented by objects from hdlConvertor.hdlAst. Parsing and code modification is straightforward, as you can see in following example Binder

Similar projects:

(Tell us If you know about some other project!)

  • circt - C++, LLVM based infrastructutre for SV/VHDL/FIRRTL compilation and simulation
  • cl-vhdl - lisp, Parser of VHDL into lisp-expressions
  • HDL_ANTLR4 - C# projects that use ANTLR4 library to analyse VHDL and Verilog code
  • hdlparse - vhdl/verilog parser in python
  • ieee1800_2017 - Java, SystemVerilog preprocessor
  • istyle-verilog-formatter - c++, Verilog formatter
  • Pyverilog - python verilog toolkit
  • pyvsc - C++, library for Verification Stimulus and Coverage description
  • pyVHDLParser - python vhdl parser with 2008 support
  • RgGen - CSR (Configuration and Status Registers) generator
  • rust_hdl - rust vhdl 2008 parser
  • slang - Parser and compiler library for SystemVerilog.
  • sv-parser - Rust, SystemVerilog parser library fully complient with IEEE 1800-2017
  • systemc-clang - SystemC Parser using the Clang Front-end
  • v2sc - vhdl to systemc
  • veelox - Java+ANTLR, An experiment in SystemVerilog Preprocessing
  • verible -C++, SystemVerilog parser, style-linter, and formatter
  • verilog-parser - A Flex/Bison Parser for the IEEE 1364-2001 Verilog Standard.
  • vbpp - C, Verilog PreProcessor
  • tree-sitter-verilog - JS, Verilog grammar for tree-sitter
  • Verilog-Perl
  • vpp.pl - verilog preprocessor with integrated Perl
  • sv2v- Haskell, SystemVerilog to Verilog
  • Surelog - C++, System Verilog 2017 Pre-processor and parser
  • verible - C++, System Verilog 2017 parser
  • UHDM - rust, universal hardware data model

Project details


Release history Release notifications | RSS feed

This version

2.3

Download files

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

Source Distribution

hdlConvertor-binary-2.3.tar.gz (161.2 kB view details)

Uploaded Source

Built Distributions

hdlConvertor_binary-2.3-cp312-cp312-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.31+ x86-64

hdlConvertor_binary-2.3-cp311-cp311-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.31+ x86-64

hdlConvertor_binary-2.3-cp310-cp310-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

hdlConvertor_binary-2.3-cp39-cp39-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

hdlConvertor_binary-2.3-cp38-cp38-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

File details

Details for the file hdlConvertor-binary-2.3.tar.gz.

File metadata

  • Download URL: hdlConvertor-binary-2.3.tar.gz
  • Upload date:
  • Size: 161.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for hdlConvertor-binary-2.3.tar.gz
Algorithm Hash digest
SHA256 1f6131f76dbf1bc18d5847fe96b8033a5bb14219ebb2eb50b9bec1f3c62df97b
MD5 0c21b07ff970adf452148d8a36e74053
BLAKE2b-256 c98c9623469a89adda7772e456ce6b0d8c52ecc381e5e05408925b54e0619ad4

See more details on using hashes here.

File details

Details for the file hdlConvertor_binary-2.3-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for hdlConvertor_binary-2.3-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d68d2d2f314c366fe5d47dac55447945a7da3ef9e8873ba1b13dfd107497d9e6
MD5 f0eccca3da5eb5d07096f8c2857b7530
BLAKE2b-256 34795c68506fb17dda2e471268be50a22d02786b397aa4ec0d0d57c79466ab31

See more details on using hashes here.

File details

Details for the file hdlConvertor_binary-2.3-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for hdlConvertor_binary-2.3-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e80870720fdc831a44342f8878f0d9d8b991b782ac9ea1020ca074044b0f6a33
MD5 e2e1e8aaed7ba9cfaa03115ad5fa3a1f
BLAKE2b-256 63b9e513450a091ddd11a222c0584e6c469e93254c93717494661aba6ed00b9e

See more details on using hashes here.

File details

Details for the file hdlConvertor_binary-2.3-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for hdlConvertor_binary-2.3-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d3c66d2f26bde2a6d92bc209c7e42b16168fc25493c86d61d58f050691845def
MD5 49e631afc33c6b9c90f3b14cb0edbdd6
BLAKE2b-256 8ae26fcf1448053405ada691933ed814a8b8a151ee9badcf9fa7f6cad78188de

See more details on using hashes here.

File details

Details for the file hdlConvertor_binary-2.3-cp39-cp39-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for hdlConvertor_binary-2.3-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 bb3f66aeefe2735d64806e292129a9376399832b968b2f1186a90da61c08cd71
MD5 a9b968cdddf4fd3ff275160dfa5729ef
BLAKE2b-256 f5fb74390d146b63a73dc50f6ac67d99a38b67d364eb2e00ef9858eca48a1579

See more details on using hashes here.

File details

Details for the file hdlConvertor_binary-2.3-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for hdlConvertor_binary-2.3-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 3dd437bc872053ea7d704b86a55623ce7a0bad40e123164962a2bc8929e64363
MD5 28a41d309a29a33a740905836897b483
BLAKE2b-256 a6b039cf0e20384ef8f4bbc19e23badb314166e7dff924a1841d2371b41e6b55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page