Convert $monitor to use string based formatting.
This completes the transition to the new string based formatting. All the tasks now use the string formatting routines. Better compile time checking and better messages were also added. Also a couple of types were added to vpi_get_str(vpiType, ...) and the calculation for vpiConstantSelect was fixed for both the &A<> and &PV<> constructs. If the value is a plain variable or if it is calculated in thread space we assume it is not a constant. This may not be true because of limitations/bugs in the compiler (constant user functions are one known problem).
This commit is contained in:
parent
22cc681073
commit
d2e7ea0b68
1261
vpi/sys_display.c
1261
vpi/sys_display.c
File diff suppressed because it is too large
Load Diff
|
|
@ -640,10 +640,13 @@ static int vpi_array_vthr_A_get(int code, vpiHandle ref)
|
|||
case vpiAutomatic:
|
||||
return (int) parent->scope->is_automatic;
|
||||
|
||||
// For now &A<> is only a constant select. This will need
|
||||
// to be changed when it supports variable selection.
|
||||
// If address_handle is not zero we definitely have a
|
||||
// variable. If the wid is not zero we have a calculation
|
||||
// from thread space which probably includes a variable.
|
||||
// This assumes that the compiler is squashing all the
|
||||
// constant expressions down to a single value.
|
||||
case vpiConstantSelect:
|
||||
return 1;
|
||||
return obj->address_handle == 0 && obj->wid == 0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -228,6 +228,10 @@ static const char* vpi_type_values(PLI_INT32 code)
|
|||
return "vpiRealVar";
|
||||
case vpiReg:
|
||||
return "vpiReg";
|
||||
case vpiSysFuncCall:
|
||||
return "vpiSysFuncCall";
|
||||
case vpiSysTaskCall:
|
||||
return "vpiSysTaskCall";
|
||||
case vpiTask:
|
||||
return "vpiTask";
|
||||
case vpiTimeVar:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2008 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2009 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
|
||||
|
|
@ -972,8 +972,9 @@ static int PV_get(int code, vpiHandle ref)
|
|||
case vpiSize:
|
||||
return rfp->width;
|
||||
|
||||
/* This is like the &A<> in array.cc. */
|
||||
case vpiConstantSelect:
|
||||
return rfp->twid == 0;
|
||||
return rfp->sbase == 0 && rfp->twid == 0;
|
||||
|
||||
case vpiLeftRange:
|
||||
rval += rfp->width;
|
||||
|
|
|
|||
Loading…
Reference in New Issue