Skip to main content

An abstract VHDL language model.

Project description

Sourcecode on GitHub Sourcecode License Documentation Documentation License Gitter
PyPI PyPI - Status PyPI - Python Version
GitHub Workflow - Build and Test Status Libraries.io status for latest release Codacy - Quality Codacy - Coverage Codecov - Branch Coverage

An abstract VHDL language model written in Python.

Main Goals

This package provides a unified abstract language model for VHDL. Projects reading from source files can derive own classes and implement additional logic to create a concrete language model for their tools.

Projects consuming pre-processed VHDL data (parsed, analyzed or elaborated) can build higher level features and services on such a model, while supporting multiple frontends.

Use Cases

pyVHDLModel Generators

  • High-level API for GHDL's libghdl offered via pyghdl.
  • Code Document-Object-Model (Code-DOM) in pyVHDLParser.

pyVHDLModel Consumers

  • Create graphical views of VHDL files or designs.
    Possible candidates: Symbolator
  • Created a (re)formatted output of VHDL.

Examples

List all Entities with Generics and Ports

The following tiny example is based on GHDL's pyGHDL.dom package implementing pyVHDLModel.

from pathlib import Path
from pyGHDL.dom.NonStandard import Design, Document

sourceFile = Path("example.vhdl")

design = Design()
library = design.GetLibrary("lib")
document = Document(sourceFile)
design.AddDocument(document, library)

for entity in document.Entities.values():
  print(f"{entity.Identifier}")
  print("  generics:")
  for generic in entity.GenericItems:
    identifiers = ", ".join([str(i) for i in generic.Identifiers])
    print(f"  - {identifiers} : {generic.Mode!s} {generic.Subtype}")
  print("  ports:")
  for port in entity.PortItems:
    identifiers = ", ".join([str(i) for i in port.Identifiers])
    print(f"  - {identifiers} : {port.Mode!s} {port.Subtype}")

Contributors

License

This Python package (source code) licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution 4.0 (CC-BY 4.0).


SPDX-License-Identifier: Apache-2.0

Project details


Download files

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

Source Distribution

pyvhdlmodel-0.29.2.tar.gz (59.6 kB view details)

Uploaded Source

Built Distribution

pyVHDLModel-0.29.2-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

File details

Details for the file pyvhdlmodel-0.29.2.tar.gz.

File metadata

  • Download URL: pyvhdlmodel-0.29.2.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pyvhdlmodel-0.29.2.tar.gz
Algorithm Hash digest
SHA256 d8fa1cb089d3b8c9008e5d8a858b12258bbd7a93d103b92dfbaa838c815af595
MD5 efe2244d732aa4d3ca026119760474c9
BLAKE2b-256 24bd83b9b74d313276c6af965f99788093fed7b0124cf0bf43c8da022de8ee40

See more details on using hashes here.

File details

Details for the file pyVHDLModel-0.29.2-py3-none-any.whl.

File metadata

  • Download URL: pyVHDLModel-0.29.2-py3-none-any.whl
  • Upload date:
  • Size: 79.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pyVHDLModel-0.29.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b509370ebaf470dd8309985ce534c06cf0b1ea08d45d9a47158d01387a744382
MD5 016a05c1b18e5fd1c7222504df7ddf8d
BLAKE2b-256 ac4c6ea159e25311b497c2f66866270182f376673e36259e1e53b8f494cc186f

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