pyEDAA.OSVVM 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyEDAA/OSVVM/Environment.py +378 -0
- pyEDAA/OSVVM/Procedures.py +200 -0
- pyEDAA/OSVVM/Tcl.py +202 -0
- pyEDAA/OSVVM/__init__.py +45 -0
- pyedaa_osvvm-0.1.0.dist-info/LICENSE.md +82 -0
- pyedaa_osvvm-0.1.0.dist-info/METADATA +148 -0
- pyedaa_osvvm-0.1.0.dist-info/RECORD +9 -0
- pyedaa_osvvm-0.1.0.dist-info/WHEEL +5 -0
- pyedaa_osvvm-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
# ==================================================================================================================== #
|
|
2
|
+
# _____ ____ _ _ ___ ______ ____ ____ __ #
|
|
3
|
+
# _ __ _ _| ____| _ \ / \ / \ / _ \/ ___\ \ / /\ \ / / \/ | #
|
|
4
|
+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | | \___ \\ \ / / \ \ / /| |\/| | #
|
|
5
|
+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ | |_| |___) |\ V / \ V / | | | | #
|
|
6
|
+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)___/|____/ \_/ \_/ |_| |_| #
|
|
7
|
+
# |_| |___/ #
|
|
8
|
+
# ==================================================================================================================== #
|
|
9
|
+
# Authors: #
|
|
10
|
+
# Patrick Lehmann #
|
|
11
|
+
# #
|
|
12
|
+
# License: #
|
|
13
|
+
# ==================================================================================================================== #
|
|
14
|
+
# Copyright 2025-2025 Patrick Lehmann - Boetzingen, Germany #
|
|
15
|
+
# #
|
|
16
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
|
17
|
+
# you may not use this file except in compliance with the License. #
|
|
18
|
+
# You may obtain a copy of the License at #
|
|
19
|
+
# #
|
|
20
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
21
|
+
# #
|
|
22
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
23
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
24
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
25
|
+
# See the License for the specific language governing permissions and #
|
|
26
|
+
# limitations under the License. #
|
|
27
|
+
# #
|
|
28
|
+
# SPDX-License-Identifier: Apache-2.0 #
|
|
29
|
+
# ==================================================================================================================== #
|
|
30
|
+
#
|
|
31
|
+
from pathlib import Path
|
|
32
|
+
from typing import Optional as Nullable, List, Dict
|
|
33
|
+
|
|
34
|
+
from pyTooling.Decorators import readonly, export
|
|
35
|
+
from pyTooling.MetaClasses import ExtendedType
|
|
36
|
+
from pyVHDLModel import VHDLVersion
|
|
37
|
+
|
|
38
|
+
from pyEDAA.OSVVM import OSVVMException
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
__all__ = ["osvvmContext"]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@export
|
|
45
|
+
class Base(metaclass=ExtendedType):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@export
|
|
50
|
+
class SourceFile(Base):
|
|
51
|
+
"""A base-class describing any source file (VHDL, Verilog, ...) supported by OSVVM Scripts."""
|
|
52
|
+
|
|
53
|
+
_path: Path
|
|
54
|
+
|
|
55
|
+
def __init__(self, path: Path) -> None:
|
|
56
|
+
self._path = path
|
|
57
|
+
|
|
58
|
+
@readonly
|
|
59
|
+
def Path(self) -> Path:
|
|
60
|
+
return self._path
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@export
|
|
64
|
+
class VHDLSourceFile(SourceFile):
|
|
65
|
+
_vhdlVersion: VHDLVersion
|
|
66
|
+
|
|
67
|
+
def __init__(self, path: Path, vhdlVersion: Nullable[VHDLVersion] = None):
|
|
68
|
+
super().__init__(path)
|
|
69
|
+
|
|
70
|
+
self._vhdlVersion = vhdlVersion
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def VHDLVersion(self) -> VHDLVersion:
|
|
74
|
+
return self._vhdlVersion
|
|
75
|
+
|
|
76
|
+
@VHDLVersion.setter
|
|
77
|
+
def VHDLVersion(self, value: VHDLVersion) -> None:
|
|
78
|
+
self._vhdlVersion = value
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@export
|
|
82
|
+
class Library(Base):
|
|
83
|
+
"""A VHDL library collecting multiple VHDL files containing VHDL design units."""
|
|
84
|
+
|
|
85
|
+
_name: str
|
|
86
|
+
_files: List[VHDLSourceFile]
|
|
87
|
+
|
|
88
|
+
def __init__(self, name: str) -> None:
|
|
89
|
+
self._name = name
|
|
90
|
+
self._files = []
|
|
91
|
+
|
|
92
|
+
@readonly
|
|
93
|
+
def Name(self) -> str:
|
|
94
|
+
return self._name
|
|
95
|
+
|
|
96
|
+
@readonly
|
|
97
|
+
def Files(self) -> List[SourceFile]:
|
|
98
|
+
return self._files
|
|
99
|
+
|
|
100
|
+
def AddFile(self, file: VHDLSourceFile) -> None:
|
|
101
|
+
self._files.append(file)
|
|
102
|
+
|
|
103
|
+
def __repr__(self) -> str:
|
|
104
|
+
return f"VHDLLibrary: {self._name}"
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@export
|
|
108
|
+
class GenericValue(Base):
|
|
109
|
+
_name: str
|
|
110
|
+
_value: str
|
|
111
|
+
|
|
112
|
+
def __init__(self, name: str, value: str) -> None:
|
|
113
|
+
self._name = name
|
|
114
|
+
self._value = value
|
|
115
|
+
|
|
116
|
+
@readonly
|
|
117
|
+
def Name(self) -> str:
|
|
118
|
+
return self._name
|
|
119
|
+
|
|
120
|
+
@readonly
|
|
121
|
+
def Value(self) -> str:
|
|
122
|
+
return self._value
|
|
123
|
+
|
|
124
|
+
def __repr__(self) -> str:
|
|
125
|
+
return f"{self._name} = {self._value}"
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@export
|
|
129
|
+
class Testcase(Base):
|
|
130
|
+
_name: str
|
|
131
|
+
_toplevelName: Nullable[str]
|
|
132
|
+
_generics: Dict[str, str]
|
|
133
|
+
|
|
134
|
+
def __init__(self, name: str) -> None:
|
|
135
|
+
self._name = name
|
|
136
|
+
self._toplevelName = None
|
|
137
|
+
self._generics = {}
|
|
138
|
+
|
|
139
|
+
@readonly
|
|
140
|
+
def Name(self) -> str:
|
|
141
|
+
return self._name
|
|
142
|
+
|
|
143
|
+
@readonly
|
|
144
|
+
def ToplevelName(self) -> str:
|
|
145
|
+
return self._toplevelName
|
|
146
|
+
|
|
147
|
+
@readonly
|
|
148
|
+
def Generics(self) -> Dict[str, str]:
|
|
149
|
+
return self._generics
|
|
150
|
+
|
|
151
|
+
def SetToplevel(self, toplevelName: str) -> None:
|
|
152
|
+
self._toplevelName = toplevelName
|
|
153
|
+
|
|
154
|
+
def AddGeneric(self, genericValue: GenericValue):
|
|
155
|
+
self._generics[genericValue._name] = genericValue._value
|
|
156
|
+
|
|
157
|
+
def __repr__(self) -> str:
|
|
158
|
+
return f"Testcase: {self._name} - [{', '.join([f'{n}={v}' for n,v in self._generics.items()])}]"
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
@export
|
|
162
|
+
class Testsuite(Base):
|
|
163
|
+
_name: str
|
|
164
|
+
_testcases: Dict[str, Testcase]
|
|
165
|
+
|
|
166
|
+
def __init__(self, name: str) -> None:
|
|
167
|
+
self._name = name
|
|
168
|
+
self._testcases = {}
|
|
169
|
+
|
|
170
|
+
@readonly
|
|
171
|
+
def Name(self) -> str:
|
|
172
|
+
return self._name
|
|
173
|
+
|
|
174
|
+
@readonly
|
|
175
|
+
def Testcases(self) -> Dict[str, Testcase]:
|
|
176
|
+
return self._testcases
|
|
177
|
+
|
|
178
|
+
def AddTestcase(self, testcase: Testcase) -> None:
|
|
179
|
+
self._testcases[testcase._name] = testcase
|
|
180
|
+
|
|
181
|
+
def __repr__(self) -> str:
|
|
182
|
+
return f"Testsuite: {self._name}"
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
@export
|
|
186
|
+
class Context(Base):
|
|
187
|
+
# _tcl: TclEnvironment
|
|
188
|
+
|
|
189
|
+
_lastException: Exception
|
|
190
|
+
|
|
191
|
+
_workingDirectory: Path
|
|
192
|
+
_currentDirectory: Path
|
|
193
|
+
_includedFiles: List[Path]
|
|
194
|
+
|
|
195
|
+
_vhdlversion: VHDLVersion
|
|
196
|
+
|
|
197
|
+
_libraries: Dict[str, Library]
|
|
198
|
+
_library: Nullable[Library]
|
|
199
|
+
|
|
200
|
+
_testsuites: Dict[str, Testsuite]
|
|
201
|
+
_testsuite: Nullable[Testsuite]
|
|
202
|
+
_testcase: Nullable[Testcase]
|
|
203
|
+
_options: Dict[int, GenericValue]
|
|
204
|
+
|
|
205
|
+
def __init__(self) -> None:
|
|
206
|
+
self._processor = None
|
|
207
|
+
self._lastException = None
|
|
208
|
+
|
|
209
|
+
self._workingDirectory = Path.cwd()
|
|
210
|
+
self._currentDirectory = self._workingDirectory
|
|
211
|
+
self._includedFiles = []
|
|
212
|
+
|
|
213
|
+
self._vhdlversion = VHDLVersion.VHDL2008
|
|
214
|
+
|
|
215
|
+
self._library = None
|
|
216
|
+
self._libraries = {}
|
|
217
|
+
|
|
218
|
+
self._testcase = None
|
|
219
|
+
self._testsuite = None
|
|
220
|
+
self._testsuites = {}
|
|
221
|
+
self._options = {}
|
|
222
|
+
|
|
223
|
+
def Clear(self) -> None:
|
|
224
|
+
self._processor = None
|
|
225
|
+
self._lastException = None
|
|
226
|
+
|
|
227
|
+
self._workingDirectory = Path.cwd()
|
|
228
|
+
self._currentDirectory = self._workingDirectory
|
|
229
|
+
self._includedFiles = []
|
|
230
|
+
|
|
231
|
+
self._vhdlversion = VHDLVersion.VHDL2008
|
|
232
|
+
|
|
233
|
+
self._library = None
|
|
234
|
+
self._libraries = {}
|
|
235
|
+
|
|
236
|
+
self._testcase = None
|
|
237
|
+
self._testsuite = None
|
|
238
|
+
self._testsuites = {}
|
|
239
|
+
self._options = {}
|
|
240
|
+
|
|
241
|
+
@readonly
|
|
242
|
+
def Processor(self): # -> "Tk":
|
|
243
|
+
return self._processor
|
|
244
|
+
|
|
245
|
+
@property
|
|
246
|
+
def LastException(self) -> Exception:
|
|
247
|
+
lastException = self._lastException
|
|
248
|
+
self._lastException = None
|
|
249
|
+
return lastException
|
|
250
|
+
|
|
251
|
+
@LastException.setter
|
|
252
|
+
def LastException(self, value: Exception) -> None:
|
|
253
|
+
self._lastException = value
|
|
254
|
+
|
|
255
|
+
@readonly
|
|
256
|
+
def WorkingDirectory(self) -> Path:
|
|
257
|
+
return self._workingDirectory
|
|
258
|
+
|
|
259
|
+
@readonly
|
|
260
|
+
def CurrentDirectory(self) -> Path:
|
|
261
|
+
return self._currentDirectory
|
|
262
|
+
|
|
263
|
+
@property
|
|
264
|
+
def VHDLVersion(self) -> VHDLVersion:
|
|
265
|
+
return self._vhdlversion
|
|
266
|
+
|
|
267
|
+
@VHDLVersion.setter
|
|
268
|
+
def VHDLVersion(self, value: VHDLVersion) -> None:
|
|
269
|
+
self._vhdlversion = value
|
|
270
|
+
|
|
271
|
+
@readonly
|
|
272
|
+
def IncludedFiles(self) -> List[Path]:
|
|
273
|
+
return self._includedFiles
|
|
274
|
+
|
|
275
|
+
@readonly
|
|
276
|
+
def Libraries(self) -> Dict[str, Library]:
|
|
277
|
+
return self._libraries
|
|
278
|
+
|
|
279
|
+
@readonly
|
|
280
|
+
def Library(self) -> Library:
|
|
281
|
+
return self._library
|
|
282
|
+
|
|
283
|
+
@readonly
|
|
284
|
+
def Testsuites(self) -> Dict[str, Testsuite]:
|
|
285
|
+
return self._testsuites
|
|
286
|
+
|
|
287
|
+
@readonly
|
|
288
|
+
def Testsuite(self) -> Testsuite:
|
|
289
|
+
return self._testsuite
|
|
290
|
+
|
|
291
|
+
@readonly
|
|
292
|
+
def TestCase(self) -> Testcase:
|
|
293
|
+
return self._testcase
|
|
294
|
+
|
|
295
|
+
def IncludeFile(self, proFileOrBuildDirectory: Path) -> Path:
|
|
296
|
+
if proFileOrBuildDirectory.is_absolute():
|
|
297
|
+
ex = OSVVMException(f"Absolute path '{proFileOrBuildDirectory}' not supported.")
|
|
298
|
+
self._lastException = ex
|
|
299
|
+
raise ex
|
|
300
|
+
|
|
301
|
+
path = (self._currentDirectory / proFileOrBuildDirectory).resolve()
|
|
302
|
+
if path.is_file():
|
|
303
|
+
if path.suffix == ".pro":
|
|
304
|
+
self._currentDirectory = path.parent.relative_to(self._workingDirectory, walk_up=True)
|
|
305
|
+
proFile = self._currentDirectory / path.name
|
|
306
|
+
else:
|
|
307
|
+
ex = OSVVMException(f"Path '{proFileOrBuildDirectory}' is not a *.pro file.")
|
|
308
|
+
self._lastException = ex
|
|
309
|
+
raise ex
|
|
310
|
+
elif path.is_dir():
|
|
311
|
+
self._currentDirectory = path
|
|
312
|
+
proFile = path / "build.pro"
|
|
313
|
+
if not proFile.exists():
|
|
314
|
+
proFile = path / f"{path.name}.pro"
|
|
315
|
+
if not proFile.exists():
|
|
316
|
+
ex = OSVVMException(f"Path '{proFileOrBuildDirectory}' is not a build directory.")
|
|
317
|
+
ex.__cause__ = FileNotFoundError(path / "build.pro")
|
|
318
|
+
self._lastException = ex
|
|
319
|
+
raise ex
|
|
320
|
+
else:
|
|
321
|
+
ex = OSVVMException(f"Path '{proFileOrBuildDirectory}' is not a *.pro file or build directory.")
|
|
322
|
+
self._lastException = ex
|
|
323
|
+
raise ex
|
|
324
|
+
|
|
325
|
+
self._includedFiles.append(proFile)
|
|
326
|
+
return proFile
|
|
327
|
+
|
|
328
|
+
def EvaluateFile(self, proFile: Path) -> None:
|
|
329
|
+
self._processor.EvaluateProFile(proFile)
|
|
330
|
+
|
|
331
|
+
def SetLibrary(self, name: str):
|
|
332
|
+
try:
|
|
333
|
+
self._library = self._libraries[name]
|
|
334
|
+
except KeyError:
|
|
335
|
+
self._library = Library(name)
|
|
336
|
+
self._libraries[name] = self._library
|
|
337
|
+
|
|
338
|
+
def AddVHDLFile(self, vhdlFile: VHDLSourceFile) -> None:
|
|
339
|
+
if self._library is None:
|
|
340
|
+
self.SetLibrary("default")
|
|
341
|
+
|
|
342
|
+
vhdlFile.VHDLVersion = self._vhdlversion
|
|
343
|
+
self._library.AddFile(vhdlFile)
|
|
344
|
+
|
|
345
|
+
def SetTestsuite(self, testsuiteName: str):
|
|
346
|
+
try:
|
|
347
|
+
self._testsuite = self._testsuites[testsuiteName]
|
|
348
|
+
except KeyError:
|
|
349
|
+
self._testsuite = Testsuite(testsuiteName)
|
|
350
|
+
self._testsuites[testsuiteName] = self._testsuite
|
|
351
|
+
|
|
352
|
+
def AddTestcase(self, testName: str) -> TestCase:
|
|
353
|
+
if self._testsuite is None:
|
|
354
|
+
self.SetTestsuite("default")
|
|
355
|
+
|
|
356
|
+
self._testcase = Testcase(testName)
|
|
357
|
+
self._testsuite._testcases[testName] = self._testcase
|
|
358
|
+
|
|
359
|
+
return self._testcase
|
|
360
|
+
|
|
361
|
+
def SetTestcaseToplevel(self, toplevel: str) -> TestCase:
|
|
362
|
+
if self._testcase is None:
|
|
363
|
+
ex = OSVVMException("Can't set testcase toplevel, because no testcase setup.")
|
|
364
|
+
self._lastException = ex
|
|
365
|
+
raise ex
|
|
366
|
+
|
|
367
|
+
self._testcase.SetToplevel(toplevel)
|
|
368
|
+
|
|
369
|
+
return self._testcase
|
|
370
|
+
|
|
371
|
+
def AddOption(self, genericValue: GenericValue):
|
|
372
|
+
optionID = id(genericValue)
|
|
373
|
+
self._options[optionID] = genericValue
|
|
374
|
+
|
|
375
|
+
return optionID
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
osvvmContext: Context = Context()
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# ==================================================================================================================== #
|
|
2
|
+
# _____ ____ _ _ ___ ______ ____ ____ __ #
|
|
3
|
+
# _ __ _ _| ____| _ \ / \ / \ / _ \/ ___\ \ / /\ \ / / \/ | #
|
|
4
|
+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | | \___ \\ \ / / \ \ / /| |\/| | #
|
|
5
|
+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ | |_| |___) |\ V / \ V / | | | | #
|
|
6
|
+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)___/|____/ \_/ \_/ |_| |_| #
|
|
7
|
+
# |_| |___/ #
|
|
8
|
+
# ==================================================================================================================== #
|
|
9
|
+
# Authors: #
|
|
10
|
+
# Patrick Lehmann #
|
|
11
|
+
# #
|
|
12
|
+
# License: #
|
|
13
|
+
# ==================================================================================================================== #
|
|
14
|
+
# Copyright 2025-2025 Patrick Lehmann - Boetzingen, Germany #
|
|
15
|
+
# #
|
|
16
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
|
17
|
+
# you may not use this file except in compliance with the License. #
|
|
18
|
+
# You may obtain a copy of the License at #
|
|
19
|
+
# #
|
|
20
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
21
|
+
# #
|
|
22
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
23
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
24
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
25
|
+
# See the License for the specific language governing permissions and #
|
|
26
|
+
# limitations under the License. #
|
|
27
|
+
# #
|
|
28
|
+
# SPDX-License-Identifier: Apache-2.0 #
|
|
29
|
+
# ==================================================================================================================== #
|
|
30
|
+
#
|
|
31
|
+
from pathlib import Path
|
|
32
|
+
from typing import Optional as Nullable, Tuple
|
|
33
|
+
|
|
34
|
+
from pyTooling.Decorators import export
|
|
35
|
+
|
|
36
|
+
from pyEDAA.OSVVM import OSVVMException
|
|
37
|
+
from pyEDAA.OSVVM.Environment import osvvmContext, VHDLSourceFile, GenericValue
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@export
|
|
41
|
+
def build(file: str) -> None:
|
|
42
|
+
include(file)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@export
|
|
46
|
+
def include(file: str) -> None:
|
|
47
|
+
currentDirectory = osvvmContext._currentDirectory
|
|
48
|
+
|
|
49
|
+
includeFile = osvvmContext.IncludeFile(Path(file))
|
|
50
|
+
osvvmContext.EvaluateFile(includeFile)
|
|
51
|
+
|
|
52
|
+
osvvmContext._currentDirectory = currentDirectory
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@export
|
|
56
|
+
def library(libraryName: str, libraryPath: Nullable[str] = None) -> None:
|
|
57
|
+
osvvmContext.SetLibrary(libraryName)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@export
|
|
61
|
+
def analyze(file: str) -> None:
|
|
62
|
+
file = Path(file)
|
|
63
|
+
fullPath = (osvvmContext._currentDirectory / file).resolve()
|
|
64
|
+
|
|
65
|
+
if not fullPath.exists():
|
|
66
|
+
print(f"[analyze] Path '{fullPath}' doesn't exist.")
|
|
67
|
+
ex = OSVVMException(f"Path '{fullPath}' can't be analyzed.")
|
|
68
|
+
ex.__cause__ = FileNotFoundError(fullPath)
|
|
69
|
+
osvvmContext.LastException = ex
|
|
70
|
+
raise ex
|
|
71
|
+
|
|
72
|
+
if fullPath.suffix in (".vhd", ".vhdl"):
|
|
73
|
+
vhdlFile = VHDLSourceFile(fullPath.relative_to(osvvmContext._workingDirectory, walk_up=True))
|
|
74
|
+
osvvmContext.AddVHDLFile(vhdlFile)
|
|
75
|
+
else:
|
|
76
|
+
print(f"[analyze] Unknown file type for '{fullPath}'.")
|
|
77
|
+
ex = OSVVMException(f"Path '{fullPath}' is no VHDL file.")
|
|
78
|
+
osvvmContext.LastException = ex
|
|
79
|
+
raise ex
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@export
|
|
83
|
+
def simulate(toplevelName: str, *options: Tuple[int]) -> None:
|
|
84
|
+
testcase = osvvmContext.SetTestcaseToplevel(toplevelName)
|
|
85
|
+
for optionID in options:
|
|
86
|
+
try:
|
|
87
|
+
option = osvvmContext._options[int(optionID)]
|
|
88
|
+
except KeyError as ex2:
|
|
89
|
+
ex = OSVVMException(f"Option {optionID} not found in option dictionary.")
|
|
90
|
+
ex.__cause__ = ex2
|
|
91
|
+
osvvmContext.LastException = ex
|
|
92
|
+
raise ex
|
|
93
|
+
|
|
94
|
+
if isinstance(option, GenericValue):
|
|
95
|
+
testcase.AddGeneric(option)
|
|
96
|
+
else:
|
|
97
|
+
ex = OSVVMException(f"Option {optionID} is not a GenericValue.")
|
|
98
|
+
ex.__cause__ = TypeError()
|
|
99
|
+
osvvmContext.LastException = ex
|
|
100
|
+
raise ex
|
|
101
|
+
|
|
102
|
+
# osvvmContext._testcase = None
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@export
|
|
106
|
+
def generic(name: str, value: str) -> GenericValue:
|
|
107
|
+
genericValue = GenericValue(name, value)
|
|
108
|
+
optionID = osvvmContext.AddOption(genericValue)
|
|
109
|
+
|
|
110
|
+
return optionID
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@export
|
|
114
|
+
def TestSuite(name: str) -> None:
|
|
115
|
+
osvvmContext.SetTestsuite(name)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@export
|
|
119
|
+
def TestName(name: str) -> None:
|
|
120
|
+
osvvmContext.AddTestcase(name)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@export
|
|
124
|
+
def RunTest(file: str, *options: Tuple[int]) -> None:
|
|
125
|
+
file = Path(file)
|
|
126
|
+
vhdlFile = VHDLSourceFile(file)
|
|
127
|
+
testName = file.stem
|
|
128
|
+
testcase = osvvmContext.AddTestcase(testName)
|
|
129
|
+
osvvmContext.AddVHDLFile(vhdlFile)
|
|
130
|
+
testcase.SetToplevel(testName)
|
|
131
|
+
for optionID in options:
|
|
132
|
+
try:
|
|
133
|
+
option = osvvmContext._options[int(optionID)]
|
|
134
|
+
except KeyError as ex2:
|
|
135
|
+
ex = OSVVMException(f"Option {optionID} not found in option dictionary.")
|
|
136
|
+
ex.__cause__ = ex2
|
|
137
|
+
osvvmContext.LastException = ex
|
|
138
|
+
raise ex
|
|
139
|
+
|
|
140
|
+
if isinstance(option, GenericValue):
|
|
141
|
+
testcase.AddGeneric(option)
|
|
142
|
+
else:
|
|
143
|
+
ex = OSVVMException(f"Option {optionID} is not a GenericValue.")
|
|
144
|
+
ex.__cause__ = TypeError()
|
|
145
|
+
osvvmContext.LastException = ex
|
|
146
|
+
raise ex
|
|
147
|
+
|
|
148
|
+
# osvvmContext._testcase = None
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@export
|
|
152
|
+
def LinkLibrary(libraryName: str, libraryPath: Nullable[str] = None):
|
|
153
|
+
print(f"[LinkLibrary] {libraryPath}")
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@export
|
|
157
|
+
def LinkLibraryDirectory(libraryDirectory: str):
|
|
158
|
+
print(f"[LinkLibraryDirectory] {libraryDirectory}")
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
@export
|
|
162
|
+
def SetCoverageAnalyzeEnable(value: bool) -> None:
|
|
163
|
+
print(f"[SetCoverageAnalyzeEnable] {value}")
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@export
|
|
167
|
+
def SetCoverageSimulateEnable(value: bool) -> None:
|
|
168
|
+
print(f"[SetCoverageSimulateEnable] {value}")
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
@export
|
|
172
|
+
def FileExists(file: str) -> bool:
|
|
173
|
+
return (osvvmContext._currentDirectory / file).is_file()
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@export
|
|
177
|
+
def DirectoryExists(directory: str) -> bool:
|
|
178
|
+
return (osvvmContext._currentDirectory / directory).is_dir()
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@export
|
|
182
|
+
def ChangeWorkingDirectory(directory: str) -> None:
|
|
183
|
+
osvvmContext._currentDirectory = (newDirectory := osvvmContext._currentDirectory / directory)
|
|
184
|
+
if not newDirectory.is_dir():
|
|
185
|
+
print(f"[ChangeWorkingDirectory] Directory {newDirectory} doesn't exist.")
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@export
|
|
189
|
+
def FindOsvvmSettingsDirectory(*args):
|
|
190
|
+
pass
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@export
|
|
194
|
+
def CreateOsvvmScriptSettingsPkg(*args):
|
|
195
|
+
pass
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
@export
|
|
199
|
+
def noop(*args):
|
|
200
|
+
pass
|
pyEDAA/OSVVM/Tcl.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# ==================================================================================================================== #
|
|
2
|
+
# _____ ____ _ _ ___ ______ ____ ____ __ #
|
|
3
|
+
# _ __ _ _| ____| _ \ / \ / \ / _ \/ ___\ \ / /\ \ / / \/ | #
|
|
4
|
+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | | \___ \\ \ / / \ \ / /| |\/| | #
|
|
5
|
+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ | |_| |___) |\ V / \ V / | | | | #
|
|
6
|
+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)___/|____/ \_/ \_/ |_| |_| #
|
|
7
|
+
# |_| |___/ #
|
|
8
|
+
# ==================================================================================================================== #
|
|
9
|
+
# Authors: #
|
|
10
|
+
# Patrick Lehmann #
|
|
11
|
+
# #
|
|
12
|
+
# License: #
|
|
13
|
+
# ==================================================================================================================== #
|
|
14
|
+
# Copyright 2025-2025 Patrick Lehmann - Boetzingen, Germany #
|
|
15
|
+
# #
|
|
16
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
|
17
|
+
# you may not use this file except in compliance with the License. #
|
|
18
|
+
# You may obtain a copy of the License at #
|
|
19
|
+
# #
|
|
20
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
21
|
+
# #
|
|
22
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
23
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
24
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
25
|
+
# See the License for the specific language governing permissions and #
|
|
26
|
+
# limitations under the License. #
|
|
27
|
+
# #
|
|
28
|
+
# SPDX-License-Identifier: Apache-2.0 #
|
|
29
|
+
# ==================================================================================================================== #
|
|
30
|
+
#
|
|
31
|
+
from pathlib import Path
|
|
32
|
+
from textwrap import dedent
|
|
33
|
+
from tkinter import Tk, Tcl, TclError
|
|
34
|
+
from typing import Any, Dict, Callable, Optional as Nullable
|
|
35
|
+
|
|
36
|
+
from pyTooling.Decorators import readonly, export
|
|
37
|
+
|
|
38
|
+
from pyEDAA.OSVVM import OSVVMException
|
|
39
|
+
from pyEDAA.OSVVM.Environment import Context, osvvmContext
|
|
40
|
+
from pyEDAA.OSVVM.Procedures import noop, TestName
|
|
41
|
+
from pyEDAA.OSVVM.Procedures import FileExists, DirectoryExists, FindOsvvmSettingsDirectory
|
|
42
|
+
from pyEDAA.OSVVM.Procedures import build, include, library, analyze, simulate, generic
|
|
43
|
+
from pyEDAA.OSVVM.Procedures import TestSuite, TestName, RunTest
|
|
44
|
+
from pyEDAA.OSVVM.Procedures import ChangeWorkingDirectory, CreateOsvvmScriptSettingsPkg
|
|
45
|
+
from pyEDAA.OSVVM.Procedures import SetCoverageAnalyzeEnable, SetCoverageSimulateEnable
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@export
|
|
49
|
+
class TclEnvironment:
|
|
50
|
+
_tcl: Tk
|
|
51
|
+
_procedures: Dict[str, Callable]
|
|
52
|
+
_context: Context
|
|
53
|
+
|
|
54
|
+
def __init__(self, context: Context) -> None:
|
|
55
|
+
self._context = context
|
|
56
|
+
context._processor = self
|
|
57
|
+
|
|
58
|
+
self._tcl = Tcl()
|
|
59
|
+
self._procedures = {}
|
|
60
|
+
|
|
61
|
+
@readonly
|
|
62
|
+
def TCL(self) -> Tk:
|
|
63
|
+
return self._tcl
|
|
64
|
+
|
|
65
|
+
@readonly
|
|
66
|
+
def Procedures(self) -> Dict[str, Callable]:
|
|
67
|
+
return self._procedures
|
|
68
|
+
|
|
69
|
+
@readonly
|
|
70
|
+
def Context(self) -> Context:
|
|
71
|
+
return self._context
|
|
72
|
+
|
|
73
|
+
def RegisterPythonFunctionAsTclProcedure(self, pythonFunction: Callable, tclProcedureName: Nullable[str] = None):
|
|
74
|
+
if tclProcedureName is None:
|
|
75
|
+
tclProcedureName = pythonFunction.__name__
|
|
76
|
+
|
|
77
|
+
self._tcl.createcommand(tclProcedureName, pythonFunction)
|
|
78
|
+
self._procedures[tclProcedureName] = pythonFunction
|
|
79
|
+
|
|
80
|
+
def LoadProFile(self, path: Path) -> None:
|
|
81
|
+
includeFile = self._context.IncludeFile(path)
|
|
82
|
+
|
|
83
|
+
self.EvaluateProFile(includeFile)
|
|
84
|
+
|
|
85
|
+
def EvaluateProFile(self, path: Path) -> None:
|
|
86
|
+
try:
|
|
87
|
+
self._tcl.evalfile(str(path))
|
|
88
|
+
except TclError as ex:
|
|
89
|
+
raise getException(ex, self._context)
|
|
90
|
+
|
|
91
|
+
def __setitem__(self, tclVariableName: str, value: Any) -> None:
|
|
92
|
+
self._tcl.setvar(tclVariableName, value)
|
|
93
|
+
|
|
94
|
+
def __getitem__(self, tclVariableName: str) -> None:
|
|
95
|
+
return self._tcl.getvar(tclVariableName)
|
|
96
|
+
|
|
97
|
+
def __delitem__(self, tclVariableName: str) -> None:
|
|
98
|
+
self._tcl.unsetvar(tclVariableName)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@export
|
|
102
|
+
class OsvvmVariables:
|
|
103
|
+
_toolVendor: str
|
|
104
|
+
_toolName: str
|
|
105
|
+
_toolNameVersion: str
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
toolVendor: Nullable[str] = None,
|
|
110
|
+
toolName: Nullable[str] = None,
|
|
111
|
+
toolNameVersion: Nullable[str] = None
|
|
112
|
+
) -> None:
|
|
113
|
+
self._toolVendor = toolVendor if toolVendor is not None else "EDA²"
|
|
114
|
+
self._toolName = toolName if toolName is not None else "pyEDAA.ProjectModel"
|
|
115
|
+
self._toolNameVersion = toolNameVersion if toolNameVersion is not None else "0.1"
|
|
116
|
+
|
|
117
|
+
@readonly
|
|
118
|
+
def ToolVendor(self) -> str:
|
|
119
|
+
return self._toolVendor
|
|
120
|
+
|
|
121
|
+
@readonly
|
|
122
|
+
def ToolName(self) -> str:
|
|
123
|
+
return self._toolName
|
|
124
|
+
|
|
125
|
+
@readonly
|
|
126
|
+
def ToolNameVersion(self) -> str:
|
|
127
|
+
return self._toolNameVersion
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@export
|
|
131
|
+
class OsvvmProFileProcessor(TclEnvironment):
|
|
132
|
+
def __init__(
|
|
133
|
+
self,
|
|
134
|
+
context: Nullable[Context] = None,
|
|
135
|
+
osvvmVariables: Nullable[OsvvmVariables] = None
|
|
136
|
+
) -> None:
|
|
137
|
+
if context is None:
|
|
138
|
+
context = osvvmContext
|
|
139
|
+
|
|
140
|
+
super().__init__(context)
|
|
141
|
+
|
|
142
|
+
if osvvmVariables is None:
|
|
143
|
+
osvvmVariables = OsvvmVariables()
|
|
144
|
+
|
|
145
|
+
self.LoadOsvvmDefaults(osvvmVariables)
|
|
146
|
+
self.OverwriteTclProcedures()
|
|
147
|
+
self.RegisterTclProcedures()
|
|
148
|
+
|
|
149
|
+
def LoadOsvvmDefaults(self, osvvmVariables: OsvvmVariables) -> None:
|
|
150
|
+
code = dedent(f"""\
|
|
151
|
+
namespace eval ::osvvm {{
|
|
152
|
+
variable VhdlVersion 2019
|
|
153
|
+
variable ToolVendor "{osvvmVariables.ToolVendor}"
|
|
154
|
+
variable ToolName "{osvvmVariables.ToolName}"
|
|
155
|
+
variable ToolNameVersion "{osvvmVariables.ToolNameVersion}"
|
|
156
|
+
variable ToolSupportsDeferredConstants 1
|
|
157
|
+
variable ToolSupportsGenericPackages 1
|
|
158
|
+
variable FunctionalCoverageIntegratedInSimulator "default"
|
|
159
|
+
variable Support2019FilePath 1
|
|
160
|
+
|
|
161
|
+
variable ClockResetVersion 0
|
|
162
|
+
}}
|
|
163
|
+
""")
|
|
164
|
+
|
|
165
|
+
try:
|
|
166
|
+
self._tcl.eval(code)
|
|
167
|
+
except TclError as ex:
|
|
168
|
+
raise OSVVMException(f"TCL error occurred, when initializing OSVVM variables.") from ex
|
|
169
|
+
|
|
170
|
+
def OverwriteTclProcedures(self) -> None:
|
|
171
|
+
self.RegisterPythonFunctionAsTclProcedure(noop, "puts")
|
|
172
|
+
|
|
173
|
+
def RegisterTclProcedures(self) -> None:
|
|
174
|
+
self.RegisterPythonFunctionAsTclProcedure(build)
|
|
175
|
+
self.RegisterPythonFunctionAsTclProcedure(include)
|
|
176
|
+
self.RegisterPythonFunctionAsTclProcedure(library)
|
|
177
|
+
self.RegisterPythonFunctionAsTclProcedure(analyze)
|
|
178
|
+
self.RegisterPythonFunctionAsTclProcedure(simulate)
|
|
179
|
+
self.RegisterPythonFunctionAsTclProcedure(generic)
|
|
180
|
+
|
|
181
|
+
self.RegisterPythonFunctionAsTclProcedure(TestSuite)
|
|
182
|
+
self.RegisterPythonFunctionAsTclProcedure(TestName)
|
|
183
|
+
self.RegisterPythonFunctionAsTclProcedure(RunTest)
|
|
184
|
+
|
|
185
|
+
self.RegisterPythonFunctionAsTclProcedure(SetCoverageAnalyzeEnable)
|
|
186
|
+
self.RegisterPythonFunctionAsTclProcedure(SetCoverageSimulateEnable)
|
|
187
|
+
|
|
188
|
+
self.RegisterPythonFunctionAsTclProcedure(FileExists)
|
|
189
|
+
self.RegisterPythonFunctionAsTclProcedure(DirectoryExists)
|
|
190
|
+
self.RegisterPythonFunctionAsTclProcedure(ChangeWorkingDirectory)
|
|
191
|
+
|
|
192
|
+
self.RegisterPythonFunctionAsTclProcedure(FindOsvvmSettingsDirectory)
|
|
193
|
+
self.RegisterPythonFunctionAsTclProcedure(CreateOsvvmScriptSettingsPkg)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
@export
|
|
197
|
+
def getException(ex: Exception, context: Context) -> Exception:
|
|
198
|
+
if str(ex) == "":
|
|
199
|
+
if (lastException := context.LastException) is not None:
|
|
200
|
+
return lastException
|
|
201
|
+
|
|
202
|
+
return ex
|
pyEDAA/OSVVM/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ==================================================================================================================== #
|
|
2
|
+
# _____ ____ _ _ ___ ______ ____ ____ __ #
|
|
3
|
+
# _ __ _ _| ____| _ \ / \ / \ / _ \/ ___\ \ / /\ \ / / \/ | #
|
|
4
|
+
# | '_ \| | | | _| | | | |/ _ \ / _ \ | | | \___ \\ \ / / \ \ / /| |\/| | #
|
|
5
|
+
# | |_) | |_| | |___| |_| / ___ \ / ___ \ | |_| |___) |\ V / \ V / | | | | #
|
|
6
|
+
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)___/|____/ \_/ \_/ |_| |_| #
|
|
7
|
+
# |_| |___/ #
|
|
8
|
+
# ==================================================================================================================== #
|
|
9
|
+
# Authors: #
|
|
10
|
+
# Patrick Lehmann #
|
|
11
|
+
# #
|
|
12
|
+
# License: #
|
|
13
|
+
# ==================================================================================================================== #
|
|
14
|
+
# Copyright 2025-2025 Patrick Lehmann - Boetzingen, Germany #
|
|
15
|
+
# #
|
|
16
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
|
17
|
+
# you may not use this file except in compliance with the License. #
|
|
18
|
+
# You may obtain a copy of the License at #
|
|
19
|
+
# #
|
|
20
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
21
|
+
# #
|
|
22
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
23
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
|
24
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
|
25
|
+
# See the License for the specific language governing permissions and #
|
|
26
|
+
# limitations under the License. #
|
|
27
|
+
# #
|
|
28
|
+
# SPDX-License-Identifier: Apache-2.0 #
|
|
29
|
+
# ==================================================================================================================== #
|
|
30
|
+
#
|
|
31
|
+
"""An abstract model of EDA tool projects."""
|
|
32
|
+
__author__ = "Patrick Lehmann"
|
|
33
|
+
__email__ = "Paebbels@gmail.com"
|
|
34
|
+
__copyright__ = "2025-2025, Patrick Lehmann"
|
|
35
|
+
__license__ = "Apache License, Version 2.0"
|
|
36
|
+
__version__ = "0.1.0"
|
|
37
|
+
__keywords__ = ["eda project", "model", "abstract", "osvvm", "reports", "data format", "unit test", "test suite", "test bench", "test harness"]
|
|
38
|
+
|
|
39
|
+
from pyTooling.Decorators import export
|
|
40
|
+
from pyTooling.Exceptions import ExceptionBase
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@export
|
|
44
|
+
class OSVVMException(ExceptionBase):
|
|
45
|
+
pass
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
This is a local copy of the Apache License Version 2.0.
|
|
2
|
+
The original can be obtained here: [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
3
|
+
|
|
4
|
+
--------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
# Apache License
|
|
7
|
+
|
|
8
|
+
Version 2.0, January 2004
|
|
9
|
+
|
|
10
|
+
## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
11
|
+
|
|
12
|
+
### 1. Definitions.
|
|
13
|
+
|
|
14
|
+
*"License"* shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
15
|
+
|
|
16
|
+
*"Licensor"* shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
17
|
+
|
|
18
|
+
*"Legal Entity"* shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
19
|
+
|
|
20
|
+
*"You"* (or *"Your"*) shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
21
|
+
|
|
22
|
+
*"Source"* form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
23
|
+
|
|
24
|
+
*"Object"* form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
25
|
+
|
|
26
|
+
*"Work"* shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
27
|
+
|
|
28
|
+
*"Derivative Works"* shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
29
|
+
|
|
30
|
+
*"Contribution"* shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, *"submitted"* means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as *"Not a Contribution."*
|
|
31
|
+
|
|
32
|
+
*"Contributor"* shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
33
|
+
|
|
34
|
+
### 2. Grant of Copyright License.
|
|
35
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
36
|
+
|
|
37
|
+
### 3. Grant of Patent License.
|
|
38
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
39
|
+
|
|
40
|
+
### 4. Redistribution.
|
|
41
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
42
|
+
|
|
43
|
+
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
44
|
+
- You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
45
|
+
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
46
|
+
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
47
|
+
|
|
48
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
49
|
+
|
|
50
|
+
### 5. Submission of Contributions.
|
|
51
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
52
|
+
|
|
53
|
+
### 6. Trademarks.
|
|
54
|
+
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
55
|
+
|
|
56
|
+
### 7. Disclaimer of Warranty.
|
|
57
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
58
|
+
|
|
59
|
+
### 8. Limitation of Liability.
|
|
60
|
+
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
61
|
+
|
|
62
|
+
### 9. Accepting Warranty or Additional Liability.
|
|
63
|
+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Appendix: How to apply the Apache License to your work
|
|
67
|
+
|
|
68
|
+
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
|
69
|
+
|
|
70
|
+
Copyright [yyyy] [name of copyright owner]
|
|
71
|
+
|
|
72
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
73
|
+
you may not use this file except in compliance with the License.
|
|
74
|
+
You may obtain a copy of the License at
|
|
75
|
+
|
|
76
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
77
|
+
|
|
78
|
+
Unless required by applicable law or agreed to in writing, software
|
|
79
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
80
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
81
|
+
See the License for the specific language governing permissions and
|
|
82
|
+
limitations under the License.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyEDAA.OSVVM
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Parser and converter for OSVVM-specific data models and report formats.
|
|
5
|
+
Home-page: https://GitHub.com/edaa-org/pyEDAA.OSVVM
|
|
6
|
+
Author: Patrick Lehmann
|
|
7
|
+
Author-email: Paebbels@gmail.com
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Project-URL: Documentation, https://edaa-org.GitHub.io/pyEDAA.OSVVM
|
|
10
|
+
Project-URL: Source Code, https://GitHub.com/edaa-org/pyEDAA.OSVVM
|
|
11
|
+
Project-URL: Issue Tracker, https://GitHub.com/edaa-org/pyEDAA.OSVVM/issues
|
|
12
|
+
Keywords: eda project,model,abstract,osvvm,reports,data format,unit test,test suite,test bench,test harness
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Utilities
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Development Status :: 3 - Alpha
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE.md
|
|
25
|
+
Requires-Dist: pyVHDLModel~=0.31
|
|
26
|
+
Requires-Dist: pyTooling~=8.2
|
|
27
|
+
Provides-Extra: doc
|
|
28
|
+
Requires-Dist: sphinx_rtd_theme~=3.0; extra == "doc"
|
|
29
|
+
Requires-Dist: sphinx~=8.2; extra == "doc"
|
|
30
|
+
Requires-Dist: pyTooling~=8.2; extra == "doc"
|
|
31
|
+
Requires-Dist: docutils~=0.21; extra == "doc"
|
|
32
|
+
Requires-Dist: autoapi>=2.0.1; extra == "doc"
|
|
33
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
34
|
+
Requires-Dist: sphinx_design~=0.6.1; extra == "doc"
|
|
35
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.1; extra == "doc"
|
|
36
|
+
Requires-Dist: sphinxcontrib-mermaid~=1.0; extra == "doc"
|
|
37
|
+
Requires-Dist: pyVHDLModel~=0.31; extra == "doc"
|
|
38
|
+
Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
|
|
39
|
+
Requires-Dist: sphinx_reports~=0.7; extra == "doc"
|
|
40
|
+
Provides-Extra: test
|
|
41
|
+
Requires-Dist: pytest-cov~=6.0; extra == "test"
|
|
42
|
+
Requires-Dist: pytest~=8.3; extra == "test"
|
|
43
|
+
Requires-Dist: Coverage~=7.6; extra == "test"
|
|
44
|
+
Requires-Dist: mypy~=1.15; extra == "test"
|
|
45
|
+
Requires-Dist: typing_extensions~=4.12; extra == "test"
|
|
46
|
+
Requires-Dist: pyVHDLModel~=0.31; extra == "test"
|
|
47
|
+
Requires-Dist: pyTooling~=8.2; extra == "test"
|
|
48
|
+
Requires-Dist: lxml~=5.3; extra == "test"
|
|
49
|
+
Provides-Extra: all
|
|
50
|
+
Requires-Dist: sphinx_rtd_theme~=3.0; extra == "all"
|
|
51
|
+
Requires-Dist: sphinx~=8.2; extra == "all"
|
|
52
|
+
Requires-Dist: docutils~=0.21; extra == "all"
|
|
53
|
+
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
54
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
55
|
+
Requires-Dist: pytest-cov~=6.0; extra == "all"
|
|
56
|
+
Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
|
|
57
|
+
Requires-Dist: pytest~=8.3; extra == "all"
|
|
58
|
+
Requires-Dist: lxml~=5.3; extra == "all"
|
|
59
|
+
Requires-Dist: sphinx_design~=0.6.1; extra == "all"
|
|
60
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.1; extra == "all"
|
|
61
|
+
Requires-Dist: Coverage~=7.6; extra == "all"
|
|
62
|
+
Requires-Dist: mypy~=1.15; extra == "all"
|
|
63
|
+
Requires-Dist: sphinxcontrib-mermaid~=1.0; extra == "all"
|
|
64
|
+
Requires-Dist: typing_extensions~=4.12; extra == "all"
|
|
65
|
+
Requires-Dist: pyVHDLModel~=0.31; extra == "all"
|
|
66
|
+
Requires-Dist: pyTooling~=8.2; extra == "all"
|
|
67
|
+
Requires-Dist: sphinx_reports~=0.7; extra == "all"
|
|
68
|
+
Dynamic: author
|
|
69
|
+
Dynamic: author-email
|
|
70
|
+
Dynamic: classifier
|
|
71
|
+
Dynamic: description
|
|
72
|
+
Dynamic: description-content-type
|
|
73
|
+
Dynamic: home-page
|
|
74
|
+
Dynamic: keywords
|
|
75
|
+
Dynamic: license
|
|
76
|
+
Dynamic: project-url
|
|
77
|
+
Dynamic: provides-extra
|
|
78
|
+
Dynamic: requires-dist
|
|
79
|
+
Dynamic: requires-python
|
|
80
|
+
Dynamic: summary
|
|
81
|
+
|
|
82
|
+
# Main Goals
|
|
83
|
+
|
|
84
|
+
This package provides OSVVM-specific data models and parsers. The data models can be used as is or converted to generic
|
|
85
|
+
data models of the pyEDAA data model family. This includes parsing OSVVM's `*.pro`-files and translating them to a
|
|
86
|
+
pyEDAA.ProjectModel instance as well as reading OSVVM's reports in YAML format like test results, alerts or functional
|
|
87
|
+
coverage.
|
|
88
|
+
|
|
89
|
+
Frameworks consuming these data models can build higher level features and services on top of these models, while
|
|
90
|
+
using one parser that's aligned with OSVVM's data formats.
|
|
91
|
+
|
|
92
|
+
# Data Models
|
|
93
|
+
|
|
94
|
+
## Project Description via `*.pro`-Files
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Testsuite Summary Reports
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## Testcase Summary Reports
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Alert and Log Reports
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Scoreboard Reports
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## Functional Coverage Reports
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Requirement Reports
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# Features
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# Use Cases
|
|
122
|
+
|
|
123
|
+
* Reading OSVVM's `*.pro` files.
|
|
124
|
+
|
|
125
|
+
# Examples
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# Consumers
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# References
|
|
133
|
+
|
|
134
|
+
* [OSVVM/OSVVM-Scripts: OSVVMProjectScripts.tcl](https://GitHub.com/OSVVM/OSVVM-Scripts/blob/master/OSVVMProjectScripts.tcl)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# Contributors
|
|
138
|
+
|
|
139
|
+
* [Patrick Lehmann](https://GitHub.com/Paebbels) (Maintainer)
|
|
140
|
+
* [and more...](https://GitHub.com/edaa-org/pyEDAA.OSVVM/graphs/contributors)
|
|
141
|
+
|
|
142
|
+
# License
|
|
143
|
+
|
|
144
|
+
This Python package (source code) licensed under [Apache License 2.0](LICENSE.md).
|
|
145
|
+
The accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst).
|
|
146
|
+
|
|
147
|
+
-------------------------
|
|
148
|
+
SPDX-License-Identifier: Apache-2.0
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pyEDAA/OSVVM/Environment.py,sha256=Cd36sRUaSPh7-w9rMlC4U3WeIEeOixJ_6HpJbbDqOiw,11539
|
|
2
|
+
pyEDAA/OSVVM/Procedures.py,sha256=tClNMCdiRuhlZ8PTKX-d0fSPBq58IWP4FRt8hAjiHqE,7692
|
|
3
|
+
pyEDAA/OSVVM/Tcl.py,sha256=6Vr2G3tzd_fsTfLPmyTfcUkUGV3CfzDfwZya6YlzGdk,8872
|
|
4
|
+
pyEDAA/OSVVM/__init__.py,sha256=E4I3tt77GJfuMTkX8OKEtSeSBdyo6YKQrgKSynFKN8o,4029
|
|
5
|
+
pyedaa_osvvm-0.1.0.dist-info/LICENSE.md,sha256=DF4r-Jbsz_ZASY4VjV0ZZVaaHYkH9a20BkVExpq8doE,10571
|
|
6
|
+
pyedaa_osvvm-0.1.0.dist-info/METADATA,sha256=dAngy9zqLtJgJILQjNKsfmw8A7Z9S04ZfjX3TF2UWkQ,4873
|
|
7
|
+
pyedaa_osvvm-0.1.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
8
|
+
pyedaa_osvvm-0.1.0.dist-info/top_level.txt,sha256=J--2xhNglJhlQP4zh2M9bH0LpnKvmezMIcug4ZVSc9A,7
|
|
9
|
+
pyedaa_osvvm-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyEDAA
|