mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 13:57:18 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user