cocotb 1.9.2__cp38-cp38-win32.whl → 2.0.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/_ANSI.py +65 -0
- cocotb/__init__.py +81 -327
- cocotb/_base_triggers.py +515 -0
- cocotb/_bridge.py +186 -0
- cocotb/_decorators.py +515 -0
- cocotb/_deprecation.py +3 -3
- 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 +114 -29
- 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 +3 -7
- cocotb/_xunit_reporter.py +66 -0
- cocotb/clock.py +353 -108
- cocotb/debug.py +24 -0
- cocotb/handle.py +1370 -793
- 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/logging.py +424 -0
- cocotb/queue.py +103 -57
- cocotb/regression.py +680 -717
- cocotb/result.py +17 -188
- 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.def +1 -0
- cocotb/share/def/modelsim.exp +0 -0
- cocotb/share/def/modelsim.lib +0 -0
- cocotb/share/include/cocotb_utils.h +9 -32
- cocotb/share/include/embed.h +7 -30
- cocotb/share/include/gpi.h +331 -137
- cocotb/share/include/gpi_logging.h +221 -142
- cocotb/share/include/py_gpi_logging.h +8 -5
- cocotb/share/include/vpi_user_ext.h +4 -26
- cocotb/share/lib/verilator/verilator.cpp +80 -67
- cocotb/simtime.py +230 -0
- cocotb/simulator.cp38-win32.exp +0 -0
- cocotb/simulator.cp38-win32.lib +0 -0
- cocotb/simulator.cp38-win32.pyd +0 -0
- cocotb/simulator.pyi +107 -0
- cocotb/task.py +478 -213
- cocotb/triggers.py +55 -1092
- cocotb/types/__init__.py +28 -47
- 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 → _range.py} +47 -48
- cocotb/types/_resolve.py +76 -0
- cocotb/utils.py +58 -646
- {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/LICENSE +1 -0
- cocotb-2.0.0rc2.dist-info/METADATA +46 -0
- cocotb-2.0.0rc2.dist-info/RECORD +146 -0
- {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/WHEEL +1 -1
- cocotb-2.0.0rc2.dist-info/entry_points.txt +2 -0
- {cocotb-1.9.2.dist-info → cocotb-2.0.0rc2.dist-info}/top_level.txt +1 -0
- cocotb_tools/__init__.py +0 -0
- cocotb_tools/_coverage.py +33 -0
- cocotb_tools/_vendor/__init__.py +3 -0
- cocotb_tools/check_results.py +65 -0
- cocotb_tools/combine_results.py +152 -0
- cocotb_tools/config.py +241 -0
- {cocotb → cocotb_tools}/ipython_support.py +29 -22
- cocotb_tools/makefiles/Makefile.deprecations +27 -0
- {cocotb/share → cocotb_tools}/makefiles/Makefile.inc +77 -55
- {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +16 -33
- {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.activehdl +9 -16
- cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
- cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
- {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.ghdl +13 -42
- 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/share/makefiles/simulators/Makefile.questa → cocotb_tools/makefiles/simulators/Makefile.questa-compat +26 -54
- cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
- {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.riviera +17 -56
- cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
- {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.verilator +15 -22
- {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.xcelium +20 -52
- cocotb_tools/py.typed +0 -0
- cocotb_tools/runner.py +1868 -0
- cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
- pygpi/entry.py +34 -18
- pygpi/py.typed +0 -0
- cocotb/ANSI.py +0 -92
- cocotb/binary.py +0 -858
- cocotb/config.py +0 -289
- cocotb/decorators.py +0 -332
- cocotb/log.py +0 -303
- cocotb/memdebug.py +0 -35
- cocotb/outcomes.py +0 -56
- cocotb/runner.py +0 -1400
- cocotb/scheduler.py +0 -1099
- cocotb/share/makefiles/Makefile.deprecations +0 -12
- cocotb/share/makefiles/simulators/Makefile.cvc +0 -94
- cocotb/share/makefiles/simulators/Makefile.icarus +0 -111
- cocotb/share/makefiles/simulators/Makefile.ius +0 -125
- cocotb/share/makefiles/simulators/Makefile.modelsim +0 -32
- cocotb/share/makefiles/simulators/Makefile.nvc +0 -64
- cocotb/share/makefiles/simulators/Makefile.vcs +0 -98
- cocotb/types/array.py +0 -309
- cocotb/types/logic.py +0 -292
- cocotb/types/logic_array.py +0 -298
- cocotb/wavedrom.py +0 -199
- cocotb/xunit_reporter.py +0 -80
- cocotb-1.9.2.dist-info/METADATA +0 -168
- cocotb-1.9.2.dist-info/RECORD +0 -121
- cocotb-1.9.2.dist-info/entry_points.txt +0 -2
- /cocotb/{_vendor/__init__.py → py.typed} +0 -0
- {cocotb → cocotb_tools}/_vendor/distutils_version.py +0 -0
cocotb/result.py
CHANGED
|
@@ -1,209 +1,38 @@
|
|
|
1
|
-
# Copyright
|
|
2
|
-
#
|
|
3
|
-
#
|
|
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
|
-
import sys
|
|
29
|
-
|
|
30
|
-
# TODO: Could use cStringIO?
|
|
31
|
-
import traceback
|
|
1
|
+
# Copyright cocotb contributors
|
|
2
|
+
# Licensed under the Revised BSD License, see LICENSE for details.
|
|
3
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
32
4
|
import warnings
|
|
33
|
-
from io import StringIO
|
|
34
|
-
|
|
35
|
-
"""Exceptions and functions for simulation result handling."""
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def raise_error(obj, msg):
|
|
39
|
-
"""Create a :exc:`TestError` exception and raise it after printing a traceback.
|
|
40
|
-
|
|
41
|
-
.. deprecated:: 1.3
|
|
42
|
-
Raise a standard Python exception instead of calling this function.
|
|
43
|
-
A stacktrace will be printed by cocotb automatically if the exception is unhandled.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
obj: Object with a log method.
|
|
47
|
-
msg (str): The log message.
|
|
48
|
-
"""
|
|
49
|
-
warnings.warn(
|
|
50
|
-
"``raise_error`` is deprecated - raise a standard Exception instead",
|
|
51
|
-
DeprecationWarning,
|
|
52
|
-
stacklevel=2,
|
|
53
|
-
)
|
|
54
|
-
_raise_error(obj, msg)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def _raise_error(obj, msg):
|
|
58
|
-
exc_info = sys.exc_info()
|
|
59
|
-
buff = StringIO()
|
|
60
|
-
traceback.print_exception(*exc_info, file=buff)
|
|
61
|
-
obj.log.error(f"{msg}\n{buff.getvalue()}")
|
|
62
|
-
exception = TestError(msg)
|
|
63
|
-
exception.stderr.write(buff.getvalue())
|
|
64
|
-
raise exception
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def create_error(obj, msg):
|
|
68
|
-
"""Like :func:`raise_error`, but return the exception rather than raise it,
|
|
69
|
-
simply to avoid too many levels of nested `try/except` blocks.
|
|
70
5
|
|
|
71
|
-
.. deprecated:: 1.3
|
|
72
|
-
Raise a standard Python exception instead of calling this function.
|
|
73
6
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
msg (str): The log message.
|
|
77
|
-
"""
|
|
78
|
-
warnings.warn(
|
|
79
|
-
"``create_error`` is deprecated - raise a standard Exception instead",
|
|
80
|
-
DeprecationWarning,
|
|
81
|
-
stacklevel=2,
|
|
82
|
-
)
|
|
83
|
-
try:
|
|
84
|
-
# use the private version to avoid multiple warnings
|
|
85
|
-
_raise_error(obj, msg)
|
|
86
|
-
except TestError as error:
|
|
87
|
-
return error
|
|
88
|
-
return TestError("Creating error traceback failed")
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class ReturnValue(Exception):
|
|
92
|
-
"""
|
|
93
|
-
Helper exception needed for Python versions prior to 3.3.
|
|
94
|
-
|
|
95
|
-
.. deprecated:: 1.4
|
|
96
|
-
Use a :keyword:`return` statement instead; this works in all supported versions of Python.
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
def __init__(self, retval):
|
|
7
|
+
def __getattr__(name: str) -> object:
|
|
8
|
+
if name == "TestSuccess":
|
|
100
9
|
warnings.warn(
|
|
101
|
-
"
|
|
10
|
+
"`raise TestSuccess` is deprecated. Use `cocotb.pass_test()` instead.",
|
|
102
11
|
DeprecationWarning,
|
|
103
12
|
stacklevel=2,
|
|
104
13
|
)
|
|
105
|
-
|
|
106
|
-
|
|
14
|
+
from cocotb._test_functions import TestSuccess # noqa: PLC0415
|
|
107
15
|
|
|
108
|
-
|
|
109
|
-
"""
|
|
110
|
-
Exception showing that the test was completed. Sub-exceptions detail the exit status.
|
|
16
|
+
return TestSuccess
|
|
111
17
|
|
|
112
|
-
|
|
113
|
-
The ``stdout`` and ``stderr`` attributes.
|
|
114
|
-
"""
|
|
115
|
-
|
|
116
|
-
def __init__(self, *args, **kwargs):
|
|
117
|
-
super().__init__(*args, **kwargs)
|
|
118
|
-
self.__stdout = StringIO()
|
|
119
|
-
self.__stderr = StringIO()
|
|
120
|
-
|
|
121
|
-
@staticmethod
|
|
122
|
-
def __deprecated(which: str) -> None:
|
|
18
|
+
elif name == "SimFailure":
|
|
123
19
|
warnings.warn(
|
|
124
|
-
|
|
125
|
-
DeprecationWarning,
|
|
126
|
-
stacklevel=3,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
@property
|
|
130
|
-
def stdout(self) -> StringIO:
|
|
131
|
-
self.__deprecated("stdout")
|
|
132
|
-
return self.__stdout
|
|
133
|
-
|
|
134
|
-
@stdout.setter
|
|
135
|
-
def stdout(self, new_value: StringIO) -> None:
|
|
136
|
-
self.__deprecated("stdout")
|
|
137
|
-
self.__stdout = new_value
|
|
138
|
-
|
|
139
|
-
@property
|
|
140
|
-
def stderr(self) -> StringIO:
|
|
141
|
-
self.__deprecated("stderr")
|
|
142
|
-
return self.__stderr
|
|
143
|
-
|
|
144
|
-
@stderr.setter
|
|
145
|
-
def stderr(self, new_value: StringIO) -> None:
|
|
146
|
-
self.__deprecated("stderr")
|
|
147
|
-
self.__stderr = new_value
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class ExternalException(Exception):
|
|
151
|
-
"""Exception thrown by :class:`cocotb.external` functions."""
|
|
152
|
-
|
|
153
|
-
def __init__(self, exception):
|
|
154
|
-
self.exception = exception
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
class TestError(TestComplete):
|
|
158
|
-
"""
|
|
159
|
-
Exception showing that the test was completed with severity Error.
|
|
160
|
-
|
|
161
|
-
.. deprecated:: 1.5
|
|
162
|
-
Raise a standard Python exception instead.
|
|
163
|
-
A stacktrace will be printed by cocotb automatically if the exception is unhandled.
|
|
164
|
-
"""
|
|
165
|
-
|
|
166
|
-
def __init__(self, *args, **kwargs):
|
|
167
|
-
warnings.warn(
|
|
168
|
-
"TestError is deprecated - raise a standard Exception instead",
|
|
20
|
+
"SimFailure was moved to `cocotb.regression`.",
|
|
169
21
|
DeprecationWarning,
|
|
170
22
|
stacklevel=2,
|
|
171
23
|
)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
class TestFailure(TestComplete, AssertionError):
|
|
176
|
-
"""
|
|
177
|
-
Exception showing that the test was completed with severity Failure.
|
|
24
|
+
from cocotb.regression import SimFailure # noqa: PLC0415
|
|
178
25
|
|
|
179
|
-
|
|
180
|
-
Use a standard ``assert`` statement instead of raising this exception.
|
|
181
|
-
Use ``expect_fail`` rather than ``expect_error`` with this exception in the
|
|
182
|
-
:class:`cocotb.test` decorator.
|
|
183
|
-
"""
|
|
26
|
+
return SimFailure
|
|
184
27
|
|
|
185
|
-
|
|
28
|
+
elif name == "SimTimeoutError":
|
|
186
29
|
warnings.warn(
|
|
187
|
-
"
|
|
30
|
+
"SimTimeoutError was moved from `cocotb.result` to `cocotb.triggers`.",
|
|
188
31
|
DeprecationWarning,
|
|
189
32
|
stacklevel=2,
|
|
190
33
|
)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
class TestSuccess(TestComplete):
|
|
195
|
-
"""Exception showing that the test was completed successfully."""
|
|
196
|
-
|
|
197
|
-
pass
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
class SimFailure(TestComplete):
|
|
201
|
-
"""Exception showing that the simulator exited unsuccessfully."""
|
|
202
|
-
|
|
203
|
-
pass
|
|
204
|
-
|
|
34
|
+
from cocotb.triggers import SimTimeoutError # noqa: PLC0415
|
|
205
35
|
|
|
206
|
-
|
|
207
|
-
"""Exception for when a timeout, in terms of simulation time, occurs."""
|
|
36
|
+
return SimTimeoutError
|
|
208
37
|
|
|
209
|
-
|
|
38
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
cocotb/share/def/aldec.exp
CHANGED
|
Binary file
|
cocotb/share/def/aldec.lib
CHANGED
|
Binary file
|
cocotb/share/def/ghdl.exp
CHANGED
|
Binary file
|
cocotb/share/def/ghdl.lib
CHANGED
|
Binary file
|
cocotb/share/def/icarus.exp
CHANGED
|
Binary file
|
cocotb/share/def/icarus.lib
CHANGED
|
Binary file
|
cocotb/share/def/modelsim.def
CHANGED
cocotb/share/def/modelsim.exp
CHANGED
|
Binary file
|
cocotb/share/def/modelsim.lib
CHANGED
|
Binary file
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Redistribution and use in source and binary forms, with or without
|
|
7
|
-
* modification, are permitted provided that the following conditions are met:
|
|
8
|
-
* * Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* * Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
* * Neither the name of Potential Ventures Ltd,
|
|
14
|
-
* SolarFlare Communications Inc nor the
|
|
15
|
-
* names of its contributors may be used to endorse or promote products
|
|
16
|
-
* derived from this software without specific prior written permission.
|
|
17
|
-
*
|
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
27
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
******************************************************************************/
|
|
1
|
+
// Copyright cocotb contributors
|
|
2
|
+
// Copyright (c) 2013 Potential Ventures Ltd
|
|
3
|
+
// Copyright (c) 2013 SolarFlare Communications Inc
|
|
4
|
+
// Licensed under the Revised BSD License, see LICENSE for details.
|
|
5
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
29
6
|
|
|
30
7
|
#ifndef COCOTB_UTILS_H_
|
|
31
8
|
#define COCOTB_UTILS_H_
|
|
@@ -42,9 +19,9 @@
|
|
|
42
19
|
#define xstr(a) str(a)
|
|
43
20
|
#define str(a) #a
|
|
44
21
|
|
|
45
|
-
extern "C" COCOTBUTILS_EXPORT void*
|
|
46
|
-
extern "C" COCOTBUTILS_EXPORT void*
|
|
47
|
-
const char*
|
|
22
|
+
extern "C" COCOTBUTILS_EXPORT void *utils_dyn_open(const char *lib_name);
|
|
23
|
+
extern "C" COCOTBUTILS_EXPORT void *utils_dyn_sym(void *handle,
|
|
24
|
+
const char *sym_name);
|
|
48
25
|
extern "C" COCOTBUTILS_EXPORT int is_python_context;
|
|
49
26
|
|
|
50
27
|
// to_python and to_simulator are implemented as macros instead of functions so
|
|
@@ -73,7 +50,7 @@ extern "C" COCOTBUTILS_EXPORT int is_python_context;
|
|
|
73
50
|
template <typename F>
|
|
74
51
|
class Deferable {
|
|
75
52
|
public:
|
|
76
|
-
constexpr Deferable(F f) : f_(f){};
|
|
53
|
+
constexpr Deferable(F f) : f_(f) {};
|
|
77
54
|
~Deferable() { f_(); }
|
|
78
55
|
|
|
79
56
|
private:
|
cocotb/share/include/embed.h
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Redistribution and use in source and binary forms, with or without
|
|
7
|
-
* modification, are permitted provided that the following conditions are met:
|
|
8
|
-
* * Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* * Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
* * Neither the name of Potential Ventures Ltd,
|
|
14
|
-
* SolarFlare Communications Inc nor the
|
|
15
|
-
* names of its contributors may be used to endorse or promote products
|
|
16
|
-
* derived from this software without specific prior written permission.
|
|
17
|
-
*
|
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL POTENTIAL VENTURES LTD BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
27
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
******************************************************************************/
|
|
1
|
+
// Copyright cocotb contributors
|
|
2
|
+
// Copyright (c) 2013 Potential Ventures Ltd
|
|
3
|
+
// Copyright (c) 2013 SolarFlare Communications Inc
|
|
4
|
+
// Licensed under the Revised BSD License, see LICENSE for details.
|
|
5
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
29
6
|
|
|
30
7
|
#ifndef COCOTB_EMBED_H_
|
|
31
8
|
#define COCOTB_EMBED_H_
|
|
@@ -46,8 +23,8 @@ extern "C" {
|
|
|
46
23
|
extern COCOTB_EMBED_EXPORT void embed_init_python(void);
|
|
47
24
|
extern COCOTB_EMBED_EXPORT void embed_sim_cleanup(void);
|
|
48
25
|
extern COCOTB_EMBED_EXPORT int embed_sim_init(int argc,
|
|
49
|
-
char const*
|
|
50
|
-
extern COCOTB_EMBED_EXPORT void embed_sim_event(const char*
|
|
26
|
+
char const *const *argv);
|
|
27
|
+
extern COCOTB_EMBED_EXPORT void embed_sim_event(const char *msg);
|
|
51
28
|
|
|
52
29
|
#ifdef __cplusplus
|
|
53
30
|
}
|