cocotb 1.9.2__cp312-cp312-win_amd64.whl → 2.0.0b1__cp312-cp312-win_amd64.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.

Files changed (155) hide show
  1. cocotb/{ANSI.py → _ANSI.py} +5 -25
  2. cocotb/__init__.py +76 -332
  3. cocotb/_base_triggers.py +513 -0
  4. cocotb/_bridge.py +187 -0
  5. cocotb/_decorators.py +515 -0
  6. cocotb/_deprecation.py +3 -3
  7. cocotb/_exceptions.py +7 -0
  8. cocotb/_extended_awaitables.py +419 -0
  9. cocotb/_gpi_triggers.py +382 -0
  10. cocotb/_init.py +295 -0
  11. cocotb/_outcomes.py +54 -0
  12. cocotb/_profiling.py +46 -0
  13. cocotb/_py_compat.py +100 -29
  14. cocotb/_scheduler.py +454 -0
  15. cocotb/_test.py +245 -0
  16. cocotb/_test_factory.py +309 -0
  17. cocotb/_test_functions.py +42 -0
  18. cocotb/_typing.py +7 -0
  19. cocotb/_utils.py +296 -0
  20. cocotb/_version.py +3 -7
  21. cocotb/_xunit_reporter.py +66 -0
  22. cocotb/clock.py +271 -108
  23. cocotb/handle.py +1342 -795
  24. cocotb/libs/cocotb.dll +0 -0
  25. cocotb/libs/cocotb.exp +0 -0
  26. cocotb/libs/cocotb.lib +0 -0
  27. cocotb/libs/cocotbfli_modelsim.dll +0 -0
  28. cocotb/libs/cocotbfli_modelsim.exp +0 -0
  29. cocotb/libs/cocotbfli_modelsim.lib +0 -0
  30. cocotb/libs/cocotbutils.dll +0 -0
  31. cocotb/libs/cocotbutils.exp +0 -0
  32. cocotb/libs/cocotbutils.lib +0 -0
  33. cocotb/libs/cocotbvhpi_aldec.dll +0 -0
  34. cocotb/libs/cocotbvhpi_aldec.exp +0 -0
  35. cocotb/libs/cocotbvhpi_aldec.lib +0 -0
  36. cocotb/libs/cocotbvhpi_modelsim.dll +0 -0
  37. cocotb/libs/cocotbvhpi_modelsim.exp +0 -0
  38. cocotb/libs/cocotbvhpi_modelsim.lib +0 -0
  39. cocotb/libs/cocotbvpi_aldec.dll +0 -0
  40. cocotb/libs/cocotbvpi_aldec.exp +0 -0
  41. cocotb/libs/cocotbvpi_aldec.lib +0 -0
  42. cocotb/libs/cocotbvpi_ghdl.dll +0 -0
  43. cocotb/libs/cocotbvpi_ghdl.exp +0 -0
  44. cocotb/libs/cocotbvpi_ghdl.lib +0 -0
  45. cocotb/libs/cocotbvpi_icarus.exp +0 -0
  46. cocotb/libs/cocotbvpi_icarus.lib +0 -0
  47. cocotb/libs/cocotbvpi_icarus.vpl +0 -0
  48. cocotb/libs/cocotbvpi_modelsim.dll +0 -0
  49. cocotb/libs/cocotbvpi_modelsim.exp +0 -0
  50. cocotb/libs/cocotbvpi_modelsim.lib +0 -0
  51. cocotb/libs/embed.dll +0 -0
  52. cocotb/libs/embed.exp +0 -0
  53. cocotb/libs/embed.lib +0 -0
  54. cocotb/libs/gpi.dll +0 -0
  55. cocotb/libs/gpi.exp +0 -0
  56. cocotb/libs/gpi.lib +0 -0
  57. cocotb/libs/gpilog.dll +0 -0
  58. cocotb/libs/gpilog.exp +0 -0
  59. cocotb/libs/gpilog.lib +0 -0
  60. cocotb/libs/pygpilog.dll +0 -0
  61. cocotb/libs/pygpilog.exp +0 -0
  62. cocotb/libs/pygpilog.lib +0 -0
  63. cocotb/{log.py → logging.py} +105 -110
  64. cocotb/queue.py +103 -57
  65. cocotb/regression.py +667 -712
  66. cocotb/result.py +17 -188
  67. cocotb/share/def/aldec.exp +0 -0
  68. cocotb/share/def/aldec.lib +0 -0
  69. cocotb/share/def/ghdl.exp +0 -0
  70. cocotb/share/def/ghdl.lib +0 -0
  71. cocotb/share/def/icarus.exp +0 -0
  72. cocotb/share/def/icarus.lib +0 -0
  73. cocotb/share/def/modelsim.def +1 -0
  74. cocotb/share/def/modelsim.exp +0 -0
  75. cocotb/share/def/modelsim.lib +0 -0
  76. cocotb/share/include/cocotb_utils.h +6 -29
  77. cocotb/share/include/embed.h +5 -28
  78. cocotb/share/include/gpi.h +137 -92
  79. cocotb/share/include/gpi_logging.h +221 -142
  80. cocotb/share/include/py_gpi_logging.h +7 -4
  81. cocotb/share/include/vpi_user_ext.h +4 -26
  82. cocotb/share/lib/verilator/verilator.cpp +59 -54
  83. cocotb/simulator.cp312-win_amd64.exp +0 -0
  84. cocotb/simulator.cp312-win_amd64.lib +0 -0
  85. cocotb/simulator.cp312-win_amd64.pyd +0 -0
  86. cocotb/simulator.pyi +107 -0
  87. cocotb/task.py +434 -212
  88. cocotb/triggers.py +55 -1092
  89. cocotb/types/__init__.py +25 -47
  90. cocotb/types/_abstract_array.py +151 -0
  91. cocotb/types/_array.py +264 -0
  92. cocotb/types/_logic.py +296 -0
  93. cocotb/types/_logic_array.py +834 -0
  94. cocotb/types/{range.py → _range.py} +36 -44
  95. cocotb/types/_resolve.py +76 -0
  96. cocotb/utils.py +119 -587
  97. cocotb-2.0.0b1.dist-info/METADATA +60 -0
  98. cocotb-2.0.0b1.dist-info/RECORD +143 -0
  99. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/WHEEL +1 -1
  100. cocotb-2.0.0b1.dist-info/entry_points.txt +2 -0
  101. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/top_level.txt +1 -0
  102. cocotb_tools/__init__.py +0 -0
  103. cocotb_tools/_coverage.py +33 -0
  104. cocotb_tools/_vendor/__init__.py +3 -0
  105. cocotb_tools/check_results.py +65 -0
  106. cocotb_tools/combine_results.py +152 -0
  107. cocotb_tools/config.py +241 -0
  108. {cocotb → cocotb_tools}/ipython_support.py +29 -22
  109. cocotb_tools/makefiles/Makefile.deprecations +27 -0
  110. {cocotb/share → cocotb_tools}/makefiles/Makefile.inc +82 -54
  111. {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +8 -33
  112. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.activehdl +9 -16
  113. cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
  114. cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
  115. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.ghdl +13 -42
  116. cocotb_tools/makefiles/simulators/Makefile.icarus +80 -0
  117. cocotb_tools/makefiles/simulators/Makefile.ius +93 -0
  118. cocotb_tools/makefiles/simulators/Makefile.modelsim +9 -0
  119. cocotb_tools/makefiles/simulators/Makefile.nvc +60 -0
  120. cocotb_tools/makefiles/simulators/Makefile.questa +29 -0
  121. cocotb/share/makefiles/simulators/Makefile.questa → cocotb_tools/makefiles/simulators/Makefile.questa-compat +26 -54
  122. cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
  123. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.riviera +17 -56
  124. cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
  125. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.verilator +15 -22
  126. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.xcelium +20 -52
  127. cocotb_tools/py.typed +0 -0
  128. {cocotb → cocotb_tools}/runner.py +794 -361
  129. cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
  130. pygpi/entry.py +34 -17
  131. pygpi/py.typed +0 -0
  132. cocotb/binary.py +0 -858
  133. cocotb/config.py +0 -289
  134. cocotb/decorators.py +0 -332
  135. cocotb/memdebug.py +0 -35
  136. cocotb/outcomes.py +0 -56
  137. cocotb/scheduler.py +0 -1099
  138. cocotb/share/makefiles/Makefile.deprecations +0 -12
  139. cocotb/share/makefiles/simulators/Makefile.cvc +0 -94
  140. cocotb/share/makefiles/simulators/Makefile.icarus +0 -111
  141. cocotb/share/makefiles/simulators/Makefile.ius +0 -125
  142. cocotb/share/makefiles/simulators/Makefile.modelsim +0 -32
  143. cocotb/share/makefiles/simulators/Makefile.nvc +0 -64
  144. cocotb/share/makefiles/simulators/Makefile.vcs +0 -98
  145. cocotb/types/array.py +0 -309
  146. cocotb/types/logic.py +0 -292
  147. cocotb/types/logic_array.py +0 -298
  148. cocotb/wavedrom.py +0 -199
  149. cocotb/xunit_reporter.py +0 -80
  150. cocotb-1.9.2.dist-info/METADATA +0 -168
  151. cocotb-1.9.2.dist-info/RECORD +0 -121
  152. cocotb-1.9.2.dist-info/entry_points.txt +0 -2
  153. /cocotb/{_vendor/__init__.py → py.typed} +0 -0
  154. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info/licenses}/LICENSE +0 -0
  155. {cocotb → cocotb_tools}/_vendor/distutils_version.py +0 -0
