<p align="center">
<a title="vhdl.github.io/pyVHDLModel" href="https://vhdl.github.io/pyVHDLModel"><img height="80px" src="doc/_static/logo.svg"/></a>
</p>
[![Sourcecode on GitHub](https://img.shields.io/badge/VHDL-pyVHDLModel-29b6f6.svg?longCache=true&style=flat-square&logo=GitHub&labelColor=0277bd)](https://github.com/vhdl/pyVHDLModel)
[![Sourcecode License](https://img.shields.io/pypi/l/pyVHDLModel?longCache=true&style=flat-square&logo=Apache&label=code)](LICENSE.md)
[![Documentation](https://img.shields.io/website?longCache=true&style=flat-square&label=vhdl.github.io%2FpyVHDLModel&logo=GitHub&logoColor=fff&up_color=blueviolet&up_message=Read%20now%20%E2%9E%9A&url=https%3A%2F%2Fvhdl.github.io%2FpyVHDLModel%2Findex.html)](https://vhdl.github.io/pyVHDLModel/)
[![Documentation License](https://img.shields.io/badge/doc-CC--BY%204.0-green?longCache=true&style=flat-square&logo=CreativeCommons&logoColor=fff)](LICENSE.md)
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef)](https://gitter.im/hdl/community)
[![PyPI](https://img.shields.io/pypi/v/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072)](https://pypi.org/project/pyVHDLModel/)
![PyPI - Status](https://img.shields.io/pypi/status/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072)
[![GitHub Workflow - Build and Test Status](https://img.shields.io/github/actions/workflow/status/vhdl/pyVHDLModel/Pipeline.yml?branch=main&longCache=true&style=flat-square&label=Build%20and%20test&logo=GitHub%20Actions&logoColor=FFFFFF)](https://github.com/VHDL/pyVHDLModel/actions/workflows/Pipeline.yml)
[![Libraries.io status for latest release](https://img.shields.io/librariesio/release/pypi/pyVHDLModel?longCache=true&style=flat-square&logo=Libraries.io&logoColor=fff)](https://libraries.io/github/vhdl/pyVHDLModel)
[![Codacy - Quality](https://img.shields.io/codacy/grade/2286426d2b11417e90010427b7fed8e7?longCache=true&style=flat-square&logo=Codacy)](https://www.codacy.com/gh/VHDL/pyVHDLModel)
[![Codacy - Coverage](https://img.shields.io/codacy/coverage/2286426d2b11417e90010427b7fed8e7?longCache=true&style=flat-square&logo=Codacy)](https://www.codacy.com/gh/VHDL/pyVHDLModel)
[![Codecov - Branch Coverage](https://img.shields.io/codecov/c/github/vhdl/pyVHDLModel?longCache=true&style=flat-square&logo=Codecov)](https://codecov.io/gh/vhdl/pyVHDLModel)
<!--
[![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/pypi/pyVHDLModel?longCache=true&style=flat-square&logo=GitHub)](https://github.com/vhdl/pyVHDLModel/network/dependents)
[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyVHDLModel?longCache=true&style=flat-square)](https://libraries.io/github/vhdl/pyVHDLModel/sourcerank)
-->
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](https://GitHub.com/ghdl/ghdl) `libghdl` offered via `pyghdl`.
* Code Document-Object-Model (Code-DOM) in [pyVHDLParser](https://GitHub.com/Paebbels/pyVHDLParser).
## pyVHDLModel Consumers
* Create graphical views of VHDL files or designs.
Possible candidates: [Symbolator](https://GitHub.com/kevinpt/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`](https://GitHub.com/ghdl/ghdl/tree/master/pyGHDL/dom) package implementing
pyVHDLModel.
```python
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
* [Patrick Lehmann](https://GitHub.com/Paebbels) (Maintainer)
* [Unai Martinez-Corral](https://GitHub.com/umarcor)
* [and more...](https://GitHub.com/VHDL/pyVHDLModel/graphs/contributors)
# License
This Python package (source code) licensed under [Apache License 2.0](LICENSE.md).
The accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst).
-------------------------
SPDX-License-Identifier: Apache-2.0
Raw data
{
"_id": null,
"home_page": "https://GitHub.com/VHDL/pyVHDLModel",
"name": "pyVHDLModel",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "Python3 VHDL Language Model Abstract",
"author": "Patrick Lehmann",
"author_email": "Paebbels@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/24/bd/83b9b74d313276c6af965f99788093fed7b0124cf0bf43c8da022de8ee40/pyvhdlmodel-0.29.2.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a title=\"vhdl.github.io/pyVHDLModel\" href=\"https://vhdl.github.io/pyVHDLModel\"><img height=\"80px\" src=\"doc/_static/logo.svg\"/></a>\n</p>\n\n[![Sourcecode on GitHub](https://img.shields.io/badge/VHDL-pyVHDLModel-29b6f6.svg?longCache=true&style=flat-square&logo=GitHub&labelColor=0277bd)](https://github.com/vhdl/pyVHDLModel)\n[![Sourcecode License](https://img.shields.io/pypi/l/pyVHDLModel?longCache=true&style=flat-square&logo=Apache&label=code)](LICENSE.md)\n[![Documentation](https://img.shields.io/website?longCache=true&style=flat-square&label=vhdl.github.io%2FpyVHDLModel&logo=GitHub&logoColor=fff&up_color=blueviolet&up_message=Read%20now%20%E2%9E%9A&url=https%3A%2F%2Fvhdl.github.io%2FpyVHDLModel%2Findex.html)](https://vhdl.github.io/pyVHDLModel/)\n[![Documentation License](https://img.shields.io/badge/doc-CC--BY%204.0-green?longCache=true&style=flat-square&logo=CreativeCommons&logoColor=fff)](LICENSE.md)\n[![Gitter](https://img.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef)](https://gitter.im/hdl/community) \n[![PyPI](https://img.shields.io/pypi/v/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072)](https://pypi.org/project/pyVHDLModel/)\n![PyPI - Status](https://img.shields.io/pypi/status/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyVHDLModel?longCache=true&style=flat-square&logo=PyPI&logoColor=FBE072) \n[![GitHub Workflow - Build and Test Status](https://img.shields.io/github/actions/workflow/status/vhdl/pyVHDLModel/Pipeline.yml?branch=main&longCache=true&style=flat-square&label=Build%20and%20test&logo=GitHub%20Actions&logoColor=FFFFFF)](https://github.com/VHDL/pyVHDLModel/actions/workflows/Pipeline.yml)\n[![Libraries.io status for latest release](https://img.shields.io/librariesio/release/pypi/pyVHDLModel?longCache=true&style=flat-square&logo=Libraries.io&logoColor=fff)](https://libraries.io/github/vhdl/pyVHDLModel)\n[![Codacy - Quality](https://img.shields.io/codacy/grade/2286426d2b11417e90010427b7fed8e7?longCache=true&style=flat-square&logo=Codacy)](https://www.codacy.com/gh/VHDL/pyVHDLModel)\n[![Codacy - Coverage](https://img.shields.io/codacy/coverage/2286426d2b11417e90010427b7fed8e7?longCache=true&style=flat-square&logo=Codacy)](https://www.codacy.com/gh/VHDL/pyVHDLModel)\n[![Codecov - Branch Coverage](https://img.shields.io/codecov/c/github/vhdl/pyVHDLModel?longCache=true&style=flat-square&logo=Codecov)](https://codecov.io/gh/vhdl/pyVHDLModel)\n\n<!--\n[![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/pypi/pyVHDLModel?longCache=true&style=flat-square&logo=GitHub)](https://github.com/vhdl/pyVHDLModel/network/dependents)\n[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyVHDLModel?longCache=true&style=flat-square)](https://libraries.io/github/vhdl/pyVHDLModel/sourcerank)\n-->\n\nAn abstract VHDL language model written in Python.\n\n\n# Main Goals\n\nThis package provides a unified abstract language model for VHDL.\nProjects reading from source files can derive own classes and implement additional logic to create a concrete language\nmodel for their tools.\n\nProjects consuming pre-processed VHDL data (parsed, analyzed or elaborated) can build higher level features and services\non such a model, while supporting multiple frontends.\n\n\n# Use Cases\n\n## pyVHDLModel Generators\n\n* High-level API for [GHDL's](https://GitHub.com/ghdl/ghdl) `libghdl` offered via `pyghdl`.\n* Code Document-Object-Model (Code-DOM) in [pyVHDLParser](https://GitHub.com/Paebbels/pyVHDLParser).\n\n## pyVHDLModel Consumers\n\n* Create graphical views of VHDL files or designs. \n\tPossible candidates: [Symbolator](https://GitHub.com/kevinpt/symbolator)\n* Created a (re)formatted output of VHDL.\n\n\n# Examples\n\n## List all Entities with Generics and Ports\n\nThe following tiny example is based on GHDL's [`pyGHDL.dom`](https://GitHub.com/ghdl/ghdl/tree/master/pyGHDL/dom) package implementing\npyVHDLModel.\n\n```python\nfrom pathlib import Path\nfrom pyGHDL.dom.NonStandard import Design, Document\n\nsourceFile = Path(\"example.vhdl\")\n\ndesign = Design()\nlibrary = design.GetLibrary(\"lib\")\ndocument = Document(sourceFile)\ndesign.AddDocument(document, library)\n\nfor entity in document.Entities.values():\n print(f\"{entity.Identifier}\")\n print(\" generics:\")\n for generic in entity.GenericItems:\n identifiers = \", \".join([str(i) for i in generic.Identifiers])\n print(f\" - {identifiers} : {generic.Mode!s} {generic.Subtype}\")\n print(\" ports:\")\n for port in entity.PortItems:\n identifiers = \", \".join([str(i) for i in port.Identifiers])\n print(f\" - {identifiers} : {port.Mode!s} {port.Subtype}\")\n```\n\n\n# Contributors\n\n* [Patrick Lehmann](https://GitHub.com/Paebbels) (Maintainer)\n* [Unai Martinez-Corral](https://GitHub.com/umarcor)\n* [and more...](https://GitHub.com/VHDL/pyVHDLModel/graphs/contributors)\n\n\n# License\n\nThis Python package (source code) licensed under [Apache License 2.0](LICENSE.md). \nThe accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst).\n\n-------------------------\nSPDX-License-Identifier: Apache-2.0\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "An abstract VHDL language model.",
"version": "0.29.2",
"project_urls": {
"Documentation": "https://VHDL.GitHub.io/pyVHDLModel",
"Homepage": "https://GitHub.com/VHDL/pyVHDLModel",
"Issue Tracker": "https://GitHub.com/VHDL/pyVHDLModel/issues",
"Source Code": "https://GitHub.com/VHDL/pyVHDLModel"
},
"split_keywords": [
"python3",
"vhdl",
"language",
"model",
"abstract"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ac4c6ea159e25311b497c2f66866270182f376673e36259e1e53b8f494cc186f",
"md5": "016a05c1b18e5fd1c7222504df7ddf8d",
"sha256": "b509370ebaf470dd8309985ce534c06cf0b1ea08d45d9a47158d01387a744382"
},
"downloads": -1,
"filename": "pyVHDLModel-0.29.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "016a05c1b18e5fd1c7222504df7ddf8d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 79182,
"upload_time": "2024-11-10T23:48:58",
"upload_time_iso_8601": "2024-11-10T23:48:58.718264Z",
"url": "https://files.pythonhosted.org/packages/ac/4c/6ea159e25311b497c2f66866270182f376673e36259e1e53b8f494cc186f/pyVHDLModel-0.29.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "24bd83b9b74d313276c6af965f99788093fed7b0124cf0bf43c8da022de8ee40",
"md5": "efe2244d732aa4d3ca026119760474c9",
"sha256": "d8fa1cb089d3b8c9008e5d8a858b12258bbd7a93d103b92dfbaa838c815af595"
},
"downloads": -1,
"filename": "pyvhdlmodel-0.29.2.tar.gz",
"has_sig": false,
"md5_digest": "efe2244d732aa4d3ca026119760474c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 59577,
"upload_time": "2024-11-10T23:48:56",
"upload_time_iso_8601": "2024-11-10T23:48:56.637701Z",
"url": "https://files.pythonhosted.org/packages/24/bd/83b9b74d313276c6af965f99788093fed7b0124cf0bf43c8da022de8ee40/pyvhdlmodel-0.29.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-10 23:48:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyvhdlmodel"
}