cocotb 2.0.0rc2__cp38-cp38-macosx_11_0_arm64.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/_ANSI.py +65 -0
- cocotb/__init__.py +125 -0
- cocotb/_base_triggers.py +515 -0
- cocotb/_bridge.py +186 -0
- cocotb/_decorators.py +515 -0
- cocotb/_deprecation.py +36 -0
- cocotb/_exceptions.py +7 -0
- cocotb/_extended_awaitables.py +419 -0
- cocotb/_gpi_triggers.py +385 -0
- cocotb/_init.py +301 -0
- cocotb/_outcomes.py +54 -0
- cocotb/_profiling.py +46 -0
- cocotb/_py_compat.py +148 -0
- cocotb/_scheduler.py +448 -0
- cocotb/_test.py +248 -0
- cocotb/_test_factory.py +312 -0
- cocotb/_test_functions.py +42 -0
- cocotb/_typing.py +7 -0
- cocotb/_utils.py +274 -0
- cocotb/_version.py +4 -0
- cocotb/_xunit_reporter.py +66 -0
- cocotb/clock.py +419 -0
- cocotb/debug.py +24 -0
- cocotb/handle.py +1752 -0
- cocotb/libs/libcocotb.so +0 -0
- cocotb/libs/libcocotbfli_modelsim.so +0 -0
- cocotb/libs/libcocotbutils.so +0 -0
- cocotb/libs/libcocotbvhpi_aldec.so +0 -0
- cocotb/libs/libcocotbvhpi_ius.so +0 -0
- cocotb/libs/libcocotbvhpi_modelsim.so +0 -0
- cocotb/libs/libcocotbvhpi_nvc.so +0 -0
- cocotb/libs/libcocotbvpi_aldec.so +0 -0
- cocotb/libs/libcocotbvpi_dsim.so +0 -0
- cocotb/libs/libcocotbvpi_ghdl.so +0 -0
- cocotb/libs/libcocotbvpi_icarus.vpl +0 -0
- cocotb/libs/libcocotbvpi_ius.so +0 -0
- cocotb/libs/libcocotbvpi_modelsim.so +0 -0
- cocotb/libs/libcocotbvpi_vcs.so +0 -0
- cocotb/libs/libcocotbvpi_verilator.so +0 -0
- cocotb/libs/libembed.so +0 -0
- cocotb/libs/libgpi.so +0 -0
- cocotb/libs/libgpilog.so +0 -0
- cocotb/libs/libpygpilog.so +0 -0
- cocotb/logging.py +424 -0
- cocotb/py.typed +0 -0
- cocotb/queue.py +225 -0
- cocotb/regression.py +896 -0
- cocotb/result.py +38 -0
- cocotb/share/def/.gitignore +2 -0
- cocotb/share/def/README.md +4 -0
- cocotb/share/def/aldec.def +61 -0
- cocotb/share/def/ghdl.def +43 -0
- cocotb/share/def/icarus.def +43 -0
- cocotb/share/def/modelsim.def +138 -0
- cocotb/share/include/cocotb_utils.h +70 -0
- cocotb/share/include/embed.h +33 -0
- cocotb/share/include/exports.h +20 -0
- cocotb/share/include/gpi.h +459 -0
- cocotb/share/include/gpi_logging.h +291 -0
- cocotb/share/include/py_gpi_logging.h +33 -0
- cocotb/share/include/vhpi_user_ext.h +26 -0
- cocotb/share/include/vpi_user_ext.h +33 -0
- cocotb/share/lib/verilator/verilator.cpp +209 -0
- cocotb/simtime.py +230 -0
- cocotb/simulator.cpython-38-darwin.so +0 -0
- cocotb/simulator.pyi +107 -0
- cocotb/task.py +590 -0
- cocotb/triggers.py +67 -0
- cocotb/types/__init__.py +31 -0
- cocotb/types/_abstract_array.py +151 -0
- cocotb/types/_array.py +295 -0
- cocotb/types/_indexing.py +17 -0
- cocotb/types/_logic.py +333 -0
- cocotb/types/_logic_array.py +868 -0
- cocotb/types/_range.py +197 -0
- cocotb/types/_resolve.py +76 -0
- cocotb/utils.py +110 -0
- cocotb-2.0.0rc2.dist-info/LICENSE +29 -0
- cocotb-2.0.0rc2.dist-info/METADATA +46 -0
- cocotb-2.0.0rc2.dist-info/RECORD +115 -0
- cocotb-2.0.0rc2.dist-info/WHEEL +5 -0
- cocotb-2.0.0rc2.dist-info/entry_points.txt +2 -0
- cocotb-2.0.0rc2.dist-info/top_level.txt +23 -0
- cocotb_tools/__init__.py +0 -0
- cocotb_tools/_coverage.py +33 -0
- cocotb_tools/_vendor/__init__.py +3 -0
- cocotb_tools/_vendor/distutils_version.py +346 -0
- cocotb_tools/check_results.py +65 -0
- cocotb_tools/combine_results.py +152 -0
- cocotb_tools/config.py +241 -0
- cocotb_tools/ipython_support.py +99 -0
- cocotb_tools/makefiles/Makefile.deprecations +27 -0
- cocotb_tools/makefiles/Makefile.inc +198 -0
- cocotb_tools/makefiles/Makefile.sim +96 -0
- cocotb_tools/makefiles/simulators/Makefile.activehdl +72 -0
- cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
- cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
- cocotb_tools/makefiles/simulators/Makefile.ghdl +84 -0
- cocotb_tools/makefiles/simulators/Makefile.icarus +80 -0
- cocotb_tools/makefiles/simulators/Makefile.ius +93 -0
- cocotb_tools/makefiles/simulators/Makefile.modelsim +9 -0
- cocotb_tools/makefiles/simulators/Makefile.nvc +60 -0
- cocotb_tools/makefiles/simulators/Makefile.questa +29 -0
- cocotb_tools/makefiles/simulators/Makefile.questa-compat +143 -0
- cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
- cocotb_tools/makefiles/simulators/Makefile.riviera +144 -0
- cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
- cocotb_tools/makefiles/simulators/Makefile.verilator +79 -0
- cocotb_tools/makefiles/simulators/Makefile.xcelium +104 -0
- cocotb_tools/py.typed +0 -0
- cocotb_tools/runner.py +1868 -0
- cocotb_tools/sim_versions.py +140 -0
- pygpi/__init__.py +0 -0
- pygpi/entry.py +42 -0
- pygpi/py.typed +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Copyright cocotb contributors
|
|
2
|
+
# Licensed under the Revised BSD License, see LICENSE for details.
|
|
3
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
|
|
5
|
+
# type: ignore # distutils is untyped, so there's little reason to check this file
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Classes to compare simulation versions.
|
|
9
|
+
|
|
10
|
+
These are for cocotb-internal use only.
|
|
11
|
+
|
|
12
|
+
.. warning::
|
|
13
|
+
These classes silently allow comparing versions of different simulators.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from cocotb_tools._vendor.distutils_version import LooseVersion
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ActivehdlVersion(LooseVersion):
|
|
20
|
+
"""Version numbering class for Aldec Active-HDL.
|
|
21
|
+
|
|
22
|
+
NOTE: unsupported versions exist, e.g.
|
|
23
|
+
ActivehdlVersion("10.5a.12.6914") > ActivehdlVersion("10.5.216.6767")
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CvcVersion(LooseVersion):
|
|
28
|
+
"""Version numbering class for Tachyon DA CVC.
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
>>> CvcVersion(
|
|
32
|
+
... "OSS_CVC_7.00b-x86_64-rhel6x of 07/07/14 (Linux-elf)"
|
|
33
|
+
... ) > CvcVersion("OSS_CVC_7.00a-x86_64-rhel6x of 07/07/14 (Linux-elf)")
|
|
34
|
+
True
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class GhdlVersion(LooseVersion):
|
|
39
|
+
"""Version numbering class for GHDL."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class IcarusVersion(LooseVersion):
|
|
43
|
+
"""Version numbering class for Icarus Verilog.
|
|
44
|
+
|
|
45
|
+
Example:
|
|
46
|
+
>>> IcarusVersion("11.0 (devel)") > IcarusVersion("10.3 (stable)")
|
|
47
|
+
True
|
|
48
|
+
>>> IcarusVersion("10.3 (stable)") <= IcarusVersion("10.3 (stable)")
|
|
49
|
+
True
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ModelsimVersion(LooseVersion):
|
|
54
|
+
"""Version numbering class for Mentor ModelSim."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class QuestaVersion(LooseVersion):
|
|
58
|
+
"""Version numbering class for Mentor Questa.
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
>>> QuestaVersion("10.7c 2018.08") > QuestaVersion("10.7b 2018.06")
|
|
62
|
+
True
|
|
63
|
+
>>> QuestaVersion("2020.1 2020.01") > QuestaVersion("10.7c 2018.08")
|
|
64
|
+
True
|
|
65
|
+
>>> QuestaVersion("2020.1 2020.01") == QuestaVersion("2020.1")
|
|
66
|
+
True
|
|
67
|
+
>>> QuestaVersion("2023.1_2 2023.03") > QuestaVersion("2023.1_1")
|
|
68
|
+
True
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
def parse(self, vstring):
|
|
72
|
+
# A Questa version string, as returned by the simulator, consists of two
|
|
73
|
+
# space-separated parts. The first part is the actual version number,
|
|
74
|
+
# the second part seems to be the year and month of the initial release.
|
|
75
|
+
# We only need the first part, which is also used in public
|
|
76
|
+
# communication by Siemens.
|
|
77
|
+
try:
|
|
78
|
+
first_component = vstring.split(" ", 1)[0]
|
|
79
|
+
except IndexError:
|
|
80
|
+
first_component = vstring
|
|
81
|
+
|
|
82
|
+
super().parse(first_component)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class RivieraVersion(LooseVersion):
|
|
86
|
+
"""Version numbering class for Aldec Riviera-PRO.
|
|
87
|
+
|
|
88
|
+
Example:
|
|
89
|
+
>>> RivieraVersion("2019.10.138.7537") == RivieraVersion("2019.10.138.7537")
|
|
90
|
+
True
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class VcsVersion(LooseVersion):
|
|
95
|
+
"""Version numbering class for Synopsys VCS.
|
|
96
|
+
|
|
97
|
+
Example:
|
|
98
|
+
>>> VcsVersion("Q-2020.03-1_Full64") > VcsVersion("K-2015.09_Full64")
|
|
99
|
+
True
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class VerilatorVersion(LooseVersion):
|
|
104
|
+
"""Version numbering class for Verilator.
|
|
105
|
+
|
|
106
|
+
Example:
|
|
107
|
+
>>> VerilatorVersion("4.032 2020-04-04") > VerilatorVersion("4.031 devel")
|
|
108
|
+
True
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class XceliumVersion(LooseVersion):
|
|
113
|
+
"""Version numbering class for Cadence Xcelium.
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
>>> XceliumVersion("20.06-g183") > XceliumVersion("20.03-s002")
|
|
117
|
+
True
|
|
118
|
+
>>> XceliumVersion("20.07-e501") > XceliumVersion("20.06-g183")
|
|
119
|
+
True
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class IusVersion(XceliumVersion): # inherit everything from Xcelium
|
|
124
|
+
"""Version numbering class for Cadence IUS.
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
>>> IusVersion("15.20-s050") > IusVersion("15.20-s049")
|
|
128
|
+
True
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class NvcVersion(LooseVersion):
|
|
133
|
+
"""Version numbering class for NVC."""
|
|
134
|
+
|
|
135
|
+
@classmethod
|
|
136
|
+
def from_commandline(cls, cmdline):
|
|
137
|
+
firstline = cmdline.split("\n")[0]
|
|
138
|
+
sim, version, *version_extra = firstline.strip().split(" ")
|
|
139
|
+
assert sim == "nvc"
|
|
140
|
+
return cls(version)
|
pygpi/__init__.py
ADDED
|
File without changes
|
pygpi/entry.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
import operator
|
|
3
|
+
import os
|
|
4
|
+
from typing import Callable, List, Tuple
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def load_entry(argv: List[str]) -> None:
|
|
8
|
+
"""Gather entry point information by parsing :envvar:`PYGPI_USERS`."""
|
|
9
|
+
|
|
10
|
+
entry_point_str = os.environ.get(
|
|
11
|
+
"PYGPI_USERS",
|
|
12
|
+
",".join(
|
|
13
|
+
(
|
|
14
|
+
"cocotb_tools._coverage:start_cocotb_library_coverage",
|
|
15
|
+
"cocotb.logging:_configure",
|
|
16
|
+
"cocotb._init:init_package_from_simulation",
|
|
17
|
+
"cocotb._init:run_regression",
|
|
18
|
+
)
|
|
19
|
+
),
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Parse the entry point string of the form "module:func,module:func,...".
|
|
23
|
+
# Any failure prevents any entry points from being loaded.
|
|
24
|
+
entry_points: List[Tuple[str, str]] = []
|
|
25
|
+
try:
|
|
26
|
+
entry_points_str = entry_point_str.split(",")
|
|
27
|
+
for entry_point_str in entry_points_str:
|
|
28
|
+
entry_module_str, entry_func_str = entry_point_str.split(":")
|
|
29
|
+
# TODO maybe some basic validation of the module and function names.
|
|
30
|
+
# WITHOUT IMPORTING THEM.
|
|
31
|
+
entry_points.append((entry_module_str, entry_func_str))
|
|
32
|
+
except Exception as e:
|
|
33
|
+
raise RuntimeError(f"Failure to parse PYGPI_USERS ('{entry_point_str}')") from e
|
|
34
|
+
|
|
35
|
+
# Run all entry points.
|
|
36
|
+
# Expect failure to stop the loading of any additional entry points.
|
|
37
|
+
for entry_module_str, entry_func_str in entry_points:
|
|
38
|
+
entry_module = importlib.import_module(entry_module_str)
|
|
39
|
+
entry_func: Callable[[List[str]], object] = operator.attrgetter(entry_func_str)(
|
|
40
|
+
entry_module
|
|
41
|
+
)
|
|
42
|
+
entry_func(argv)
|
pygpi/py.typed
ADDED
|
File without changes
|