edaa-org / pyEDAA.ProjectModel

An abstract model of EDA tool projects.
https://edaa-org.github.io/pyEDAA.ProjectModel
Other
10 stars 1 forks source link
abstract abstraction eda edaa model project python verilog vhdl

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

Main Goals

This package provides a unified abstract project model for HDL designs and EDA tools. Third-party frameworks can derive own classes and implement additional logic to create a concrete project model for their tools.

Frameworks consuming this model can build higher level features and services on top of such a model, while supporting multiple input sources.

Data Model

  1. The toplevel element is a Project, which contains one or multiple designs.
  2. A Design is a variant of a project and contains filesets.
  3. A FileSet contains files or further sub-filesets.
  4. A File represents a single file. E.g. source files, configuration files, constraint files.
  5. A VHDLLibrary represents a group of VHDLSourceFiles being compiled into the same VHDL library.

img.png

Features

Project File Readers

OSVVM *.pro File Reader

ProjectModel can read *.pro files and extract source files. Included *.pro files are represented as sub-filesets.

Xilinx Vivado *.xpr Reader

ProjectModel can read *.xpr files and extract source, constraint and simulation files while preserving the fileset structure.

Use Cases

Examples

from pathlib import Path
from pyEDAA.ProjectModel import Project, Design, FileSet, VHDLSourceFile

print(f"Current working directory: {Path.cwd()}")
projectDirectory = Path.cwd() / "../project"
print(f"Project directory: {projectDirectory!s} - {projectDirectory.exists()}")

project = Project("myProject", rootDirectory=projectDirectory)
designA = Design("designA", project=project, directory=Path("designA"))
designAFileset = FileSet("srcA", design=designA)
for vhdlFilePath in designAFileset.ResolvedPath.glob("*.vhdl"):
    designAFileset.AddFile(VHDLSourceFile(vhdlFilePath))

libFileset = FileSet("lib", Path("../lib"), design=designA)
for vhdlFilePath in libFileset.ResolvedPath.glob("*.vhdl"):
    libFileset.AddFile(VHDLSourceFile(vhdlFilePath))

print(f"All VHDL files in {designA.Name}:")
for file in designA.Files(fileType=VHDLSourceFile):
    print(f"  {file.Path}")

Consumers

This layer is used by:

References

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