cocotb 1.9.2__cp36-cp36m-win_amd64.whl → 2.0.0b1__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 (151) 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.cp36-win_amd64.exp +0 -0
  84. cocotb/simulator.cp36-win_amd64.lib +0 -0
  85. cocotb/simulator.cp36-win_amd64.pyd +0 -0
  86. cocotb/task.py +434 -212
  87. cocotb/triggers.py +55 -1092
  88. cocotb/types/__init__.py +25 -47
  89. cocotb/types/_abstract_array.py +151 -0
  90. cocotb/types/_array.py +264 -0
  91. cocotb/types/_logic.py +296 -0
  92. cocotb/types/_logic_array.py +834 -0
  93. cocotb/types/{range.py → _range.py} +36 -44
  94. cocotb/types/_resolve.py +76 -0
  95. cocotb/utils.py +119 -587
  96. cocotb-2.0.0b1.dist-info/METADATA +48 -0
  97. cocotb-2.0.0b1.dist-info/RECORD +139 -0
  98. cocotb-2.0.0b1.dist-info/entry_points.txt +3 -0
  99. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/top_level.txt +1 -0
  100. cocotb_tools/_coverage.py +33 -0
  101. cocotb_tools/_vendor/__init__.py +3 -0
  102. cocotb_tools/check_results.py +65 -0
  103. cocotb_tools/combine_results.py +152 -0
  104. cocotb_tools/config.py +241 -0
  105. {cocotb → cocotb_tools}/ipython_support.py +29 -22
  106. cocotb_tools/makefiles/Makefile.deprecations +27 -0
  107. {cocotb/share → cocotb_tools}/makefiles/Makefile.inc +82 -54
  108. {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +8 -33
  109. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.activehdl +9 -16
  110. cocotb_tools/makefiles/simulators/Makefile.cvc +61 -0
  111. cocotb_tools/makefiles/simulators/Makefile.dsim +39 -0
  112. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.ghdl +13 -42
  113. cocotb_tools/makefiles/simulators/Makefile.icarus +80 -0
  114. cocotb_tools/makefiles/simulators/Makefile.ius +93 -0
  115. cocotb_tools/makefiles/simulators/Makefile.modelsim +9 -0
  116. cocotb_tools/makefiles/simulators/Makefile.nvc +60 -0
  117. cocotb_tools/makefiles/simulators/Makefile.questa +29 -0
  118. cocotb/share/makefiles/simulators/Makefile.questa → cocotb_tools/makefiles/simulators/Makefile.questa-compat +26 -54
  119. cocotb_tools/makefiles/simulators/Makefile.questa-qisqrun +149 -0
  120. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.riviera +17 -56
  121. cocotb_tools/makefiles/simulators/Makefile.vcs +65 -0
  122. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.verilator +15 -22
  123. {cocotb/share → cocotb_tools}/makefiles/simulators/Makefile.xcelium +20 -52
  124. {cocotb → cocotb_tools}/runner.py +794 -361
  125. cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
  126. pygpi/entry.py +34 -17
  127. cocotb/binary.py +0 -858
  128. cocotb/config.py +0 -289
  129. cocotb/decorators.py +0 -332
  130. cocotb/memdebug.py +0 -35
  131. cocotb/outcomes.py +0 -56
  132. cocotb/scheduler.py +0 -1099
  133. cocotb/share/makefiles/Makefile.deprecations +0 -12
  134. cocotb/share/makefiles/simulators/Makefile.cvc +0 -94
  135. cocotb/share/makefiles/simulators/Makefile.icarus +0 -111
  136. cocotb/share/makefiles/simulators/Makefile.ius +0 -125
  137. cocotb/share/makefiles/simulators/Makefile.modelsim +0 -32
  138. cocotb/share/makefiles/simulators/Makefile.nvc +0 -64
  139. cocotb/share/makefiles/simulators/Makefile.vcs +0 -98
  140. cocotb/types/array.py +0 -309
  141. cocotb/types/logic.py +0 -292
  142. cocotb/types/logic_array.py +0 -298
  143. cocotb/wavedrom.py +0 -199
  144. cocotb/xunit_reporter.py +0 -80
  145. cocotb-1.9.2.dist-info/METADATA +0 -170
  146. cocotb-1.9.2.dist-info/RECORD +0 -121
  147. cocotb-1.9.2.dist-info/entry_points.txt +0 -3
  148. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/LICENSE +0 -0
  149. {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/WHEEL +0 -0
  150. {cocotb/_vendor → cocotb_tools}/__init__.py +0 -0
  151. {cocotb → cocotb_tools}/_vendor/distutils_version.py +0 -0
@@ -1,55 +1,33 @@
1
- /******************************************************************************
2
- * Copyright (c) 2013, 2018 Potential Ventures Ltd
3
- * Copyright (c) 2013 SolarFlare Communications Inc
4
- * All rights reserved.
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, 2018 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_GPI_H_
31
8
  #define COCOTB_GPI_H_
32
9
 
33
- /*
10
+ /** \file gpi.h
11
+
34
12
  Generic Language Interface
13
+ ==========================
35
14
 
36
15
  This header file defines a Generic Language Interface into any simulator.
37
- Implementations need to implement the underlying functions in gpi_priv.h
16
+ Implementations need to implement the underlying functions in `gpi_priv.h`.
38
17
 
39
18
  The functions are essentially a limited subset of VPI/VHPI/FLI.
40
19
 
41
- Implementation specific notes
42
- =============================
20
+ Implementation-specific notes
21
+ -----------------------------
43
22
 
44
23
  By amazing coincidence, VPI and VHPI are strikingly similar which is obviously
45
- reflected by this header file. Unfortunately, this means that proprietry,
24
+ reflected by this header file. Unfortunately, this means that proprietary,
46
25
  non-standard, less featured language interfaces (for example Mentor FLI) may
47
26
  have to resort to some hackery.
48
27
 
49
28
  Because of the lack of ability to register a callback on event change using the
50
29
  FLI, we have to create a process with the signal on the sensitivity list to
51
30
  imitate a callback.
52
-
53
31
  */
54
32
 
55
33
  #include <exports.h>
@@ -62,9 +40,6 @@ imitate a callback.
62
40
  #include <gpi_logging.h>
63
41
  #include <stdbool.h>
64
42
  #include <stdint.h>
65
- #include <stdio.h>
66
- #include <stdlib.h>
67
- #include <string.h>
68
43
 
69
44
  /*
70
45
  * Declare the handle types.
@@ -101,56 +76,70 @@ typedef struct GpiIterator *gpi_iterator_hdl;
101
76
  extern "C" {
102
77
  #endif
103
78
 
79
+ // Forward declaration for types needed in function signatures
80
+ typedef enum gpi_discovery_e {
81
+ GPI_AUTO = 0,
82
+ GPI_NATIVE = 1,
83
+ } gpi_discovery;
84
+
104
85
  // Functions for controlling/querying the simulation state
105
86
 
106
87
  /**
107
- * Returns 1 if there is a registered GPI implementation, 0 otherwise.
108
- *
88
+ * Return if there is a registered GPI implementation.
109
89
  * Useful for checking if a simulator is running.
90
+ *
91
+ * @return `1` if there is a registered GPI implementation, `0` otherwise.
110
92
  */
111
93
  GPI_EXPORT bool gpi_has_registered_impl(void);
112
94
 
113
- // Stop the simulator
95
+ /**
96
+ * Stop the simulator.
97
+ */
114
98
  GPI_EXPORT void gpi_sim_end(void);
115
99
 
116
- // Returns simulation time as two uints. Units are default sim units
100
+ /**
101
+ * Return simulation time as two uints. Unit is the default sim unit.
102
+ */
117
103
  GPI_EXPORT void gpi_get_sim_time(uint32_t *high, uint32_t *low);
118
104
  GPI_EXPORT void gpi_get_sim_precision(int32_t *precision);
119
105
 
120
106
  /**
121
- * Returns a string with the running simulator product information
107
+ * Return a string with the running simulator product information.
122
108
  *
123
- * @return simulator product string
109
+ * @return The simulator product string.
124
110
  */
125
111
  GPI_EXPORT const char *gpi_get_simulator_product(void);
126
112
 
127
113
  /**
128
- * Returns a string with the running simulator version
114
+ * Return a string with the running simulator version.
129
115
  *
130
- * @return simulator version string
116
+ * @return The simulator version string.
131
117
  */
132
118
  GPI_EXPORT const char *gpi_get_simulator_version(void);
133
119
 
134
120
  // Functions for extracting a gpi_sim_hdl to an object
135
- // Returns a handle to the root simulation object,
136
- // Should be freed with gpi_free_handle
121
+
122
+ /**
123
+ * Returns a handle to the root simulation object.
124
+ */
137
125
  GPI_EXPORT gpi_sim_hdl gpi_get_root_handle(const char *name);
138
126
  GPI_EXPORT gpi_sim_hdl gpi_get_handle_by_name(gpi_sim_hdl parent,
139
- const char *name);
127
+ const char *name,
128
+ gpi_discovery discovery_method);
140
129
  GPI_EXPORT gpi_sim_hdl gpi_get_handle_by_index(gpi_sim_hdl parent,
141
130
  int32_t index);
142
- GPI_EXPORT void gpi_free_handle(gpi_sim_hdl gpi_hdl);
143
131
 
144
- // Types that can be passed to the iterator.
145
- //
132
+ /**
133
+ * Types that can be passed to the iterator.
134
+ */
146
135
  // Note these are strikingly similar to the VPI types...
147
136
  typedef enum gpi_objtype_e {
148
137
  GPI_UNKNOWN = 0,
149
138
  GPI_MEMORY = 1,
150
139
  GPI_MODULE = 2,
151
- GPI_NET = 3,
140
+ // GPI_NET = 3, // Deprecated
152
141
  // GPI_PARAMETER = 4, // Deprecated
153
- GPI_REGISTER = 5,
142
+ // GPI_REGISTER = 5, // Deprecated
154
143
  GPI_ARRAY = 6,
155
144
  GPI_ENUM = 7,
156
145
  GPI_STRUCTURE = 8,
@@ -158,46 +147,85 @@ typedef enum gpi_objtype_e {
158
147
  GPI_INTEGER = 10,
159
148
  GPI_STRING = 11,
160
149
  GPI_GENARRAY = 12,
161
- } gpi_objtype_t;
150
+ GPI_PACKAGE = 13,
151
+ GPI_PACKED_STRUCTURE = 14,
152
+ GPI_LOGIC = 15,
153
+ GPI_LOGIC_ARRAY = 16,
154
+ } gpi_objtype;
162
155
 
163
- // When iterating, we can chose to either get child objects, drivers or loads
156
+ /**
157
+ * When iterating, we can chose to either get child objects, drivers or loads.
158
+ */
164
159
  typedef enum gpi_iterator_sel_e {
165
160
  GPI_OBJECTS = 1,
166
161
  GPI_DRIVERS = 2,
167
162
  GPI_LOADS = 3,
168
- } gpi_iterator_sel_t;
163
+ GPI_PACKAGE_SCOPES = 4,
164
+ } gpi_iterator_sel;
169
165
 
