Add string display for vpiEnumTypespec and create hook for UdpDefn iteration.

This patch adds vpiEnumTypespec to the list so that vpi_get_str(vpiType, ...)
returns an appropriate string when an enum type is passed.

It also adds the initial hook to allow iteration (global) over the UDP
definitions. This along with table traversal will be needed to free the
memory allocated when the UDP definition is created. Ultimately this
will all the UDP test to be valgrind clean.
This commit is contained in:
Cary R 2011-10-11 13:33:05 -07:00 committed by Stephen Williams
parent a3813c006d
commit 6a99520fa6
2 changed files with 13 additions and 0 deletions

View File

@ -288,6 +288,7 @@ typedef struct t_vpi_delay {
#define vpiSysTaskCall 57
#define vpiTask 59
#define vpiTimeVar 63
#define vpiUdpDefn 66
#define vpiUserSystf 67
#define vpiNetArray 114
#define vpiIndex 78

View File

@ -262,6 +262,8 @@ static const char* vpi_type_values(PLI_INT32 code)
return "vpiByteVar";
case vpiConstant:
return "vpiConstant";
case vpiEnumTypespec:
return "vpiEnumTypespec";
case vpiFunction:
return "vpiFunction";
case vpiIntVar:
@ -1047,6 +1049,13 @@ vpiHandle vpi_handle(PLI_INT32 type, vpiHandle ref)
return res;
}
static vpiHandle vpip_make_udp_iterator()
{
// HERE: Add support for iterating over UDP definitions.
// See 26.6.16 (page 400 in 1364-2005).
return 0;
}
/*
* This function asks the object to return an iterator for
* the specified reference. It is up to the iterate_ method to
@ -1058,6 +1067,9 @@ static vpiHandle vpi_iterate_global(int type)
case vpiModule:
return vpip_make_root_iterator();
case vpiUdpDefn:
return vpip_make_udp_iterator();
case vpiUserSystf:
return vpip_make_systf_iterator();
}