Clean up some VPI issues.

This patch makes sure that objects either support vpiFile
and vpiLineNo or adds dummy code so that a runtime error
will not occur when accessing these properties. It also
returns 1 for the size of real variables and adds a
simplified vpiIndex that matches the Memory interface.
This commit is contained in:
Cary R
2008-05-01 20:18:59 -07:00
committed by Stephen Williams
parent b99206ac8e
commit c0d3bb370f
3 changed files with 25 additions and 3 deletions
+7
View File
@@ -130,6 +130,9 @@ static int vpi_array_get(int code, vpiHandle ref)
struct __vpiArray*obj = ARRAY_HANDLE(ref);
switch (code) {
case vpiLineNo:
return 0; // Not implemented for now!
case vpiSize:
return (int) obj->array_count;
@@ -142,6 +145,10 @@ static char*vpi_array_get_str(int code, vpiHandle ref)
{
struct __vpiArray*obj = ARRAY_HANDLE(ref);
if (code == vpiFile) { // Not implemented for now!
return simple_set_rbuf_str(file_names[0]);
}
return generic_get_str(code, &obj->scope->base, obj->name, NULL);
}