Update $scanf, $printtimescale and the general is_numeric check for 2-state

This patch updates the $scanf and $printtimescale routines to work with
two-state variables. It also updates the general is_numeric check to
recognize two-state variables as numeric.
This commit is contained in:
Cary R 2011-09-05 17:35:26 -07:00 committed by Stephen Williams
parent 746a21b437
commit 507621ef30
3 changed files with 21 additions and 1 deletions

View File

@ -1808,6 +1808,11 @@ static PLI_INT32 sys_printtimescale_compiletf(ICARUS_VPI_CONST PLI_BYTE8*name)
switch (vpi_get(vpiType, arg)) {
case vpiFunction:
case vpiIntegerVar:
case vpiBitVar:
case vpiByteVar:
case vpiShortIntVar:
case vpiIntVar:
case vpiLongIntVar:
case vpiMemory:
case vpiMemoryWord:
case vpiModule:

View File

@ -169,6 +169,11 @@ unsigned is_numeric_obj(vpiHandle obj)
/* These can have a valid numeric value. */
case vpiIntegerVar:
case vpiBitVar:
case vpiByteVar:
case vpiShortIntVar:
case vpiIntVar:
case vpiLongIntVar:
case vpiMemoryWord:
case vpiNet:
case vpiPartSelect:
@ -204,6 +209,11 @@ unsigned is_string_obj(vpiHandle obj)
/* These can have a valid string value. */
case vpiIntegerVar:
case vpiBitVar:
case vpiByteVar:
case vpiShortIntVar:
case vpiIntVar:
case vpiLongIntVar:
case vpiMemoryWord:
case vpiNet:
case vpiPartSelect:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2010 Stephen Williams (steve@icarus.com)
* Copyright (c) 2006-2011 Stephen Williams (steve@icarus.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
@ -552,6 +552,11 @@ static int is_assignable_obj(vpiHandle obj)
case vpiPartSelect:
if (! is_assignable_obj(vpi_handle(vpiParent, obj))) break;
case vpiIntegerVar:
case vpiBitVar:
case vpiByteVar:
case vpiShortIntVar:
case vpiIntVar:
case vpiLongIntVar:
case vpiRealVar:
case vpiReg:
case vpiTimeVar: