mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 13:57:18 +02:00
Add implementation of acc_handle_by_name.
This commit is contained in:
+5
-1
@@ -19,7 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: acc_user.h,v 1.12 2003/05/18 00:16:35 steve Exp $"
|
#ident "$Id: acc_user.h,v 1.13 2003/05/24 03:02:04 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -216,6 +216,7 @@ extern char* acc_fetch_type_str(PLI_INT32 type);
|
|||||||
|
|
||||||
extern char* acc_fetch_value(handle obj, const char*fmt, s_acc_value*value);
|
extern char* acc_fetch_value(handle obj, const char*fmt, s_acc_value*value);
|
||||||
|
|
||||||
|
extern handle acc_handle_by_name(const char*name, handle scope);
|
||||||
extern handle acc_handle_object(const char*name);
|
extern handle acc_handle_object(const char*name);
|
||||||
extern handle acc_handle_parent(handle obj);
|
extern handle acc_handle_parent(handle obj);
|
||||||
|
|
||||||
@@ -243,6 +244,9 @@ EXTERN_C_END
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: acc_user.h,v $
|
* $Log: acc_user.h,v $
|
||||||
|
* Revision 1.13 2003/05/24 03:02:04 steve
|
||||||
|
* Add implementation of acc_handle_by_name.
|
||||||
|
*
|
||||||
* Revision 1.12 2003/05/18 00:16:35 steve
|
* Revision 1.12 2003/05/18 00:16:35 steve
|
||||||
* Add PLI_TRACE tracing of PLI1 modules.
|
* Add PLI_TRACE tracing of PLI1 modules.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
# 59 Temple Place - Suite 330
|
# 59 Temple Place - Suite 330
|
||||||
# Boston, MA 02111-1307, USA
|
# Boston, MA 02111-1307, USA
|
||||||
#
|
#
|
||||||
#ident "$Id: Makefile.in,v 1.23 2003/05/18 00:16:35 steve Exp $"
|
#ident "$Id: Makefile.in,v 1.24 2003/05/24 03:02:04 steve Exp $"
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
@@ -48,7 +48,7 @@ RANLIB = @RANLIB@
|
|||||||
A = a_close.o a_configure.o a_fetch_argc.o a_fetch_argv.o a_fetch_fullname.o \
|
A = a_close.o a_configure.o a_fetch_argc.o a_fetch_argv.o a_fetch_fullname.o \
|
||||||
a_fetch_location.o a_fetch_param.o a_fetch_tfarg.o a_fetch_time.o \
|
a_fetch_location.o a_fetch_param.o a_fetch_tfarg.o a_fetch_time.o \
|
||||||
a_fetch_type.o a_fetch_type_str.o a_fetch_value.o \
|
a_fetch_type.o a_fetch_type_str.o a_fetch_value.o \
|
||||||
a_handle_object.o a_handle_parent.o a_handle_tfarg.o \
|
a_handle_by_name.o a_handle_object.o a_handle_parent.o a_handle_tfarg.o \
|
||||||
a_initialize.o a_next_topmod.o a_object_of_type.o a_product_version.o \
|
a_initialize.o a_next_topmod.o a_object_of_type.o a_product_version.o \
|
||||||
a_set_value.o a_vcl.o a_version.o
|
a_set_value.o a_vcl.o a_version.o
|
||||||
O = asynch.o delay.o finish.o getcstringp.o getinstance.o getlongp.o \
|
O = asynch.o delay.o finish.o getcstringp.o getinstance.o getlongp.o \
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
/* vi:sw=6
|
||||||
|
* Copyright (c) 2003 Michael Ruff (mruff at chiaro.com)
|
||||||
|
*
|
||||||
|
* This source code is free software; you can redistribute it
|
||||||
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
* General Public License as published by the Free Software
|
||||||
|
* Foundation; either version 2 of the License, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_CVS_IDENT
|
||||||
|
#ident "$Id: a_handle_by_name.c,v 1.1 2003/05/24 03:02:04 steve Exp $"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# include <acc_user.h>
|
||||||
|
# include <vpi_user.h>
|
||||||
|
# include "priv.h"
|
||||||
|
# include <assert.h>
|
||||||
|
# include <string.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* acc_handle_by_name implemented using VPI interface
|
||||||
|
*/
|
||||||
|
handle acc_handle_by_name(const char*obj_name, handle scope)
|
||||||
|
{
|
||||||
|
vpiHandle sys_h;
|
||||||
|
vpiHandle res;
|
||||||
|
|
||||||
|
/* if no scope provided, use tasks scope */
|
||||||
|
if (!scope) {
|
||||||
|
sys_h = vpi_handle(vpiSysTfCall, 0 /* NULL */);
|
||||||
|
scope = vpi_handle(vpiScope, sys_h);
|
||||||
|
}
|
||||||
|
|
||||||
|
res = vpi_handle_by_name(obj_name, scope);
|
||||||
|
|
||||||
|
if (pli_trace) {
|
||||||
|
fprintf(pli_trace, "acc_handle_by_name(\"%s\", scope=%s) "
|
||||||
|
" --> %p\n", obj_name,
|
||||||
|
vpi_get_str(vpiFullName, scope), res);
|
||||||
|
fflush(pli_trace);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* $Log: a_handle_by_name.c,v $
|
||||||
|
* Revision 1.1 2003/05/24 03:02:04 steve
|
||||||
|
* Add implementation of acc_handle_by_name.
|
||||||
|
*
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user