VHDL and System Verilog parser written in c++
Project description
hdlConvertor
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, ...
Supported languages:
- IEEE 1076-2008 (VHDL 2008) and all previous standard, (currently without
tool_directive
andPSL
) - [IEEE 1076-2019] WIP
- IEEE 1800-2017 (SystemVerilog 2017) and all previous standards.
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
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
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
File details
Details for the file hdlConvertor-2.3.tar.gz
.
File metadata
- Download URL: hdlConvertor-2.3.tar.gz
- Upload date:
- Size: 665.7 kB
- Tags: Source
- Uploaded using 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.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f497ffc33c7d800db07e4b58ded2bc7934ecfd15ddaf0419f9e358c1c285a39 |
|
MD5 | c013eb73375c6aad8d162d0ad5dc1e6f |
|
BLAKE2b-256 | 9b247f6af269ab30ab5e8917e65c2b78dce5fd0037035cc278a97441c5f94de5 |
File details
Details for the file hdlConvertor-2.3-py3.8-linux-x86_64.egg
.
File metadata
- Download URL: hdlConvertor-2.3-py3.8-linux-x86_64.egg
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using 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.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 326a1f566b372ec589d6e5a44ed09935c46766ebc09b345ba63572d20b4d550c |
|
MD5 | e74e5a57123a5f92e17097222a76b05d |
|
BLAKE2b-256 | b8dc994c28ffa5a6a9d5a83baa630ce8b6da1da92abcd83ed582b83c7b5eb104 |