170
166
  typedef enum gpi_set_action_e {
171
167
  GPI_DEPOSIT = 0,
172
168
  GPI_FORCE = 1,
173
169
  GPI_RELEASE = 2,
174
- } gpi_set_action_t;
170
+ GPI_NO_DELAY = 3,
171
+ } gpi_set_action;
172
+
173
+ typedef enum gpi_range_dir_e {
174
+ GPI_RANGE_DOWN = -1,
175
+ GPI_RANGE_NO_DIR = 0,
176
+ GPI_RANGE_UP = 1,
177
+ } gpi_range_dir;
178
+
179
+ typedef enum gpi_edge_e {
180
+ GPI_RISING,
181
+ GPI_FALLING,
182
+ GPI_VALUE_CHANGE,
183
+ } gpi_edge;
175
184
 
176
185
  // Functions for iterating over entries of a handle
177
- // Returns an iterator handle which can then be used in gpi_next calls
178
- //
179
- // Unlike `vpi_iterate` the iterator handle may only be NULL if the `type` is
180
- // not supported, If no objects of the requested type are found, an empty
181
- // iterator is returned.
186
+
187
+ /**
188
+ * Return an iterator handle which can then be used in `gpi_next` calls.
189
+ *
190
+ * Unlike `vpi_iterate` the iterator handle may only be `NULL` if the `type` is
191
+ * not supported, If no objects of the requested type are found, an empty
192
+ * iterator is returned.
193
+ */
182
194
  GPI_EXPORT gpi_iterator_hdl gpi_iterate(gpi_sim_hdl base,
183
- gpi_iterator_sel_t type);
195
+ gpi_iterator_sel type);
184
196
 
