Merge branch 'master' into verilog-ams

This commit is contained in:
Stephen Williams 2008-05-17 17:04:57 -07:00
commit 6966c26f27
3 changed files with 41 additions and 18 deletions

View File

@ -47,6 +47,8 @@ critical, but these are the versions I use.
msys-1.0 <http://www.mingw/org>
msysDTK-1.0 <http://www.mingw.org>
Mingw32-5.x <http://www.mingw.org>
... including the sub-packages binutils, gcc-core and gcc-g++
if you are given the option.
readline-4.2-20010727.zip <http://mingwrep.sourceforge.net>
bzip2-1.0.3 <http://gnuwin32.sourceforge.net>
zlib-1.2.3 <http://gnuwin32.sourceforge.net>

View File

@ -480,23 +480,40 @@ static PLI_INT32 sys_ungetc_compiletf(PLI_BYTE8*name)
vpiHandle item = vpi_scan(argv);
if (item == 0) {
vpi_printf("%s: mcd parameter missing.\n", name);
vpi_printf("%s: character parameter missing.\n", name);
return 0;
}
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal:
case vpiRealVal: // Is this correct?
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_printf("ERROR: %s character parameter must be ", name);
vpi_printf("integral, got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
item = vpi_scan(argv);
type = vpi_get(vpiType, item);
switch (type) {
case vpiReg:
case vpiRealVal: // Is this correct?
case vpiIntegerVar:
break;
default:
vpi_printf("ERROR: %s mcd parameter must be integral, ", name);
vpi_printf("got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
}
/* That should be all the arguments. */
item = vpi_scan(argv);
assert(item == 0);
return 0;
}
@ -504,7 +521,7 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name)
{
unsigned int mcd;
unsigned char x;
s_vpi_value value, xvalue, rval;
s_vpi_value val, rval;
vpiHandle sys = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, sys);
vpiHandle item = vpi_scan(argv);
@ -512,11 +529,15 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name)
rval.format = vpiIntVal;
assert(item);
val.format = vpiIntVal;
vpi_get_value(item, &val);
x = val.value.integer;
value.format = vpiIntVal;
vpi_get_value(item, &value);
mcd = value.value.integer;
item = vpi_scan(argv);
val.format = vpiIntVal;
vpi_get_value(item, &val);
mcd = val.value.integer;
if (IS_MCD(mcd)) {
rval.value.integer = EOF;
@ -524,12 +545,6 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name)
return 0;
}
item = vpi_scan(argv);
xvalue.format = vpiIntVal;
vpi_get_value(item, &xvalue);
x = xvalue.value.integer;
fp = vpi_get_file(mcd);
if ( !fp ) {
rval.value.integer = EOF;

View File

@ -863,10 +863,16 @@ vpiHandle vpi_handle_by_name(const char *name, vpiHandle scope)
*/
if (scope) {
/* Some implementations support either a module or a scope. */
if (vpi_get(vpiType, scope ) == vpiScope) {
switch (vpi_get(vpiType, scope)) {
case vpiScope:
hand = vpi_handle(vpiModule, scope);
} else {
break;
case vpiModule:
hand = scope;
break;
default:
// Use vpi_chk_error() here when it is implemented.
return 0;
}
} else {
hand = find_scope(name, NULL, 0);