Clean up warnings for round() function declaration.
[iverilog.git] / libveriuser / a_fetch_param.c
blobe2f464fdd04038d2d41e6d30974259edd18cadf3
1 /*
2 * Copyright (c) 2003 Stephen Williams (steve@icarus.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: a_fetch_param.c,v 1.4 2003/06/17 16:55:07 steve Exp $"
21 #endif
23 #include <assert.h>
24 #include <vpi_user.h>
25 #include <acc_user.h>
26 #include "priv.h"
28 double acc_fetch_paramval(handle object)
30 s_vpi_value val;
32 val.format = vpiObjTypeVal;
33 vpi_get_value(object, &val);
35 switch (val.format) {
37 case vpiStringVal:
38 if (pli_trace) {
39 fprintf(pli_trace, "acc_fetch_paramval(%s) --> \"%s\"\n",
40 vpi_get_str(vpiName, object), val.value.str);
42 return (double) (long)val.value.str;
44 default:
45 vpi_printf("XXXX: parameter %s has type %d\n",
46 vpi_get_str(vpiName, object), val.format);
47 assert(0);
48 return 0.0;
53 * $Log: a_fetch_param.c,v $
54 * Revision 1.4 2003/06/17 16:55:07 steve
55 * 1) setlinebuf() for vpi_trace
56 * 2) Addes error checks for trace file opens
57 * 3) removes now extraneous flushes
58 * 4) fixes acc_next() bug
60 * Revision 1.3 2003/05/18 00:16:35 steve
61 * Add PLI_TRACE tracing of PLI1 modules.
63 * Add tf_isetdelay and friends, and add
64 * callback return values for acc_vcl support.
66 * Revision 1.2 2003/03/14 04:59:54 steve
67 * Better message when asserting funky value type.
69 * Revision 1.1 2003/03/13 04:35:09 steve
70 * Add a bunch of new acc_ and tf_ functions.