@@ -2,6 +2,8 @@
2
2
  # Licensed under the Revised BSD License, see LICENSE for details.
3
3
  # SPDX-License-Identifier: BSD-3-Clause
4
4
 
5
+ # type: ignore # distutils is untyped, so there's little reason to check this file
6
+
5
7
  """
6
8
  Classes to compare simulation versions.
7
9
 
@@ -11,7 +13,7 @@ These are for cocotb-internal use only.
11
13
  These classes silently allow comparing versions of different simulators.
12
14
  """
13
15
 
14
- from cocotb._vendor.distutils_version import LooseVersion
16
+ from cocotb_tools._vendor.distutils_version import LooseVersion
15
17
 
16
18
 
17
19
  class ActivehdlVersion(LooseVersion):
@@ -21,25 +23,21 @@ class ActivehdlVersion(LooseVersion):
21
23
  ActivehdlVersion("10.5a.12.6914") > ActivehdlVersion("10.5.216.6767")
22
24
  """
23
25
 
24
- pass
25
-
26
26
 
27
27
  class CvcVersion(LooseVersion):
28
28
  """Version numbering class for Tachyon DA CVC.
29
29
 
30
30
  Example:
31
- >>> CvcVersion("OSS_CVC_7.00b-x86_64-rhel6x of 07/07/14 (Linux-elf)") > CvcVersion("OSS_CVC_7.00a-x86_64-rhel6x of 07/07/14 (Linux-elf)")
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)")
32
34
  True
