Add acc_set_scope function.
This commit is contained in:
parent
ae3198b505
commit
f0e0377a20
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: acc_user.h,v 1.19 2003/10/10 02:57:45 steve Exp $"
|
||||
#ident "$Id: acc_user.h,v 1.20 2003/12/17 15:45:07 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -195,6 +195,7 @@ extern void acc_close(void);
|
|||
* codes that are accepted.
|
||||
*/
|
||||
extern int acc_configure(PLI_INT32 config_param, const char*value);
|
||||
#define accEnableArgs 6
|
||||
#define accDevelopmentVersion 11
|
||||
|
||||
extern int acc_fetch_argc(void);
|
||||
|
|
@ -258,6 +259,8 @@ extern int acc_object_of_type(handle object, PLI_INT32 type);
|
|||
|
||||
extern char*acc_product_version(void);
|
||||
|
||||
extern char*acc_set_scope(handle ref, ...);
|
||||
|
||||
extern int acc_set_value(handle obj, p_setval_value value,
|
||||
p_setval_delay delay);
|
||||
|
||||
|
|
@ -272,6 +275,9 @@ EXTERN_C_END
|
|||
|
||||
/*
|
||||
* $Log: acc_user.h,v $
|
||||
* Revision 1.20 2003/12/17 15:45:07 steve
|
||||
* Add acc_set_scope function.
|
||||
*
|
||||
* Revision 1.19 2003/10/10 02:57:45 steve
|
||||
* Some PLI1 stubs.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: a_configure.c,v 1.3 2003/06/17 16:55:07 steve Exp $"
|
||||
#ident "$Id: a_configure.c,v 1.4 2003/12/17 15:45:07 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include <acc_user.h>
|
||||
#include <vpi_user.h>
|
||||
#include "priv.h"
|
||||
#include <string.h>
|
||||
|
||||
int acc_configure(PLI_INT32 config_param, const char*value)
|
||||
{
|
||||
|
|
@ -39,6 +40,32 @@ int acc_configure(PLI_INT32 config_param, const char*value)
|
|||
}
|
||||
break;
|
||||
|
||||
case accEnableArgs:
|
||||
|
||||
if (pli_trace) {
|
||||
fprintf(pli_trace, "acc_configure(accEnableArgs, %s)\n",
|
||||
value);
|
||||
}
|
||||
|
||||
rc = 1;
|
||||
if (strcmp(value,"acc_set_scope") == 0) {
|
||||
vpi_printf("XXXX acc_configure argument: Sorry: "
|
||||
"(accEnableArgs, %s\n", value);
|
||||
rc = 0;
|
||||
|
||||
} else if (strcmp(value,"no_acc_set_scope") == 0) {
|
||||
vpi_printf("XXXX acc_configure argument: Sorry: "
|
||||
"(accEnableArgs, %s\n", value);
|
||||
rc = 0;
|
||||
|
||||
} else {
|
||||
vpi_printf("XXXX acc_configure argument error. "
|
||||
"(accEnableArgs, %s(invalid)\n", value);
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
if (pli_trace) {
|
||||
|
|
@ -56,6 +83,9 @@ int acc_configure(PLI_INT32 config_param, const char*value)
|
|||
|
||||
/*
|
||||
* $Log: a_configure.c,v $
|
||||
* Revision 1.4 2003/12/17 15:45:07 steve
|
||||
* Add acc_set_scope function.
|
||||
*
|
||||
* Revision 1.3 2003/06/17 16:55:07 steve
|
||||
* 1) setlinebuf() for vpi_trace
|
||||
* 2) Addes error checks for trace file opens
|
||||
|
|
|
|||
|
|
@ -17,24 +17,47 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: a_handle_object.c,v 1.1 2003/03/13 04:35:09 steve Exp $"
|
||||
#ident "$Id: a_handle_object.c,v 1.2 2003/12/17 15:45:07 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include <vpi_user.h>
|
||||
#include <acc_user.h>
|
||||
#include "priv.h"
|
||||
|
||||
static vpiHandle search_scope = 0;
|
||||
|
||||
handle acc_handle_object(const char*name)
|
||||
{
|
||||
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
|
||||
vpiHandle scope = vpi_handle(vpiScope, sys);
|
||||
|
||||
vpiHandle scope = search_scope? search_scope : vpi_handle(vpiScope, sys);
|
||||
vpiHandle res = vpi_handle_by_name(name, scope);
|
||||
|
||||
if (pli_trace) {
|
||||
fprintf(pli_trace, "acc_handle_object(%s <scope=%s>) --> .\n",
|
||||
name, acc_fetch_fullname(scope));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
char* acc_set_scope(handle ref, ...)
|
||||
{
|
||||
char*name;
|
||||
search_scope = ref;
|
||||
|
||||
name = acc_fetch_fullname(search_scope);
|
||||
if (pli_trace) {
|
||||
fprintf(pli_trace, "acc_set_scope(<scope=%s>)\n", name);
|
||||
}
|
||||
|
||||
return acc_fetch_fullname(ref);
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: a_handle_object.c,v $
|
||||
* Revision 1.2 2003/12/17 15:45:07 steve
|
||||
* Add acc_set_scope function.
|
||||
*
|
||||
* Revision 1.1 2003/03/13 04:35:09 steve
|
||||
* Add a bunch of new acc_ and tf_ functions.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue