From fd4985cc62d65b1554d89a0e4a201df54d42fc01 Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 14 Mar 2003 05:00:44 +0000 Subject: [PATCH] Support vpi_get of vpiTimeUnit. --- vvp/vpi_tasks.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/vvp/vpi_tasks.cc b/vvp/vpi_tasks.cc index aa80d7b4e..419406f4b 100644 --- a/vvp/vpi_tasks.cc +++ b/vvp/vpi_tasks.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_tasks.cc,v 1.22 2003/03/13 05:07:10 steve Exp $" +#ident "$Id: vpi_tasks.cc,v 1.23 2003/03/14 05:00:44 steve Exp $" #endif /* @@ -69,6 +69,21 @@ static vpiHandle systask_handle(int type, vpiHandle ref) }; } +static PLI_INT32 systask_get(int type, vpiHandle ref) +{ + struct __vpiSysTaskCall*rfp = (struct __vpiSysTaskCall*)ref; + + assert((ref->vpi_type->type_code == vpiSysTaskCall) + || (ref->vpi_type->type_code == vpiSysFuncCall)); + + switch (type) { + case vpiTimeUnit: + return rfp->scope->time_units; + default: + return vpiUndefined; + } +} + /* * the get_str function only needs to support vpiName */ @@ -111,7 +126,7 @@ static vpiHandle systask_iter(int type, vpiHandle ref) static const struct __vpirt vpip_systask_rt = { vpiSysTaskCall, - 0, + systask_get, systask_get_str, 0, 0, @@ -456,6 +471,9 @@ void* vpi_get_userdata(vpiHandle ref) /* * $Log: vpi_tasks.cc,v $ + * Revision 1.23 2003/03/14 05:00:44 steve + * Support vpi_get of vpiTimeUnit. + * * Revision 1.22 2003/03/13 05:07:10 steve * signed/unsigned warnings. *