33
35
  """
34
36
 
35
- pass
36
-
37
37
 
38
38
  class GhdlVersion(LooseVersion):
39
39
  """Version numbering class for GHDL."""
40
40
 
41
- pass
42
-
43
41
 
44
42
  class IcarusVersion(LooseVersion):
45
43
  """Version numbering class for Icarus Verilog.
@@ -51,14 +49,10 @@ class IcarusVersion(LooseVersion):
51
49
  True
52
50
  """
53
51
 
54
- pass
55
-
56
52
 
57
53
  class ModelsimVersion(LooseVersion):
58
54
  """Version numbering class for Mentor ModelSim."""
59
55
 
60
- pass
61
-
62
56
 
63
57
  class QuestaVersion(LooseVersion):
64
58
  """Version numbering class for Mentor Questa.
@@ -96,8 +90,6 @@ class RivieraVersion(LooseVersion):
96
90
  True
97
91
  """
98
92
 
99
- pass
100
-
101
93
 
102
94
  class VcsVersion(LooseVersion):
103
95
  """Version numbering class for Synopsys VCS.
@@ -107,8 +99,6 @@ class VcsVersion(LooseVersion):
107
99
  True
108
100
  """
109
101
 
110
- pass
111
-
112
102
 
113
103
  class VerilatorVersion(LooseVersion):
114
104
  """Version numbering class for Verilator.
