OSVVM Project Filesο
Design Goals
Clearly named classes that model the semantics of an OSVVM project.
The OSVVM project model instance can be constructed top-down and bottom-up.
Child objects shall have a reference to their parent.
Referenced files and directories in a
*.pro
file are checked for existence when parsing the input file.
Features
OSVVM specific variables (
::osvvm::...
) can be configured before parsing to
Data Modelο
An OSVVM project can be summarized as follows:
An OSVVM Project contains one or multiple builds (a
*.pro
file loaded via build command).Each build can contain multiple VHDL libraries as well as multiple testsuites.
Each VHDL library references multiple VHDL source files in compile order.
Again, each testsuite contains multiple testcases in execution order.
graph TD; P[Project<br/>"OSVVM"]:::clsPrj-->B1[Build<br/>"OsvvmLibraries"]:::clsBld P -->B2[Build<br/>"RunAllTests"]:::clsBld B1 -->Lib1[VHDLLibrary<br/>"osvvm"]:::clsLib B1 -->Lib2[VHDLLibrary<br/>"osccm_common"]:::clsLib Lib1-->F1[VHDLSourceFile<br/>"file1.vhdl"]:::clsFile Lib1-->F2[VHDLSourceFile<br/>"file2.vhdl"]:::clsFile Lib2-->F3[VHDLSourceFile<br/>"file3.vhdl"]:::clsFile Lib2-->F4[VHDLSourceFile<br/>"file4.vhdl"]:::clsFile B2 -->Lib4[VHDLLibrary<br/>"osvvm_uart"]:::clsLib Lib4-->F7[VHDLSourceFile<br/>"file7.vhdl"]:::clsFile Lib4-->F8[VHDLSourceFile<br/>"file8.vhdl"]:::clsFile B2 -->TS1[Testsuite<br/>"UART"]:::clsTS B2 -->TS2[Testsuite<br/>"AXI4_Lite"]:::clsTS TS1 -->TC1[Testcase<br/>"SendGet"]:::clsTC TS1 -->TC2[Testcase<br/>"SetOption"]:::clsTC TS2 -->TC3[Testcase<br/>"ReadWrite"]:::clsTC TS2 -->TC4[Testcase<br/>"SetOption"]:::clsTC classDef clsPrj fill:#bf80ff classDef clsBld fill:#9f9fdf classDef clsLib fill:#ffdf80 classDef clsFile fill:#d5ff80 classDef clsTS fill:#8080ff classDef clsTC fill:#80ff80
OSVVM Projectο
A OSVVM project
Todo
Data model: OSVVM Project
To be documented.
@export
class Project(Named[None]):
_builds: Dict[str, Build]
def __init__(self,
name: str, builds: Nullable[Iterable[Build] | Mapping[str, Build]] = None
) -> None:
...
@readonly
def Builds(self) -> Dict[str, Build]:
...
def AddBuild(self, build: Build) -> None:
...
def __repr__(self) -> str:
...
Buildο
Todo
Data model: Build
To be documented.
@export
class Build(Named["Project"]):
_vhdlLibraries: Dict[str, VHDLLibrary]
_testsuites: Dict[str, Testsuite]
def __init__(self,
name: str,
vhdlLibraries: Nullable[Iterable[VHDLLibrary] | Mapping[str, VHDLLibrary]] = None,
testsuites: Nullable[Iterable[Testsuite] | Mapping[str, Testsuite]] = None,
project: Nullable[Base] = None
) -> None:
...
@readonly
def Project(self) -> Nullable["Project"]:
...
@readonly
def VHDLLibraries(self) -> Dict[str, Testsuite]:
...
@readonly
def Testsuites(self) -> Dict[str, Testsuite]:
...
def AddVHDLLibrary(self, vhdlLibrary: VHDLLibrary) -> None:
...
def AddTestsuite(self, testsuite: Testsuite) -> None:
...
def __repr__(self) -> str:
...
VHDLLibraryο
Todo
Data model: VHDL Library
To be documented.
@export
class VHDLLibrary(Named["Build"]):
_files: List[VHDLSourceFile]
def __init__(self,
name: str,
vhdlFiles: Nullable[Iterable[VHDLSourceFile]] = None,
build: Nullable["Build"] = None
) -> None:
...
@readonly
def Build(self) -> Nullable["Build"]:
...
@readonly
def Files(self) -> List[SourceFile]:
...
def AddFile(self, file: VHDLSourceFile) -> None:
...
def __repr__(self) -> str:
...
VHDLSourceFileο
Todo
Data model: VHDL source file
To be documented.
@export
class VHDLSourceFile(SourceFile["VHDLLibrary"]):
_vhdlVersion: VHDLVersion
def __init__(self,
path: Path,
vhdlVersion: VHDLVersion = VHDLVersion.VHDL2008,
vhdlLibrary: Nullable["VHDLLibrary"] = None
):
...
@readonly
def VHDLLibrary(self) -> Nullable["VHDLLibrary"]:
...
@property
def VHDLVersion(self) -> VHDLVersion:
...
@VHDLVersion.setter
def VHDLVersion(self, value: VHDLVersion) -> None:
...
def __repr__(self) -> str:
...
Testsuiteο
Todo
Data model: Testsuite
To be documented.
@export
class Testsuite(Named["Build"]):
_testcases: Dict[str, Testcase]
def __init__(self,
name: str,
testcases: Nullable[Iterable[Testcase] | Mapping[str, Testcase]] = None,
build: Nullable["Build"] = None
) -> None:
...
@readonly
def Build(self) -> Nullable["Build"]:
...
@readonly
def Testcases(self) -> Dict[str, Testcase]:
...
def AddTestcase(self, testcase: Testcase) -> None:
...
def __repr__(self) -> str:
...
Testcaseο
Todo
Data model: Testcase
To be documented.
@export
class Testcase(Named["Testsuite"]):
_toplevelName: Nullable[str]
_generics: Dict[str, str]
def __init__(self,
name: str,
toplevelName: Nullable[str] = None,
generics: Nullable[Iterable[GenericValue] | Mapping[str, str]] = None,
testsuite: Nullable["Testsuite"] = None
) -> None:
...
@readonly
def Testsuite(self) -> "Testsuite":
...
@readonly
def ToplevelName(self) -> str:
...
@readonly
def Generics(self) -> Dict[str, str]:
...
def SetToplevel(self, toplevelName: str) -> None:
...
def AddGeneric(self, genericValue: GenericValue):
...
def __repr__(self) -> str:
...
Implemented TCL Proceduresο
The following TCL procedures are implemented as Python functions
and registered to TCL,
thus they can be called from TCL code. This allows pyEDAA.OSVVM to capture parameters handed over these procedures. The
gathered parameters are then collected in a context object and assembled to a Data Model.
buildο
pyEDAA.OSVVM.Procedures.build()
references a *.pro
file, which is then loaded and processed. The
contextβs current path is changed to the parent directory of the referenced file. The referenced file is added to
the list of included files collected by the context.
The reference can refer to:
an explicitly named
<path>/*.pro
file,an implicitly named
<path>/build.pro
file,an implicitly named
<path>/<path>.pro
file.
Each build will create a separate set of reports.
# TCL code examples
build ref/MyLibrary.pro ; # explicit pro file
build ref/build.pro ; # implicit build.pro file
build ref/ref.pro ; # implicit <ref>.pro file
includeο
pyEDAA.OSVVM.Procedures.include()
references a *.pro
file, which is then loaded and processed. The
contextβs current path is changed to the parent directory of the referenced file. The referenced file is added
to the list of included files collected by the context.
The reference can refer to:
an explicitly named
<path>/*.pro
file,an implicitly named
<path>/build.pro
file,an implicitly named
<path>/<path>.pro
file.
Each build will create a separate set of reports.
# TCL code examples
include ref/MyLibrary.pro ; # explicit pro file
include ref/build.pro ; # implicit build.pro file
include ref/ref.pro ; # implicit <ref>.pro file
libraryο
pyEDAA.OSVVM.Procedures.library()
# TCL code examples
library myDesign
analyzeο
pyEDAA.OSVVM.Procedures.analyze()
# TCL code examples
analyze src/TopLevel.vhdl
simulateο
pyEDAA.OSVVM.Procedures.simulate()
# TCL code examples
simulate myTestbench
genericο
pyEDAA.OSVVM.Procedures.generic()
# TCL code examples
simulate myTestharness [generic param value]
TestSuiteο
pyEDAA.OSVVM.Procedures.TestSuite()
# TCL code examples
TestSuite AllMyTests
TestNameο
pyEDAA.OSVVM.Procedures.TestName()
# TCL code examples
TestName myTest
RunTestο
pyEDAA.OSVVM.Procedures.RunTest()
# TCL code examples
RunTest testharness.vhdl [generic param value]
LinkLibraryο
pyEDAA.OSVVM.Procedures.LinkLibrary()
# TCL code examples
LinkLibrary vendorLib ../libs/vendorLib
LinkLibraryDirectoryο
pyEDAA.OSVVM.Procedures.LinkLibraryDirectory()
# TCL code examples
LinkLibraryDirectory ../lib
SetVHDLVersion / SetVHDLVersionο
pyEDAA.OSVVM.Procedures.SetVHDLVersion()
pyEDAA.OSVVM.Procedures.GetVHDLVersion()
# TCL code examples
SetVHDLVersion 2019
FileExistsο
DirectoryExistsο
ChangeWorkingDirectoryο
OSVVM Processing Contextο
Todo
Context
To be documented.
@export
class Context(Base):
_tcl: TclEnvironment
_lastException: Exception
_workingDirectory: Path
_currentDirectory: Path
_includedFiles: List[Path]
_vhdlversion: VHDLVersion
_libraries: Dict[str, VHDLLibrary]
_library: Nullable[VHDLLibrary]
_testsuites: Dict[str, Testsuite]
_testsuite: Nullable[Testsuite]
_testcase: Nullable[Testcase]
_options: Dict[int, GenericValue]
_builds: Dict[str, Build]
_build: Nullable[Build]
def __init__(self) -> None:
...
def Clear(self) -> None:
...
@readonly
def Processor(self) -> "Tk":
...
@property
def LastException(self) -> Exception:
...
@readonly
def WorkingDirectory(self) -> Path:
...
@readonly
def CurrentDirectory(self) -> Path:
...
@property
def VHDLVersion(self) -> VHDLVersion:
...
@readonly
def IncludedFiles(self) -> List[Path]:
...
@readonly
def VHDLLibraries(self) -> Dict[str, VHDLLibrary]:
...
@readonly
def VHDLLibrary(self) -> VHDLLibrary:
...
@readonly
def Testsuites(self) -> Dict[str, Testsuite]:
...
@readonly
def Testsuite(self) -> Testsuite:
...
@readonly
def TestCase(self) -> Testcase:
...
@readonly
def Build(self) -> Build:
...
@readonly
def Builds(self) -> Dict[str, Build]:
...
def StartBuild(self, buildName: str):
...
def IncludeFile(self, proFileOrBuildDirectory: Path) -> Path:
...
def EvaluateFile(self, proFile: Path) -> None:
...
def SetLibrary(self, name: str):
...
def AddVHDLFile(self, vhdlFile: VHDLSourceFile) -> None:
...
def SetTestsuite(self, testsuiteName: str):
...
def AddTestcase(self, testName: str) -> TestCase:
...
def SetTestcaseToplevel(self, toplevel: str) -> TestCase:
...
def AddOption(self, genericValue: GenericValue):
...
OSVVM pro
-File Processorο
OSVVM Variablesο
Todo
OsvvmProFileProcessor
To be documented.
@export
class OsvvmVariables:
_vhdlVersion: VHDLVersion
_toolVendor: str
_toolName: str
_toolVersion: str
def __init__(self,
vhdlVersion: Nullable[VHDLVersion] = None,
toolVendor: Nullable[str] = None,
toolName: Nullable[str] = None,
toolVersion: Nullable[str] = None
) -> None:
...
@readonly
def VHDlversion(self) -> VHDLVersion:
...
@readonly
def ToolVendor(self) -> str:
...
@readonly
def ToolName(self) -> str:
...
@readonly
def ToolVersion(self) -> str:
...
OSVVM pro
-File Processorο
Todo
OsvvmProFileProcessor
To be documented.
@export
class OsvvmProFileProcessor(TclEnvironment):
def __init__(self,
context: Nullable[Context] = None,
osvvmVariables: Nullable[OsvvmVariables] = None
) -> None:
...
def LoadOsvvmDefaults(self, osvvmVariables: OsvvmVariables) -> None:
...