cocotb 1.8.1__cp36-cp36m-win_amd64.whl → 1.9.0__cp36-cp36m-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 (79) hide show
  1. cocotb/_version.py +1 -1
  2. cocotb/binary.py +48 -14
  3. cocotb/config.py +10 -16
  4. cocotb/decorators.py +7 -1
  5. cocotb/handle.py +1 -1
  6. cocotb/libs/cocotb.dll +0 -0
  7. cocotb/libs/cocotb.exp +0 -0
  8. cocotb/libs/cocotb.lib +0 -0
  9. cocotb/libs/cocotbfli_modelsim.dll +0 -0
  10. cocotb/libs/cocotbfli_modelsim.exp +0 -0
  11. cocotb/libs/cocotbfli_modelsim.lib +0 -0
  12. cocotb/libs/cocotbutils.dll +0 -0
  13. cocotb/libs/cocotbutils.exp +0 -0
  14. cocotb/libs/cocotbutils.lib +0 -0
  15. cocotb/libs/cocotbvhpi_aldec.dll +0 -0
  16. cocotb/libs/cocotbvhpi_aldec.exp +0 -0
  17. cocotb/libs/cocotbvhpi_aldec.lib +0 -0
  18. cocotb/libs/cocotbvhpi_modelsim.dll +0 -0
  19. cocotb/libs/cocotbvhpi_modelsim.exp +0 -0
  20. cocotb/libs/cocotbvhpi_modelsim.lib +0 -0
  21. cocotb/libs/cocotbvpi_aldec.dll +0 -0
  22. cocotb/libs/cocotbvpi_aldec.exp +0 -0
  23. cocotb/libs/cocotbvpi_aldec.lib +0 -0
  24. cocotb/libs/cocotbvpi_ghdl.dll +0 -0
  25. cocotb/libs/cocotbvpi_ghdl.exp +0 -0
  26. cocotb/libs/cocotbvpi_ghdl.lib +0 -0
  27. cocotb/libs/cocotbvpi_icarus.exp +0 -0
  28. cocotb/libs/cocotbvpi_icarus.lib +0 -0
  29. cocotb/libs/cocotbvpi_icarus.vpl +0 -0
  30. cocotb/libs/cocotbvpi_modelsim.dll +0 -0
  31. cocotb/libs/cocotbvpi_modelsim.exp +0 -0
  32. cocotb/libs/cocotbvpi_modelsim.lib +0 -0
  33. cocotb/libs/embed.dll +0 -0
  34. cocotb/libs/embed.exp +0 -0
  35. cocotb/libs/embed.lib +0 -0
  36. cocotb/libs/gpi.dll +0 -0
  37. cocotb/libs/gpi.exp +0 -0
  38. cocotb/libs/gpi.lib +0 -0
  39. cocotb/libs/gpilog.dll +0 -0
  40. cocotb/libs/gpilog.exp +0 -0
  41. cocotb/libs/gpilog.lib +0 -0
  42. cocotb/libs/pygpilog.dll +0 -0
  43. cocotb/libs/pygpilog.exp +0 -0
  44. cocotb/libs/pygpilog.lib +0 -0
  45. cocotb/runner.py +487 -120
  46. cocotb/scheduler.py +4 -8
  47. cocotb/share/def/aldec.exp +0 -0
  48. cocotb/share/def/aldec.lib +0 -0
  49. cocotb/share/def/ghdl.exp +0 -0
  50. cocotb/share/def/ghdl.lib +0 -0
  51. cocotb/share/def/icarus.exp +0 -0
  52. cocotb/share/def/icarus.lib +0 -0
  53. cocotb/share/def/modelsim.exp +0 -0
  54. cocotb/share/def/modelsim.lib +0 -0
  55. cocotb/share/lib/verilator/verilator.cpp +52 -9
  56. cocotb/share/makefiles/Makefile.inc +4 -10
  57. cocotb/share/makefiles/Makefile.sim +5 -5
  58. cocotb/share/makefiles/simulators/Makefile.activehdl +3 -3
  59. cocotb/share/makefiles/simulators/Makefile.cvc +1 -1
  60. cocotb/share/makefiles/simulators/Makefile.ghdl +29 -1
  61. cocotb/share/makefiles/simulators/Makefile.icarus +4 -4
  62. cocotb/share/makefiles/simulators/Makefile.ius +1 -1
  63. cocotb/share/makefiles/simulators/Makefile.nvc +64 -0
  64. cocotb/share/makefiles/simulators/Makefile.questa +1 -1
  65. cocotb/share/makefiles/simulators/Makefile.riviera +28 -12
  66. cocotb/share/makefiles/simulators/Makefile.vcs +2 -2
  67. cocotb/share/makefiles/simulators/Makefile.verilator +11 -5
  68. cocotb/share/makefiles/simulators/Makefile.xcelium +6 -1
  69. cocotb/simulator.cp36-win_amd64.exp +0 -0
  70. cocotb/simulator.cp36-win_amd64.lib +0 -0
  71. cocotb/simulator.cp36-win_amd64.pyd +0 -0
  72. cocotb/triggers.py +102 -29
  73. {cocotb-1.8.1.dist-info → cocotb-1.9.0.dist-info}/METADATA +3 -3
  74. cocotb-1.9.0.dist-info/RECORD +121 -0
  75. cocotb-1.8.1.dist-info/RECORD +0 -120
  76. {cocotb-1.8.1.dist-info → cocotb-1.9.0.dist-info}/LICENSE +0 -0
  77. {cocotb-1.8.1.dist-info → cocotb-1.9.0.dist-info}/WHEEL +0 -0
  78. {cocotb-1.8.1.dist-info → cocotb-1.9.0.dist-info}/entry_points.txt +0 -0
  79. {cocotb-1.8.1.dist-info → cocotb-1.9.0.dist-info}/top_level.txt +0 -0
cocotb/_version.py CHANGED
@@ -5,4 +5,4 @@
5
5
  # 1) we don't load dependencies by storing it in __init__.py
6
6
  # 2) we can import it in setup.py for the same reason
7
7
  # 3) we can import it into your module
8
- __version__ = "1.8.1"
8
+ __version__ = "1.9.0"
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
- resolve_x_to = os.getenv("COCOTB_RESOLVE_X", "VALUE_ERROR")
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 == "VALUE_ERROR":
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: '{}'".format(chr(key))
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 == "ZEROS":
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 == "ONES":
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 == "RANDOM":
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
- other = other.value
544
- return self.value == other
545
-
546
- def __ne__(self, other):
547
- if isinstance(other, BinaryValue):
548
- other = other.value
549
- return self.value != other
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 = os.path.join(os.path.dirname(cocotb.__file__), "share")
55
- makefiles_dir = os.path.join(os.path.dirname(cocotb.__file__), "share", "makefiles")
56
- libs_dir = os.path.join(os.path.dirname(cocotb.__file__), "libs")
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
- # On Windows use mixed mode "c:/a/b/c" as this work in all cases
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 = os.path.dirname(os.path.dirname(cocotb.__file__))
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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