cocotb 1.9.2__cp36-cp36m-win32.whl → 2.0.0rc2__cp36-cp36m-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.

Files changed (149) hide show
  1. cocotb/_ANSI.py +65 -0
  2. cocotb/__init__.py +81 -327
  3. cocotb/_base_triggers.py +515 -0
  4. cocotb/_bridge.py +186 -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 +385 -0
  10. cocotb/_init.py +301 -0
  11. cocotb/_outcomes.py +54 -0
  12. cocotb/_profiling.py +46 -0
  13. cocotb/_py_compat.py +114 -29
  14. cocotb/_scheduler.py +448 -0
  15. cocotb/_test.py +248 -0
  16. cocotb/_test_factory.py +312 -0
  17. cocotb/_test_functions.py +42 -0
  18. cocotb/_typing.py +7 -0
  19. cocotb/_utils.py +274 -0
  20. cocotb/_version.py +3 -7
  21. cocotb/_xunit_reporter.py +66 -0
  22. cocotb/clock.py +353 -108
  23. cocotb/debug.py +24 -0
  24. cocotb/handle.py +1370 -793
  25. cocotb/libs/cocotb.dll +0 -0
  26. cocotb/libs/cocotb.exp +0 -0
  27. cocotb/libs/cocotb.lib +0 -0
  28. cocotb/libs/cocotbfli_modelsim.dll +0 -0
  29. cocotb/libs/cocotbfli_modelsim.exp +0 -0
  30. cocotb/libs/cocotbfli_modelsim.lib +0 -0
  31. cocotb/libs/cocotbutils.dll +0 -0
  32. cocotb/libs/cocotbutils.exp +0 -0
  33. cocotb/libs/cocotbutils.lib +0 -0
  34. cocotb/libs/cocotbvhpi_aldec.dll +0 -0
  35. cocotb/libs/cocotbvhpi_aldec.exp +0 -0
  36. cocotb/libs/cocotbvhpi_aldec.lib +0 -0
  37. cocotb/libs/cocotbvhpi_modelsim.dll +0 -0
  38. cocotb/libs/cocotbvhpi_modelsim.exp +0 -0
  39. cocotb/libs/cocotbvhpi_modelsim.lib +0 -0
  40. cocotb/libs/cocotbvpi_aldec.dll +0 -0
  41. cocotb/libs/cocotbvpi_aldec.exp +0 -0
  42. cocotb/libs/cocotbvpi_aldec.lib +0 -0
  43. cocotb/libs/cocotbvpi_ghdl.dll +0 -0
  44. cocotb/libs/cocotbvpi_ghdl.exp +0 -0
  45. cocotb/libs/cocotbvpi_ghdl.lib +0 -0
  46. cocotb/libs/cocotbvpi_icarus.exp +0 -0
  47. cocotb/libs/cocotbvpi_icarus.lib +0 -0
  48. cocotb/libs/cocotbvpi_icarus.vpl +0 -0
  49. cocotb/libs/cocotbvpi_modelsim.dll +0 -0
  50. cocotb/libs/cocotbvpi_modelsim.exp +0 -0
  51. cocotb/libs/cocotbvpi_modelsim.lib +0 -0
  52. cocotb/libs/embed.dll +0 -0
  53. cocotb/libs/embed.exp +0 -0
  54. cocotb/libs/embed.lib +0 -0
  55. cocotb/libs/gpi.dll +0 -0
  56. cocotb/libs/gpi.exp +0 -0
  57. cocotb/libs/gpi.lib +0 -0
  58. cocotb/libs/gpilog.dll +0 -0
  59. cocotb/libs/gpilog.exp +0 -0
  60. cocotb/libs/gpilog.lib +0 -0
  61. cocotb/libs/pygpilog.dll +0 -0
  62. cocotb/libs/pygpilog.exp +0 -0
  63. cocotb/libs/pygpilog.lib +0 -0
  64. cocotb/logging.py +424 -0
  65. cocotb/queue.py +103 -57
  66. cocotb/regression.py +680 -717
  67. cocotb/result.py +17 -188
  68. cocotb/share/def/modelsim.def +1 -0
  69. cocotb/share/include/cocotb_utils.h +9 -32
  70. cocotb/share/include/embed.h +7 -30
  71. cocotb/share/include/gpi.h +331 -137
  72. cocotb/share/include/gpi_logging.h +221 -142
  73. cocotb/share/include/py_gpi_logging.h +8 -5
  74. cocotb/share/include/vpi_user_ext.h +4 -26
  75. cocotb/share/lib/verilator/verilator.cpp +80 -67
  76. cocotb/simtime.py +230 -0
  77. cocotb/simulator.cp36-win32.exp +0 -0
  78. cocotb/simulator.cp36-win32.lib +0 -0
  79. cocotb/simulator.cp36-win32.pyd +0 -0
  80. cocotb/task.py +478 -213
  81. cocotb/triggers.py +55 -1092
  82. cocotb/types/__init__.py +28 -47
  83. cocotb/types/_abstract_array.py +151 -0
  84. cocotb/types/_array.py +295 -0
  85. cocotb/types/_indexing.py +17 -0
  86. cocotb/types/_logic.py +333 -0
  87. cocotb/types/_logic_array.py +868 -0
  88. cocotb/types/{range.py → _range.py} +47 -48
  89. cocotb/types/_resolve.py +76 -0
  90. cocotb/utils.py +58 -646
  91. {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/LICENSE +1 -0
  92. cocotb-2.0.0rc2.dist-info/METADATA +48 -0
  93. cocotb-2.0.0rc2.dist-info/RECORD +134 -0
  94. cocotb-2.0.0rc2.dist-info/entry_points.txt +3 -0
  95. {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/top_level.txt +1 -0
  96. cocotb_tools/_coverage.py +33 -0
  97. cocotb_tools/_vendor/__init__.py +3 -0
  98. cocotb_tools/check_results.py +65 -0
  99. cocotb_tools/combine_results.py +152 -0
  100. cocotb_tools/config.py +241 -0
  101. {cocotb → cocotb_tools}/ipython_support.py +29 -22
  102. cocotb_tools/makefiles/Makefile.deprecations +27 -0
  103. {cocotb/share → cocotb_tools}/makefiles/Makefile.inc +77 -55
  104. {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +16 -33
  105. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.activehdl +9 -16
  106. cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
  107. cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
  108. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.ghdl +13 -42
  109. cocotb_tools/makefiles/simulators/Makefile.icarus +80 -0
  110. cocotb_tools/makefiles/simulators/Makefile.ius +93 -0
  111. cocotb_tools/makefiles/simulators/Makefile.modelsim +9 -0
  112. cocotb_tools/makefiles/simulators/Makefile.nvc +60 -0
  113. cocotb_tools/makefiles/simulators/Makefile.questa +29 -0
  114. cocotb/share/makefiles/simulators/Makefile.questa → cocotb_tools/makefiles/simulators/Makefile.questa-compat +26 -54
  115. cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
  116. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.riviera +17 -56
  117. cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
  118. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.verilator +15 -22
  119. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.xcelium +20 -52
  120. cocotb_tools/runner.py +1868 -0
  121. cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
  122. pygpi/entry.py +34 -18
  123. cocotb/ANSI.py +0 -92
  124. cocotb/binary.py +0 -858
  125. cocotb/config.py +0 -289
  126. cocotb/decorators.py +0 -332
  127. cocotb/log.py +0 -303
  128. cocotb/memdebug.py +0 -35
  129. cocotb/outcomes.py +0 -56
  130. cocotb/runner.py +0 -1400
  131. cocotb/scheduler.py +0 -1099
  132. cocotb/share/makefiles/Makefile.deprecations +0 -12
  133. cocotb/share/makefiles/simulators/Makefile.cvc +0 -94
  134. cocotb/share/makefiles/simulators/Makefile.icarus +0 -111
  135. cocotb/share/makefiles/simulators/Makefile.ius +0 -125
  136. cocotb/share/makefiles/simulators/Makefile.modelsim +0 -32
  137. cocotb/share/makefiles/simulators/Makefile.nvc +0 -64
  138. cocotb/share/makefiles/simulators/Makefile.vcs +0 -98
  139. cocotb/types/array.py +0 -309
  140. cocotb/types/logic.py +0 -292
  141. cocotb/types/logic_array.py +0 -298
  142. cocotb/wavedrom.py +0 -199
  143. cocotb/xunit_reporter.py +0 -80
  144. cocotb-1.9.2.dist-info/METADATA +0 -170
  145. cocotb-1.9.2.dist-info/RECORD +0 -113
  146. cocotb-1.9.2.dist-info/entry_points.txt +0 -3
  147. {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/WHEEL +0 -0
  148. {cocotb/_vendor → cocotb_tools}/__init__.py +0 -0
  149. {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,42 @@
1
1
  import importlib
2
+ import operator
2
3
  import os
3
- from functools import reduce
4
- from types import ModuleType
5
- from typing import Callable, Tuple
4
+ from typing import Callable, List, Tuple
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:_configure",
16
+ "cocotb._init:init_package_from_simulation",
17
+ "cocotb._init:run_regression",
18
+ )
19
+ ),
12
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]] = []
13
25
  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)
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))
21
32
  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
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)
cocotb/ANSI.py DELETED
@@ -1,92 +0,0 @@
1
- # Copyright (c) 2013, 2018 Potential Ventures Ltd
2
- # Copyright (c) 2013 SolarFlare Communications Inc
3
- # All rights reserved.
4
- #
5
- # Redistribution and use in source and binary forms, with or without
6
- # modification, are permitted provided that the following conditions are met:
7
- # * Redistributions of source code must retain the above copyright
8
- # notice, this list of conditions and the following disclaimer.
9
- # * Redistributions in binary form must reproduce the above copyright
10
- # notice, this list of conditions and the following disclaimer in the
11
- # documentation and/or other materials provided with the distribution.
12
- # * Neither the name of Potential Ventures Ltd,
13
- # SolarFlare Communications Inc nor the
14
- # names of its contributors may be used to endorse or promote products
15
- # derived from this software without specific prior written permission.
16
- #
17
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
- # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- # DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY
21
- # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
- # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
- # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
- # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- """
29
- Some constants for doing ANSI stuff.
30
- """
31
- # flake8: noqa (skip this file for flake8: pypi.python.org/pypi/flake8)
32
- _ESCAPE = "\033["
33
-
34
- # see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
35
-
36
- DEFAULT_FG = _ESCAPE + "39m"
37
- DEFAULT_BG = _ESCAPE + "49m"
38
- DEFAULT = DEFAULT_BG + DEFAULT_FG
39
-
40
- BLACK_FG = _ESCAPE + "30m"
41
- RED_FG = _ESCAPE + "31m"
42
- GREEN_FG = _ESCAPE + "32m"
43
- YELLOW_FG = _ESCAPE + "33m"
44
- BLUE_FG = _ESCAPE + "34m"
45
- MAGENTA_FG = _ESCAPE + "35m"
46
- CYAN_FG = _ESCAPE + "36m"
47
- WHITE_FG = _ESCAPE + "37m"
48
-
49
- BLACK_BG = _ESCAPE + "40m"
50
- RED_BG = _ESCAPE + "41m"
51
- GREEN_BG = _ESCAPE + "42m"
52
- YELLOW_BG = _ESCAPE + "43m"
53
- BLUE_BG = _ESCAPE + "44m"
54
- MAGENTA_BG = _ESCAPE + "45m"
55
- CYAN_BG = _ESCAPE + "46m"
56
- WHITE_BG = _ESCAPE + "47m"
57
-
58
- BRIGHT_BLACK_FG = _ESCAPE + "90m"
59
- BRIGHT_RED_FG = _ESCAPE + "91m"
60
- BRIGHT_GREEN_FG = _ESCAPE + "92m"
61
- BRIGHT_YELLOW_FG = _ESCAPE + "93m"
62
- BRIGHT_BLUE_FG = _ESCAPE + "94m"
63
- BRIGHT_MAGENTA_FG = _ESCAPE + "95m"
64
- BRIGHT_CYAN_FG = _ESCAPE + "96m"
65
- BRIGHT_WHITE_FG = _ESCAPE + "97m"
66
-
67
- BRIGHT_BLACK_BG = _ESCAPE + "100m"
68
- BRIGHT_RED_BG = _ESCAPE + "101m"
69
- BRIGHT_GREEN_BG = _ESCAPE + "102m"
70
- BRIGHT_YELLOW_BG = _ESCAPE + "103m"
71
- BRIGHT_BLUE_BG = _ESCAPE + "104m"
72
- BRIGHT_MAGENTA_BG = _ESCAPE + "105m"
73
- BRIGHT_CYAN_BG = _ESCAPE + "106m"
74
- BRIGHT_WHITE_BG = _ESCAPE + "107m"
75
-
76
-
77
- COLOR_DEFAULT = DEFAULT
78
-
79
- COLOR_WARNING = YELLOW_FG
80
- COLOR_ERROR = RED_FG
81
- COLOR_CRITICAL = RED_BG + BLACK_FG
82
- COLOR_TEST = BLUE_FG
83
- COLOR_PASSED = GREEN_FG
84
- COLOR_SKIPPED = YELLOW_FG
85
- COLOR_FAILED = RED_FG
86
-
87
- COLOR_HILITE_SUMMARY = WHITE_FG + RED_BG
88
- COLOR_HILITE_HEXDIFF_DEFAULT = YELLOW_FG
89
- COLOR_HILITE_HEXDIFF_1 = CYAN_FG
90
- COLOR_HILITE_HEXDIFF_2 = RED_FG
91
- COLOR_HILITE_HEXDIFF_3 = MAGENTA_BG
92
- COLOR_HILITE_HEXDIFF_4 = CYAN_BG + BLACK_FG