1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
From a9fe853e63229603a8958fd80ff8b996dd49c950 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Sun, 26 May 2024 09:57:54 +0200
Subject: [PATCH] testsuite/gna: fix vpi prototypes
Fix #2663
---
testsuite/gna/issue450/vpi2.c | 6 ++++--
testsuite/gna/issue98/vpi1.c | 7 ++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/testsuite/gna/issue450/vpi2.c b/testsuite/gna/issue450/vpi2.c
index 0debb546b5..f1d652bb71 100644
--- a/testsuite/gna/issue450/vpi2.c
+++ b/testsuite/gna/issue450/vpi2.c
@@ -40,7 +40,7 @@ void printContent (vpiHandle parent)
}
}
-void printModules()
+PLI_INT32 printModules(s_cb_data *cb)
{
vpiHandle topModIterator;
vpiHandle topModHandle;
@@ -53,7 +53,7 @@ void printModules()
vpi_printf ("got to here1 \n");
if (!topModIterator)
{
- return;
+ return -1;
}
/* use vpi_scan to iterate throught modules */
@@ -64,6 +64,8 @@ void printModules()
printContent (topModHandle);
}
+
+ return 0;
}
diff --git a/testsuite/gna/issue98/vpi1.c b/testsuite/gna/issue98/vpi1.c
index 0adae07fe4..a14b89df23 100644
--- a/testsuite/gna/issue98/vpi1.c
+++ b/testsuite/gna/issue98/vpi1.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <vpi_user.h>
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
{
vpiHandle net;
s_vpi_value val;
@@ -11,11 +11,12 @@ vpi_proc (void)
if (net == NULL)
{
printf ("cannot get net\n");
- return;
+ return -1;
}
val.format = vpiBinStrVal;
vpi_get_value (net, &val);
printf ("value: %s\n", val.value.str);
+ return 0;
}
void my_handle_register()
From 5c4d2509b47d416470cdac59bb81955f5aacfee3 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Sun, 26 May 2024 16:58:25 +0200
Subject: [PATCH] testsuite/vpi: fix callback types (continue)
---
testsuite/vpi/vpi002/vpi1.c | 7 ++++---
testsuite/vpi/vpi004/vpi1.c | 13 +++++++------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/testsuite/vpi/vpi002/vpi1.c b/testsuite/vpi/vpi002/vpi1.c
index d6f1b42fb7..53d51250ee 100644
--- a/testsuite/vpi/vpi002/vpi1.c
+++ b/testsuite/vpi/vpi002/vpi1.c
@@ -2,8 +2,8 @@
#include <vpi_user.h>
#define N_NAMES 12
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
{
vpiHandle net;
s_vpi_value val;
@@ -54,12 +54,13 @@ vpi_proc (void)
if (net == NULL)
{
printf ("Error: Failed to find the net %s\n", names[name_index]);
- return;
+ return -1;
}
val.format = vpiBinStrVal;
vpi_get_value (net, &val);
printf ("value: %s\n", val.value.str);
}
+ return 0;
}
void my_handle_register()
diff --git a/testsuite/vpi/vpi004/vpi1.c b/testsuite/vpi/vpi004/vpi1.c
index 25d426fe7b..26ecf7c272 100644
--- a/testsuite/vpi/vpi004/vpi1.c
+++ b/testsuite/vpi/vpi004/vpi1.c
@@ -2,8 +2,8 @@
#include <vpi_user.h>
#define N_NAMES 12
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
{
s_vpi_vlog_info info;
int i;
@@ -11,12 +11,12 @@ vpi_proc (void)
int ret = vpi_get_vlog_info(&info);
if (ret != 1) {
printf ("Error: Failed to get vlog_info\n");
- return;
+ return -1;
}
if (info.argc < 1) {
printf ("Error: Argc was 0\n");
- return;
+ return -1;
}
printf ("Argc: %d\n", info.argc);
@@ -26,15 +26,16 @@ vpi_proc (void)
if (info.product == NULL) {
printf ("Error: product is NULL\n");
- return;
+ return -1;
}
printf ("Product: %s\n", info.product);
if (info.version == NULL) {
printf ("Error: version is NULL\n");
- return;
+ return -1;
}
printf ("Version: %s\n", info.version);
+ return 0;
}
void my_handle_register()
From 659a5d7a018d011aad23235bfd3e306072436a8b Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Sun, 26 May 2024 16:21:04 +0200
Subject: [PATCH] testsuite/vpi: fix callback types
---
testsuite/vpi/vpi001/vpi1.c | 7 ++++---
testsuite/vpi/vpi003/vpi1.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/testsuite/vpi/vpi001/vpi1.c b/testsuite/vpi/vpi001/vpi1.c
index c266b5cd75..a1ff9fb5d4 100644
--- a/testsuite/vpi/vpi001/vpi1.c
+++ b/testsuite/vpi/vpi001/vpi1.c
@@ -2,8 +2,8 @@
#include <vpi_user.h>
#define N_NAMES 12
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
{
vpiHandle net;
s_vpi_value val;
@@ -39,12 +39,13 @@ vpi_proc (void)
if (net == NULL)
{
printf ("Error: Failed to find the net %s\n", names[name_index]);
- return;
+ return -1;
}
val.format = vpiBinStrVal;
vpi_get_value (net, &val);
printf ("value: %s\n", val.value.str);
}
+ return 0;
}
void my_handle_register()
diff --git a/testsuite/vpi/vpi003/vpi1.c b/testsuite/vpi/vpi003/vpi1.c
index d7a6f8241c..8bd18873d0 100644
--- a/testsuite/vpi/vpi003/vpi1.c
+++ b/testsuite/vpi/vpi003/vpi1.c
@@ -2,8 +2,8 @@
#include <vpi_user.h>
#define N_NAMES 0
-void
-vpi_proc (void)
+PLI_INT32
+vpi_proc (s_cb_data *cb)
{
vpiHandle net;
s_vpi_value val;
@@ -29,12 +29,13 @@ vpi_proc (void)
if (net == NULL)
{
printf ("Error: Failed to find the net %s\n", names[name_index]);
- return;
+ return -1;
}
val.format = vpiBinStrVal;
vpi_get_value (net, &val);
printf ("value: %s\n", val.value.str);
}
+ return 0;
}
void my_handle_register()
From 9e7a317cea2473a31e18f63b9392912b7da8e63d Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Sun, 26 May 2024 17:22:54 +0200
Subject: [PATCH] testsuite/vhpi: fix prototypes
---
testsuite/vhpi/004trace_stdout/vhpi_lib.c | 2 +-
testsuite/vhpi/005trace_file/vhpi_lib.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testsuite/vhpi/004trace_stdout/vhpi_lib.c b/testsuite/vhpi/004trace_stdout/vhpi_lib.c
index 1bc1fca00b..df44f1e39c 100644
--- a/testsuite/vhpi/004trace_stdout/vhpi_lib.c
+++ b/testsuite/vhpi/004trace_stdout/vhpi_lib.c
@@ -23,7 +23,7 @@ void my_startup()
time.high = 0;
time.low = 0;
- vhpi_register_cb(&cb_data, NULL);
+ vhpi_register_cb(&cb_data, 0);
}
void (*vhpi_startup_routines[]) () =
diff --git a/testsuite/vhpi/005trace_file/vhpi_lib.c b/testsuite/vhpi/005trace_file/vhpi_lib.c
index 66ce5e1152..a0444c3f05 100644
--- a/testsuite/vhpi/005trace_file/vhpi_lib.c
+++ b/testsuite/vhpi/005trace_file/vhpi_lib.c
@@ -21,7 +21,7 @@ void my_startup()
time.high = 0;
time.low = 0;
- vhpi_register_cb(&cb_data, NULL);
+ vhpi_register_cb(&cb_data, 0);
}
void (*vhpi_startup_routines[]) () =
|