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.
- cocotb/{ANSI.py → _ANSI.py} +5 -25
- cocotb/__init__.py +76 -332
- cocotb/_base_triggers.py +513 -0
- cocotb/_bridge.py +187 -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 +382 -0
- cocotb/_init.py +295 -0
- cocotb/_outcomes.py +54 -0
- cocotb/_profiling.py +46 -0
- cocotb/_py_compat.py +100 -29
- cocotb/_scheduler.py +454 -0
- cocotb/_test.py +245 -0
- cocotb/_test_factory.py +309 -0
- cocotb/_test_functions.py +42 -0
- cocotb/_typing.py +7 -0
- cocotb/_utils.py +296 -0
- cocotb/_version.py +3 -7
- cocotb/_xunit_reporter.py +66 -0
- cocotb/clock.py +271 -108
- cocotb/handle.py +1342 -795
- 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/{log.py → logging.py} +105 -110
- cocotb/queue.py +103 -57
- cocotb/regression.py +667 -712
- 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 +6 -29
- cocotb/share/include/embed.h +5 -28
- cocotb/share/include/gpi.h +137 -92
- cocotb/share/include/gpi_logging.h +221 -142
- cocotb/share/include/py_gpi_logging.h +7 -4
- cocotb/share/include/vpi_user_ext.h +4 -26
- cocotb/share/lib/verilator/verilator.cpp +59 -54
- cocotb/simulator.cp312-win_amd64.exp +0 -0
- cocotb/simulator.cp312-win_amd64.lib +0 -0
- cocotb/simulator.cp312-win_amd64.pyd +0 -0
- cocotb/simulator.pyi +107 -0
- cocotb/task.py +434 -212
- cocotb/triggers.py +55 -1092
- cocotb/types/__init__.py +25 -47
- cocotb/types/_abstract_array.py +151 -0
- cocotb/types/_array.py +264 -0
- cocotb/types/_logic.py +296 -0
- cocotb/types/_logic_array.py +834 -0
- cocotb/types/{range.py → _range.py} +36 -44
- cocotb/types/_resolve.py +76 -0
- cocotb/utils.py +119 -587
- cocotb-2.0.0b1.dist-info/METADATA +60 -0
- cocotb-2.0.0b1.dist-info/RECORD +143 -0
- {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.dist-info}/WHEEL +1 -1
- cocotb-2.0.0b1.dist-info/entry_points.txt +2 -0
- {cocotb-1.9.2.dist-info → cocotb-2.0.0b1.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 +82 -54
- {cocotb/share → cocotb_tools}/makefiles/Makefile.sim +8 -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 → cocotb_tools}/runner.py +794 -361
- cocotb/_sim_versions.py → cocotb_tools/sim_versions.py +16 -21
- pygpi/entry.py +34 -17
- pygpi/py.typed +0 -0
- cocotb/binary.py +0 -858
- cocotb/config.py +0 -289
- cocotb/decorators.py +0 -332
- cocotb/memdebug.py +0 -35
- cocotb/outcomes.py +0 -56
- 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-1.9.2.dist-info → cocotb-2.0.0b1.dist-info/licenses}/LICENSE +0 -0
- {cocotb → cocotb_tools}/_vendor/distutils_version.py +0 -0
cocotb/share/include/gpi.h
CHANGED
|
@@ -1,55 +1,33 @@
|
|
|
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, 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
|
|
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
|
|
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
|
-
*
|
|
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
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Stop the simulator.
|
|
97
|
+
*/
|
|
114
98
|
GPI_EXPORT void gpi_sim_end(void);
|
|
115
99
|
|
|
116
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
150
|
+
GPI_PACKAGE = 13,
|
|
151
|
+
GPI_PACKED_STRUCTURE = 14,
|
|
152
|
+
GPI_LOGIC = 15,
|
|
153
|
+
GPI_LOGIC_ARRAY = 16,
|
|
154
|
+
} gpi_objtype;
|
|
162
155
|
|
|
163
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
195
|
+
gpi_iterator_sel type);
|
|
184
196
|
|
|
185
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
209
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
260
|
+
gpi_set_action action);
|
|
224
261
|
GPI_EXPORT void gpi_set_signal_value_int(gpi_sim_hdl gpi_hdl, int32_t value,
|
|
225
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
}
|