185
- // Returns NULL when there are no more objects
197
+ /**
198
+ * @return `NULL` when there are no more objects.
199
+ */
186
200
  GPI_EXPORT gpi_sim_hdl gpi_next(gpi_iterator_hdl iterator);
187
201
 
188
- // Returns the number of objects in the collection of the handle
202
+ /**
203
+ * @return The number of objects in the collection of the handle.
204
+ */
189
205
  GPI_EXPORT int gpi_get_num_elems(gpi_sim_hdl gpi_sim_hdl);
190
206
 
191
- // Returns the left side of the range constraint
207
+ /**
208
+ * @return The left side of the range constraint.
209
+ */
192
210
  GPI_EXPORT int gpi_get_range_left(gpi_sim_hdl gpi_sim_hdl);
193
211
 
194
- // Returns the right side of the range constraint
212
+ /**
213
+ * @return The right side of the range constraint.
214
+ */
195
215
  GPI_EXPORT int gpi_get_range_right(gpi_sim_hdl gpi_sim_hdl);
196
216
 
217
+ /**
218
+ * @return The direction of the range constraint:
219
+ * `+1` for ascending, `-1` for descending, `0` for undefined.
220
+ */
221
+ GPI_EXPORT gpi_range_dir gpi_get_range_dir(gpi_sim_hdl gpi_sim_hdl);
222
+
197
223
  // Functions for querying the properties of a handle
