From 68de9bf5d202fc82e06907061d882bde6d4238a2 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 6 Feb 2003 17:41:33 +0000 Subject: [PATCH] Support constant types for thread words. --- vvp/vpi_vthr_vector.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index 58971f382..aaaa3e151 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_vthr_vector.cc,v 1.10 2003/02/04 04:03:40 steve Exp $" +#ident "$Id: vpi_vthr_vector.cc,v 1.11 2003/02/06 17:41:33 steve Exp $" #endif /* @@ -367,6 +367,22 @@ struct __vpiVThrWord { unsigned short index; }; +static int vthr_word_get(int code, vpiHandle ref) +{ + assert(ref->vpi_type->type_code==vpiConstant); + + struct __vpiVThrWord*rfp = (struct __vpiVThrWord*)ref; + + switch (code) { + + case vpiConstType: + return rfp->subtype; + + default: + return 0; + } +} + static void vthr_real_get_value(vpiHandle ref, s_vpi_value*vp) { assert(ref->vpi_type->type_code==vpiConstant); @@ -428,7 +444,7 @@ static void vthr_real_get_value(vpiHandle ref, s_vpi_value*vp) static const struct __vpirt vpip_vthr_const_real_rt = { vpiConstant, - 0, + vthr_word_get, 0, vthr_real_get_value, 0, @@ -453,6 +469,9 @@ vpiHandle vpip_make_vthr_word(unsigned base, const char*type) /* * $Log: vpi_vthr_vector.cc,v $ + * Revision 1.11 2003/02/06 17:41:33 steve + * Support constant types for thread words. + * * Revision 1.10 2003/02/04 04:03:40 steve * Add hex and binary formatting of real values. *