From 507621ef3001dbc6ed9c8f65587a4f7274b766c4 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 5 Sep 2011 17:35:26 -0700 Subject: [PATCH] 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. --- vpi/sys_display.c | 5 +++++ vpi/sys_priv.c | 10 ++++++++++ vpi/sys_scanf.c | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 184db2454..cf315c97c 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -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: diff --git a/vpi/sys_priv.c b/vpi/sys_priv.c index a71971cd8..f14d5f285 100644 --- a/vpi/sys_priv.c +++ b/vpi/sys_priv.c @@ -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: diff --git a/vpi/sys_scanf.c b/vpi/sys_scanf.c index 896a2af0a..440661eba 100644 --- a/vpi/sys_scanf.c +++ b/vpi/sys_scanf.c @@ -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: