Clean up warnings for round() function declaration.
[iverilog.git] / libveriuser / putlongp.c
blob9d05bd4aa831c08293d39627e25d137af8937b29
1 /* vi:sw=6
2 * Copyright (c) 2002 Michael Ruff (mruff at chiaro.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
8 * any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 #ifdef HAVE_CVS_IDENT
20 #ident "$Id: putlongp.c,v 1.4 2004/09/10 23:13:05 steve Exp $"
21 #endif
23 #include <stdio.h>
24 #include <assert.h>
25 #include <veriuser.h>
26 #include <vpi_user.h>
29 * tf_putlongp implemented using VPI interface
31 void tf_putlongp(int n, int lowvalue, int highvalue)
33 vpiHandle sys_h, sys_i, arg_h = 0;
34 s_vpi_value val;
35 int type;
36 char str[20];
39 assert(n >= 0);
41 /* get task/func handle */
42 sys_h = vpi_handle(vpiSysTfCall, 0);
43 sys_i = vpi_iterate(vpiArgument, sys_h);
45 type = vpi_get(vpiType, sys_h);
47 /* verify function */
48 assert(!(n == 0 && type != vpiSysFuncCall));
50 /* find nth arg */
51 while (n > 0) {
52 if (!(arg_h = vpi_scan(sys_i))) assert(0);
53 n--;
55 if (!arg_h) arg_h = sys_h;
57 /* fill in vpi_value */
58 sprintf(str, "%x%08x", highvalue, lowvalue);
59 val.format = vpiHexStrVal;
60 val.value.str = str;
61 vpi_put_value(arg_h, &val, 0, vpiNoDelay);
63 vpi_free_object(sys_i);
67 * $Log: putlongp.c,v $
68 * Revision 1.4 2004/09/10 23:13:05 steve
69 * Compile cleanup of C code.
71 * Revision 1.3 2003/03/15 05:42:39 steve
72 * free argument iterators.
74 * Revision 1.2 2002/08/12 01:35:02 steve
75 * conditional ident string using autoconfig.
77 * Revision 1.1 2002/06/07 16:21:13 steve
78 * Add tf_putlongp and tf_putp.