198
- // Caller responsible for freeing the returned string.
199
- // This is all slightly verbose but it saves having to enumerate various value
200
- // types We only care about a limited subset of values.
224
+
225
+ /**
226
+ * This is all slightly verbose but it saves having to enumerate various value
227
+ * types. We only care about a limited subset of values.
228
+ */
201
229
  GPI_EXPORT const char *gpi_get_signal_value_binstr(gpi_sim_hdl gpi_hdl);
202
230
  GPI_EXPORT const char *gpi_get_signal_value_str(gpi_sim_hdl gpi_hdl);
203
231
  GPI_EXPORT double gpi_get_signal_value_real(gpi_sim_hdl gpi_hdl);
@@ -205,43 +233,48 @@ GPI_EXPORT long gpi_get_signal_value_long(gpi_sim_hdl gpi_hdl);
205
233
  GPI_EXPORT const char *gpi_get_signal_name_str(gpi_sim_hdl gpi_hdl);
206
234
  GPI_EXPORT const char *gpi_get_signal_type_str(gpi_sim_hdl gpi_hdl);
207
235
 
208
- // Returns one of the types defined above e.g. gpiMemory etc.
209
- GPI_EXPORT gpi_objtype_t gpi_get_object_type(gpi_sim_hdl gpi_hdl);
236
+ /**
237
+ * @return One of the types defined above.
238
+ */
239
+ GPI_EXPORT gpi_objtype gpi_get_object_type(gpi_sim_hdl gpi_hdl);
210
240
 
211
- // Get information about the definition of a handle
241
+ /**
242
+ * Get information about the definition of a handle.
243
+ */
212
244
  GPI_EXPORT const char *gpi_get_definition_name(gpi_sim_hdl gpi_hdl);
213
245
  GPI_EXPORT const char *gpi_get_definition_file(gpi_sim_hdl gpi_hdl);
214
246
 
215
- // Determine whether an object value is constant (parameters / generics etc)
247
+ /**
248
+ * Determine whether an object value is constant (parameters / generics etc).
249
+ */
216
250
  GPI_EXPORT int gpi_is_constant(gpi_sim_hdl gpi_hdl);
