<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/9d/b3/c161270ccaddcf8bb571a6bf8b3a2cace491199d45687ed7807b9e9fcafa/pyvhdlmodel-0.29.1.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.1",
"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": "ead7294667c5f6520e1c2bfc936f05a08d58d76d3fa75878107e7d238c3aca2b",
"md5": "eda61d793d6a8c4aa195ffc0f43a9ebb",
"sha256": "1f0c77e3ce2c96b40419ad9add881362b39665ad54778d9571ea314d3b594d79"
},
"downloads": -1,
"filename": "pyVHDLModel-0.29.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eda61d793d6a8c4aa195ffc0f43a9ebb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 79180,
"upload_time": "2024-11-03T20:08:12",
"upload_time_iso_8601": "2024-11-03T20:08:12.690867Z",
"url": "https://files.pythonhosted.org/packages/ea/d7/294667c5f6520e1c2bfc936f05a08d58d76d3fa75878107e7d238c3aca2b/pyVHDLModel-0.29.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9db3c161270ccaddcf8bb571a6bf8b3a2cace491199d45687ed7807b9e9fcafa",
"md5": "10836ef22f7dc474d5ee77177c81961c",
"sha256": "bb65df8a0dd4a0948fdf0aa9747a8a1e03ca62dfdf386096c65b0c7bb2cca2ba"
},
"downloads": -1,
"filename": "pyvhdlmodel-0.29.1.tar.gz",
"has_sig": false,
"md5_digest": "10836ef22f7dc474d5ee77177c81961c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 59549,
"upload_time": "2024-11-03T20:08:10",
"upload_time_iso_8601": "2024-11-03T20:08:10.443644Z",
"url": "https://files.pythonhosted.org/packages/9d/b3/c161270ccaddcf8bb571a6bf8b3a2cace491199d45687ed7807b9e9fcafa/pyvhdlmodel-0.29.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-03 20:08:10",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyvhdlmodel"
}