Add acc_handle_tfarg and acc_next_topmode
This commit is contained in:
parent
24a2487c18
commit
ca2486ea61
17
acc_user.h
17
acc_user.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: acc_user.h,v 1.2 2002/05/30 02:06:05 steve Exp $"
|
||||
#ident "$Id: acc_user.h,v 1.3 2002/06/02 19:03:29 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -42,16 +42,31 @@
|
|||
|
||||
EXTERN_C_START
|
||||
|
||||
/*
|
||||
* This is a declaration of the "handle" type that is compatible with
|
||||
* the vpiHandle from vpi_user.h.
|
||||
*/
|
||||
typedef struct __vpiHandle *handle;
|
||||
|
||||
extern int acc_error_flag;
|
||||
|
||||
extern int acc_initialize(void);
|
||||
|
||||
extern void acc_close(void);
|
||||
|
||||
extern handle acc_handle_tfarg(int n);
|
||||
|
||||
extern handle add_next_topmod(handle prev_topmod);
|
||||
|
||||
extern char*acc_product_version(void);
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
/*
|
||||
* $Log: acc_user.h,v $
|
||||
* Revision 1.3 2002/06/02 19:03:29 steve
|
||||
* Add acc_handle_tfarg and acc_next_topmode
|
||||
*
|
||||
* Revision 1.2 2002/05/30 02:06:05 steve
|
||||
* Implement acc_product_version.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307, USA
|
||||
#
|
||||
#ident "$Id: Makefile.in,v 1.9 2002/06/02 18:54:59 steve Exp $"
|
||||
#ident "$Id: Makefile.in,v 1.10 2002/06/02 19:03:29 steve Exp $"
|
||||
#
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
|
@ -44,7 +44,8 @@ CFLAGS = @CFLAGS@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
STRIP = @STRIP@
|
||||
|
||||
A = a_close.o a_initialize.o a_product_version.o
|
||||
A = a_close.o a_handle_tfarg.o a_initialize.o a_next_topmod.o \
|
||||
a_product_version.o
|
||||
O = finish.o getinstance.o getsimtime.o io_print.o mc_scan_plusargs.o \
|
||||
nump.o veriusertfs.o $A
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
/* vi:sw=6
|
||||
* Copyright (c) 2002 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
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: a_handle_tfarg.c,v 1.1 2002/06/02 19:03:58 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include <acc_user.h>
|
||||
#include <vpi_user.h>
|
||||
|
||||
/*
|
||||
* acc_handle_tfarg implemented using VPI interface
|
||||
*/
|
||||
handle acc_handle_tfarg(int n)
|
||||
{
|
||||
vpiHandle sys_h, sys_i, rtn_h;
|
||||
|
||||
if (n > 0) {
|
||||
sys_h = vpi_handle(vpiSysTfCall, 0 /* NULL */);
|
||||
sys_i = vpi_iterate(vpiArgument, sys_h);
|
||||
|
||||
/* find nth arg */
|
||||
while (n > 0) {
|
||||
rtn_h = vpi_scan(sys_i);
|
||||
n--;
|
||||
}
|
||||
} else {
|
||||
rtn_h = (vpiHandle) 0;
|
||||
}
|
||||
|
||||
return rtn_h;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: a_handle_tfarg.c,v $
|
||||
* Revision 1.1 2002/06/02 19:03:58 steve
|
||||
* Add acc_handle_tfarg and acc_next_topmode
|
||||
*
|
||||
*/
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/* vi:sw=6
|
||||
* Copyright (c) 2002 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
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: a_next_topmod.c,v 1.1 2002/06/02 19:03:58 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <vpi_user.h>
|
||||
#include <acc_user.h>
|
||||
|
||||
#undef NULL
|
||||
#define NULL 0
|
||||
|
||||
/*
|
||||
* acc_next_topmod implemented using VPI interface
|
||||
*/
|
||||
handle acc_next_topmod(handle prev_topmod)
|
||||
{
|
||||
static vpiHandle last = NULL;
|
||||
static vpiHandle mod_i = NULL;
|
||||
|
||||
if (!prev_topmod) {
|
||||
/* start over */
|
||||
mod_i = vpi_iterate(vpiModule, NULL);
|
||||
} else {
|
||||
/* subsequent time through */
|
||||
assert(prev_topmod == last);
|
||||
}
|
||||
|
||||
last = vpi_scan(mod_i);
|
||||
return last;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: a_next_topmod.c,v $
|
||||
* Revision 1.1 2002/06/02 19:03:58 steve
|
||||
* Add acc_handle_tfarg and acc_next_topmode
|
||||
*
|
||||
*/
|
||||
Loading…
Reference in New Issue