217
251
 
218
- // Determine whether an object is indexable
252
+ /**
253
+ * Determine whether an object is indexable.
254
+ */
219
255
  GPI_EXPORT int gpi_is_indexable(gpi_sim_hdl gpi_hdl);
220
256
 
221
257
  // Functions for setting the properties of a handle
258
+
222
259
  GPI_EXPORT void gpi_set_signal_value_real(gpi_sim_hdl gpi_hdl, double value,
223
- gpi_set_action_t action);
260
+ gpi_set_action action);
224
261
  GPI_EXPORT void gpi_set_signal_value_int(gpi_sim_hdl gpi_hdl, int32_t value,
225
- gpi_set_action_t action);
262
+ gpi_set_action action);
226
263
  GPI_EXPORT void gpi_set_signal_value_binstr(
227
264
  gpi_sim_hdl gpi_hdl, const char *str,
228
- gpi_set_action_t action); // String of binary char(s) [1, 0, x, z]
265
+ gpi_set_action action); // String of binary char(s) [1, 0, x, z]
229
266
  GPI_EXPORT void gpi_set_signal_value_str(
230
267
  gpi_sim_hdl gpi_hdl, const char *str,
231
- gpi_set_action_t action); // String of ASCII char(s)
232
-
233
- typedef enum gpi_edge {
234
- GPI_RISING = 1,
235
- GPI_FALLING = 2,
236
- } gpi_edge_e;
268
+ gpi_set_action action); // String of ASCII char(s)
237
269
 
238
270
  // The callback registering functions
271
+
239
272
  GPI_EXPORT gpi_cb_hdl gpi_register_timed_callback(int (*gpi_function)(void *),
240
273
  void *gpi_cb_data,
241
274
  uint64_t time);
242
275
  GPI_EXPORT gpi_cb_hdl gpi_register_value_change_callback(
243
276
  int (*gpi_function)(void *), void *gpi_cb_data, gpi_sim_hdl gpi_hdl,
244
- int edge);
277
+ gpi_edge edge);
245
278
  GPI_EXPORT gpi_cb_hdl
246
279
  gpi_register_readonly_callback(int (*gpi_function)(void *), void *gpi_cb_data);
247
280
  GPI_EXPORT gpi_cb_hdl
@@ -249,14 +282,26 @@ gpi_register_nexttime_callback(int (*gpi_function)(void *), void *gpi_cb_data);
249
282
  GPI_EXPORT gpi_cb_hdl
250
283
  gpi_register_readwrite_callback(int (*gpi_function)(void *), void *gpi_cb_data);
251
284
 
252
- // Calling convention is that 0 = success and negative numbers a failure
253
- // For implementers of GPI the provided macro GPI_RET(x) is provided
254
- GPI_EXPORT void gpi_deregister_callback(gpi_cb_hdl gpi_hdl);
285
+ /** Remove callback.
286
+ *
287
+ * The callback will not fire after this function is called.
288
+ * The argument is no longer valid if this function succeeds.
289
+ *
290
+ * @param cb_hdl The handle to the callback to remove.
291
+ * @returns `0` on successful removal, `1` otherwise.
292
+ */
293
+ GPI_EXPORT int gpi_remove_cb(gpi_cb_hdl cb_hdl);
255
294
 
256
- // Because the internal structures may be different for different
257
- // implementations of GPI we provide a convenience function to extract the
258
- // callback data
259
- GPI_EXPORT void *gpi_get_callback_data(gpi_cb_hdl gpi_hdl);
295
+ /** Retrieve user callback information from callback handle.
296
+ *
297
+ * This function cannot fail.
298
+ *
299
+ * @param cb_hdl The handle to the callback.
300
+ * @param cb_func Where the user callback function should be placed.
301
+ * @param cb_data Where the user callback function data should be placed.
302
+ */
303
+ GPI_EXPORT void gpi_get_cb_info(gpi_cb_hdl cb_hdl, int (**cb_func)(void *),
304
+ void **cb_data);
260
305
 
261
306
  #ifdef __cplusplus
262
307
  }