@@ -118,8 +108,6 @@ class VerilatorVersion(LooseVersion):
118
108
  True
119
109
  """
120
110
 
121
- pass
122
-
123
111
 
124
112
  class XceliumVersion(LooseVersion):
125
113
  """Version numbering class for Cadence Xcelium.
@@ -131,8 +119,6 @@ class XceliumVersion(LooseVersion):
131
119
  True
132
120
  """
133
121
 
134
- pass
135
-
136
122
 
137
123
  class IusVersion(XceliumVersion): # inherit everything from Xcelium
138
124
  """Version numbering class for Cadence IUS.
@@ -142,4 +128,13 @@ class IusVersion(XceliumVersion): # inherit everything from Xcelium
142
128
  True
143
129
  """
144
130
 
145
- pass
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/entry.py CHANGED
@@ -1,26 +1,43 @@
1
1
  import importlib
2
2
  import os
3
3
  from functools import reduce
4
- from types import ModuleType
5
- from typing import Callable, Tuple
4
+ from typing import Any, Callable, List, Tuple, cast
6
5
 
7
6
 
8
- def load_entry() -> Tuple[ModuleType, Callable]:
9
- """Gather entry point information by parsing :envvar:`PYGPI_ENTRY_POINT`."""
7
+ def load_entry(argv: List[str]) -> None:
8
+ """Gather entry point information by parsing :envvar:`PYGPI_USERS`."""
9
+
10
10
  entry_point_str = os.environ.get(
11
- "PYGPI_ENTRY_POINT", "cocotb:_initialise_testbench"
11
+ "PYGPI_USERS",
12
+ ",".join(
13
+ (
14
+ "cocotb_tools._coverage:start_cocotb_library_coverage",
15
+ "cocotb.logging:_init",
16
+ "cocotb.logging:_setup_formatter",
17
+ "cocotb._init:init_package_from_simulation",
18
+ "cocotb._init:run_regression",
19
+ )
20
+ ),
12
21
  )
22
+
23
+ # Parse the entry point string of the form "module:func,module:func,...".
24
+ # Any failure prevents any entry points from being loaded.
25
+ entry_points: List[Tuple[str, str]] = []
13
26
  try:
14
- if ":" not in entry_point_str:
15
- raise ValueError(
16
- "Invalid PYGPI_ENTRY_POINT, missing entry function (no colon)."
17
- )
18
- entry_module_str, entry_func_str = entry_point_str.split(":", 1)
19
- entry_module = importlib.import_module(entry_module_str)
20
- entry_func = reduce(getattr, entry_func_str.split("."), entry_module)
27
+ entry_points_str = entry_point_str.split(",")
28
+ for entry_point_str in entry_points_str:
29
+ entry_module_str, entry_func_str = entry_point_str.split(":")
30
+ # TODO maybe some basic validation of the module and function names.
31
+ # WITHOUT IMPORTING THEM.
32
+ entry_points.append((entry_module_str, entry_func_str))
21
33
  except Exception as e:
22
- raise RuntimeError(
23
- "Failure to parse PYGPI_ENTRY_POINT ('{}')".format(entry_point_str)
24
- ) from e
25
- else:
26
- return entry_module, entry_func
34
+ raise RuntimeError(f"Failure to parse PYGPI_USERS ('{entry_point_str}')") from e
35
+
36
+ # Run all entry points.
37
+ # Expect failure to stop the loading of any additional entry points.
38
+ for entry_module_str, entry_func_str in entry_points:
39
+ entry_module = importlib.import_module(entry_module_str)
40
+ entry_func: Callable[[List[str]], object] = reduce(
41
+ getattr, entry_func_str.split("."), cast("Any", entry_module)
42
+ )
43
+ entry_func(argv)
pygpi/py.typed ADDED
File without changes