cocotb 1.8.1__cp38-cp38-win32.whl → 1.9.0rc2__cp38-cp38-win32.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.
Potentially problematic release.
This version of cocotb might be problematic. Click here for more details.
- cocotb/_version.py +1 -1
- cocotb/binary.py +48 -14
- cocotb/config.py +10 -16
- cocotb/decorators.py +7 -1
- cocotb/handle.py +1 -1
- cocotb/libs/cocotb.dll +0 -0
- cocotb/libs/cocotb.exp +0 -0
- cocotb/libs/cocotb.lib +0 -0
- cocotb/libs/cocotbfli_modelsim.dll +0 -0
- cocotb/libs/cocotbfli_modelsim.exp +0 -0
- cocotb/libs/cocotbfli_modelsim.lib +0 -0
- cocotb/libs/cocotbutils.dll +0 -0
- cocotb/libs/cocotbutils.exp +0 -0
- cocotb/libs/cocotbutils.lib +0 -0
- cocotb/libs/cocotbvhpi_aldec.dll +0 -0
- cocotb/libs/cocotbvhpi_aldec.exp +0 -0
- cocotb/libs/cocotbvhpi_aldec.lib +0 -0
- cocotb/libs/cocotbvhpi_modelsim.dll +0 -0
- cocotb/libs/cocotbvhpi_modelsim.exp +0 -0
- cocotb/libs/cocotbvhpi_modelsim.lib +0 -0
- cocotb/libs/cocotbvpi_aldec.dll +0 -0
- cocotb/libs/cocotbvpi_aldec.exp +0 -0
- cocotb/libs/cocotbvpi_aldec.lib +0 -0
- cocotb/libs/cocotbvpi_ghdl.dll +0 -0
- cocotb/libs/cocotbvpi_ghdl.exp +0 -0
- cocotb/libs/cocotbvpi_ghdl.lib +0 -0
- cocotb/libs/cocotbvpi_icarus.exp +0 -0
- cocotb/libs/cocotbvpi_icarus.lib +0 -0
- cocotb/libs/cocotbvpi_icarus.vpl +0 -0
- cocotb/libs/cocotbvpi_modelsim.dll +0 -0
- cocotb/libs/cocotbvpi_modelsim.exp +0 -0
- cocotb/libs/cocotbvpi_modelsim.lib +0 -0
- cocotb/libs/embed.dll +0 -0
- cocotb/libs/embed.exp +0 -0
- cocotb/libs/embed.lib +0 -0
- cocotb/libs/gpi.dll +0 -0
- cocotb/libs/gpi.exp +0 -0
- cocotb/libs/gpi.lib +0 -0
- cocotb/libs/gpilog.dll +0 -0
- cocotb/libs/gpilog.exp +0 -0
- cocotb/libs/gpilog.lib +0 -0
- cocotb/libs/pygpilog.dll +0 -0
- cocotb/libs/pygpilog.exp +0 -0
- cocotb/libs/pygpilog.lib +0 -0
- cocotb/runner.py +487 -120
- cocotb/scheduler.py +4 -8
- cocotb/share/def/aldec.exp +0 -0
- cocotb/share/def/aldec.lib +0 -0
- cocotb/share/def/ghdl.exp +0 -0
- cocotb/share/def/ghdl.lib +0 -0
- cocotb/share/def/icarus.exp +0 -0
- cocotb/share/def/icarus.lib +0 -0
- cocotb/share/def/modelsim.exp +0 -0
- cocotb/share/def/modelsim.lib +0 -0
- cocotb/share/lib/verilator/verilator.cpp +50 -8
- cocotb/share/makefiles/Makefile.inc +4 -10
- cocotb/share/makefiles/Makefile.sim +5 -5
- cocotb/share/makefiles/simulators/Makefile.activehdl +3 -3
- cocotb/share/makefiles/simulators/Makefile.cvc +1 -1
- cocotb/share/makefiles/simulators/Makefile.ghdl +29 -1
- cocotb/share/makefiles/simulators/Makefile.icarus +4 -4
- cocotb/share/makefiles/simulators/Makefile.ius +1 -1
- cocotb/share/makefiles/simulators/Makefile.nvc +64 -0
- cocotb/share/makefiles/simulators/Makefile.questa +1 -1
- cocotb/share/makefiles/simulators/Makefile.riviera +28 -12
- cocotb/share/makefiles/simulators/Makefile.vcs +2 -2
- cocotb/share/makefiles/simulators/Makefile.verilator +11 -5
- cocotb/share/makefiles/simulators/Makefile.xcelium +6 -1
- cocotb/simulator.cp38-win32.exp +0 -0
- cocotb/simulator.cp38-win32.lib +0 -0
- cocotb/simulator.cp38-win32.pyd +0 -0
- cocotb/triggers.py +102 -29
- {cocotb-1.8.1.dist-info → cocotb-1.9.0rc2.dist-info}/METADATA +3 -3
- cocotb-1.9.0rc2.dist-info/RECORD +121 -0
- {cocotb-1.8.1.dist-info → cocotb-1.9.0rc2.dist-info}/WHEEL +1 -1
- cocotb-1.8.1.dist-info/RECORD +0 -120
- {cocotb-1.8.1.dist-info → cocotb-1.9.0rc2.dist-info}/LICENSE +0 -0
- {cocotb-1.8.1.dist-info → cocotb-1.9.0rc2.dist-info}/entry_points.txt +0 -0
- {cocotb-1.8.1.dist-info → cocotb-1.9.0rc2.dist-info}/top_level.txt +0 -0
cocotb/_version.py
CHANGED
cocotb/binary.py
CHANGED
|
@@ -31,11 +31,34 @@ import os
|
|
|
31
31
|
import random
|
|
32
32
|
import re
|
|
33
33
|
import warnings
|
|
34
|
+
from enum import Enum
|
|
35
|
+
|
|
36
|
+
from cocotb._deprecation import deprecated
|
|
34
37
|
|
|
35
38
|
_RESOLVE_TO_0 = "-lL"
|
|
36
39
|
_RESOLVE_TO_1 = "hH"
|
|
37
40
|
_RESOLVE_TO_CHOICE = "xXzZuUwW"
|
|
38
|
-
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class _ResolveXToValue(Enum):
|
|
44
|
+
VALUE_ERROR = "VALUE_ERROR"
|
|
45
|
+
ZEROS = "ZEROS"
|
|
46
|
+
ONES = "ONES"
|
|
47
|
+
RANDOM = "RANDOM"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _resolve_x_to_from_env() -> _ResolveXToValue:
|
|
51
|
+
env_value = os.getenv("COCOTB_RESOLVE_X", "VALUE_ERROR")
|
|
52
|
+
try:
|
|
53
|
+
return _ResolveXToValue(env_value)
|
|
54
|
+
except ValueError:
|
|
55
|
+
raise ValueError(
|
|
56
|
+
"The COCOTB_RESOLVE_X environment variable is set to an unknown "
|
|
57
|
+
f"value: {env_value!r}"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
resolve_x_to = _resolve_x_to_from_env()
|
|
39
62
|
|
|
40
63
|
|
|
41
64
|
class _ResolveTable(dict):
|
|
@@ -55,19 +78,21 @@ class _ResolveTable(dict):
|
|
|
55
78
|
|
|
56
79
|
self.resolve_x = no_resolve
|
|
57
80
|
|
|
58
|
-
if resolve_x_to ==
|
|
81
|
+
if resolve_x_to == _ResolveXToValue.VALUE_ERROR:
|
|
59
82
|
|
|
60
83
|
def resolve_error(key):
|
|
61
84
|
raise ValueError(
|
|
62
|
-
"Unresolvable bit in binary string:
|
|
85
|
+
f"Unresolvable bit in binary string: {chr(key)!r}. "
|
|
86
|
+
"Set the COCOTB_RESOLVE_X environment variable to "
|
|
87
|
+
"configure how special values are resolved."
|
|
63
88
|
)
|
|
64
89
|
|
|
65
90
|
self.resolve_x = resolve_error
|
|
66
|
-
elif resolve_x_to ==
|
|
91
|
+
elif resolve_x_to == _ResolveXToValue.ZEROS:
|
|
67
92
|
self.update({ord(k): ord("0") for k in _RESOLVE_TO_CHOICE})
|
|
68
|
-
elif resolve_x_to ==
|
|
93
|
+
elif resolve_x_to == _ResolveXToValue.ONES:
|
|
69
94
|
self.update({ord(k): ord("1") for k in _RESOLVE_TO_CHOICE})
|
|
70
|
-
elif resolve_x_to ==
|
|
95
|
+
elif resolve_x_to == _ResolveXToValue.RANDOM:
|
|
71
96
|
|
|
72
97
|
def resolve_random(key):
|
|
73
98
|
# convert to correct Unicode ordinal:
|
|
@@ -376,11 +401,13 @@ class BinaryValue:
|
|
|
376
401
|
self._str = self._convert_to(val)
|
|
377
402
|
|
|
378
403
|
@property
|
|
404
|
+
@deprecated("Use `bv.integer` instead.")
|
|
379
405
|
def value(self):
|
|
380
406
|
"""Integer access to the value. **deprecated**"""
|
|
381
407
|
return self.integer
|
|
382
408
|
|
|
383
409
|
@value.setter
|
|
410
|
+
@deprecated("Use `bv.integer` instead.")
|
|
384
411
|
def value(self, val):
|
|
385
412
|
self.integer = val
|
|
386
413
|
|
|
@@ -539,14 +566,19 @@ class BinaryValue:
|
|
|
539
566
|
return False
|
|
540
567
|
|
|
541
568
|
def __eq__(self, other):
|
|
542
|
-
if isinstance(other, BinaryValue):
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
569
|
+
if isinstance(other, (BinaryValue, LogicArray)):
|
|
570
|
+
return self.binstr == other.binstr
|
|
571
|
+
elif isinstance(other, int):
|
|
572
|
+
try:
|
|
573
|
+
return self.integer == other
|
|
574
|
+
except ValueError:
|
|
575
|
+
return False
|
|
576
|
+
elif isinstance(other, str):
|
|
577
|
+
return self.binstr == other
|
|
578
|
+
elif isinstance(other, Logic):
|
|
579
|
+
return self.binstr == str(other)
|
|
580
|
+
else:
|
|
581
|
+
return NotImplemented
|
|
550
582
|
|
|
551
583
|
def __int__(self):
|
|
552
584
|
return self.integer
|
|
@@ -818,6 +850,8 @@ class BinaryValue:
|
|
|
818
850
|
)
|
|
819
851
|
|
|
820
852
|
|
|
853
|
+
from cocotb.types import Logic, LogicArray # noqa: E402
|
|
854
|
+
|
|
821
855
|
if __name__ == "__main__":
|
|
822
856
|
import doctest
|
|
823
857
|
|
cocotb/config.py
CHANGED
|
@@ -43,6 +43,7 @@ import argparse
|
|
|
43
43
|
import os
|
|
44
44
|
import sys
|
|
45
45
|
import textwrap
|
|
46
|
+
from pathlib import Path
|
|
46
47
|
|
|
47
48
|
import find_libpython
|
|
48
49
|
|
|
@@ -50,14 +51,10 @@ import cocotb
|
|
|
50
51
|
|
|
51
52
|
__all__ = ["share_dir", "makefiles_dir", "libs_dir"]
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
share_dir =
|
|
55
|
-
makefiles_dir =
|
|
56
|
-
libs_dir =
|
|
57
|
-
|
|
58
|
-
# On Windows use mixed mode "c:/a/b/c" as this work in all cases
|
|
59
|
-
if os.name == "nt":
|
|
60
|
-
libs_dir = libs_dir.replace("\\", "/")
|
|
54
|
+
base_dir = Path(cocotb.__file__).parent.resolve()
|
|
55
|
+
share_dir = base_dir.joinpath("share").as_posix()
|
|
56
|
+
makefiles_dir = base_dir.joinpath("share").joinpath("makefiles").as_posix()
|
|
57
|
+
libs_dir = base_dir.joinpath("libs").as_posix()
|
|
61
58
|
|
|
62
59
|
|
|
63
60
|
def help_vars_text():
|
|
@@ -130,6 +127,7 @@ def lib_name(interface: str, simulator: str) -> str:
|
|
|
130
127
|
"riviera",
|
|
131
128
|
"activehdl",
|
|
132
129
|
"cvc",
|
|
130
|
+
"nvc",
|
|
133
131
|
]
|
|
134
132
|
if simulator not in supported_sims:
|
|
135
133
|
raise ValueError(
|
|
@@ -167,18 +165,14 @@ def lib_name_path(interface, simulator):
|
|
|
167
165
|
"""
|
|
168
166
|
library_name_path = os.path.join(libs_dir, lib_name(interface, simulator))
|
|
169
167
|
|
|
170
|
-
|
|
171
|
-
if os.name == "nt":
|
|
172
|
-
return library_name_path.replace("\\", "/")
|
|
173
|
-
|
|
174
|
-
return library_name_path
|
|
168
|
+
return Path(library_name_path).as_posix()
|
|
175
169
|
|
|
176
170
|
|
|
177
171
|
def _findlibpython():
|
|
178
172
|
libpython_path = find_libpython.find_libpython()
|
|
179
173
|
if libpython_path is None:
|
|
180
174
|
sys.exit(1)
|
|
181
|
-
return libpython_path
|
|
175
|
+
return Path(libpython_path).as_posix()
|
|
182
176
|
|
|
183
177
|
|
|
184
178
|
class PrintAction(argparse.Action):
|
|
@@ -205,9 +199,9 @@ class PrintFuncAction(argparse.Action):
|
|
|
205
199
|
|
|
206
200
|
|
|
207
201
|
def get_parser():
|
|
208
|
-
prefix_dir =
|
|
202
|
+
prefix_dir = base_dir.parent.resolve().as_posix()
|
|
209
203
|
version = cocotb.__version__
|
|
210
|
-
python_bin = sys.executable
|
|
204
|
+
python_bin = Path(sys.executable).as_posix()
|
|
211
205
|
|
|
212
206
|
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
|
|
213
207
|
parser.add_argument(
|
cocotb/decorators.py
CHANGED
|
@@ -140,7 +140,8 @@ class external:
|
|
|
140
140
|
class _decorator_helper(type):
|
|
141
141
|
"""
|
|
142
142
|
Metaclass that allows a type to be constructed using decorator syntax,
|
|
143
|
-
passing the decorated function as the first argument.
|
|
143
|
+
passing the decorated function as the first argument. Supports
|
|
144
|
+
construction with or without having the type called.
|
|
144
145
|
|
|
145
146
|
So:
|
|
146
147
|
|
|
@@ -154,6 +155,11 @@ class _decorator_helper(type):
|
|
|
154
155
|
"""
|
|
155
156
|
|
|
156
157
|
def __call__(cls, *args, **kwargs):
|
|
158
|
+
if len(args) == 1 and callable(args[0]): # case without parenthesis
|
|
159
|
+
f = args[0]
|
|
160
|
+
return type.__call__(cls, f, **kwargs)
|
|
161
|
+
|
|
162
|
+
# case with parenthesis
|
|
157
163
|
def decorator(f):
|
|
158
164
|
# fall back to the normal way of constructing an object, now that
|
|
159
165
|
# we have all the arguments
|
cocotb/handle.py
CHANGED
|
@@ -403,7 +403,7 @@ class HierarchyArrayObject(RegionObject):
|
|
|
403
403
|
|
|
404
404
|
result = re.match(rf"{self._name}__(?P<index>\d+)$", name)
|
|
405
405
|
if not result:
|
|
406
|
-
result = re.match(rf"{self._name}\((?P<index>\d+)\)$", name)
|
|
406
|
+
result = re.match(rf"{self._name}\((?P<index>\d+)\)$", name, re.IGNORECASE)
|
|
407
407
|
if not result:
|
|
408
408
|
result = re.match(rf"{self._name}\[(?P<index>\d+)\]$", name)
|
|
409
409
|
|
cocotb/libs/cocotb.dll
CHANGED
|
Binary file
|
cocotb/libs/cocotb.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotb.lib
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
cocotb/libs/cocotbutils.dll
CHANGED
|
Binary file
|
cocotb/libs/cocotbutils.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotbutils.lib
CHANGED
|
Binary file
|
cocotb/libs/cocotbvhpi_aldec.dll
CHANGED
|
Binary file
|
cocotb/libs/cocotbvhpi_aldec.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotbvhpi_aldec.lib
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
cocotb/libs/cocotbvpi_aldec.dll
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_aldec.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_aldec.lib
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_ghdl.dll
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_ghdl.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_ghdl.lib
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_icarus.exp
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_icarus.lib
CHANGED
|
Binary file
|
cocotb/libs/cocotbvpi_icarus.vpl
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
cocotb/libs/embed.dll
CHANGED
|
Binary file
|
cocotb/libs/embed.exp
CHANGED
|
Binary file
|
cocotb/libs/embed.lib
CHANGED
|
Binary file
|
cocotb/libs/gpi.dll
CHANGED
|
Binary file
|
cocotb/libs/gpi.exp
CHANGED
|
Binary file
|
cocotb/libs/gpi.lib
CHANGED
|
Binary file
|
cocotb/libs/gpilog.dll
CHANGED
|
Binary file
|
cocotb/libs/gpilog.exp
CHANGED
|
Binary file
|
cocotb/libs/gpilog.lib
CHANGED
|
Binary file
|
cocotb/libs/pygpilog.dll
CHANGED
|
Binary file
|
cocotb/libs/pygpilog.exp
CHANGED
|
Binary file
|
cocotb/libs/pygpilog.lib
CHANGED
|
Binary file
|