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)
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
20 #ident "$Id: a_fetch_type.c,v 1.8 2004/10/04 01:10:56 steve Exp $"
23 # include <acc_user.h>
24 # include <vpi_user.h>
27 PLI_INT32
acc_fetch_size(handle obj
)
29 return vpi_get(vpiSize
, obj
);
32 PLI_INT32
acc_fetch_type(handle obj
)
34 switch (vpi_get(vpiType
, obj
)) {
37 /*XXXX SWIFT PLI tasks seem to assume that string
38 constants show up an accParameter, instead of
40 if (vpi_get(vpiConstType
, obj
) == vpiStringConst
)
64 vpi_printf("acc_fetch_type: vpiType %d is what accType?\n",
65 vpi_get(vpiType
, obj
));
72 PLI_INT32
acc_fetch_fulltype(handle obj
)
74 int type
= vpi_get(vpiType
, obj
);
78 type
= vpi_get(vpiNetType
, obj
);
80 case vpiWire
: return accWire
;
82 vpi_printf("acc_fetch_fulltype: vpiNetType %d unknown?\n",
89 /* see acc_fetch_type */
90 if (vpi_get(vpiConstType
, obj
) == vpiStringConst
)
91 return accStringParam
;
95 case vpiIntegerVar
: return accIntegerVar
;
98 if (!vpi_handle(vpiScope
, obj
))
101 return accModuleInstance
;
102 // FIXME accCellInstance
104 case vpiNamedEvent
: return accNamedEvent
;
107 switch(vpi_get(vpiConstType
, obj
)) {
108 case vpiRealConst
: return accRealParam
;
109 case vpiStringConst
: return accStringParam
;
110 default: return accIntegerParam
;
113 case vpiReg
: return accReg
;
116 vpi_printf("acc_fetch_fulltype: vpiType %d unknown?\n",
123 * $Log: a_fetch_type.c,v $
124 * Revision 1.8 2004/10/04 01:10:56 steve
125 * Clean up spurious trailing white space.
127 * Revision 1.7 2003/06/04 01:56:20 steve
128 * 1) Adds configure logic to clean up compiler warnings
129 * 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
130 * tf_isetrealdelay, acc_handle_scope
131 * 3) makes acc_next reentrant
132 * 4) adds basic vpiWire type support
133 * 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
134 * 6) add vpiLeftRange/RigthRange to signals
136 * Revision 1.6 2003/05/30 04:18:31 steve
137 * Add acc_next function.
139 * Revision 1.5 2003/05/29 02:35:41 steve
140 * acc_fetch_type supports module.
142 * Revision 1.4 2003/04/24 18:57:06 steve
143 * Add acc_fetch_fulltype function.
145 * Revision 1.3 2003/04/12 18:57:14 steve
146 * More acc_ function stubs.
148 * Revision 1.2 2003/03/13 04:35:09 steve
149 * Add a bunch of new acc_ and tf_ functions.
151 * Revision 1.1 2003/02/17 06:39:47 steve
152 * Add at least minimal implementations for several
153 * acc_ functions. Add support for standard ACC
156 * Add the _pli_types.h header file to carry the
157 * IEEE1364-2001 standard PLI type declarations.