Reply To: Using VCs without the built-in Scripts – but instead VUnit

Why OSVVM™? Forums OSVVM Using VCs without the built-in Scripts – but instead VUnit Reply To: Using VCs without the built-in Scripts – but instead VUnit

#2721
Patrick
Member

Hi Isaac,

a few weeks ago, I release pyEDAA.OSVVM as part of the bigger EDA² Python package family. It provides a OSVVM *.pro file processor as well as data models and parsers for OSVVM’s YAML (and XML) file formats.

Repository: https://github.com/edaa-org/pyEDAA.OSVVM
Documentation: https://edaa-org.github.io/pyEDAA.OSVVM

from pathlib import Path
from pyEDAA.OSVVM.TCL import OsvvmProFileProcessor
processor = OsvvmProFileProcessor()
processor.LoadBuildFile(Path("OSVVM/OSVVMLibraries/OsvvmLibraries.pro"))
processor.LoadBuildFile(Path("OSVVM/OSVVMLibraries/RunAllTests.pro"))
project = processor.Context.ToProject("OsvvmLibraries")
for buildName, build in project.Builds.items():
for libraryName, lib in build.Libraries.items():
vunitLibrary = vu.add_library(libraryName, ...)
vunitLibrary.add_source_files(file.Path for file in lib.Files)`

This processes 2 OSVVM pro files and then it iterates the builds and then within each build the used libraries. Then a generator expression is used to create an iterable for VUnits add_source_files method.

If you have questions, we can continue here or ask questions via issues at GitHub.

Kind regards
Patrick Lehmann