From 6a99520fa64af535e19a3357caf9b6112d842eb5 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 11 Oct 2011 13:33:05 -0700 Subject: [PATCH] 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. --- vpi_user.h | 1 + vvp/vpi_priv.cc | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/vpi_user.h b/vpi_user.h index 154747f0f..7dbe6da81 100644 --- a/vpi_user.h +++ b/vpi_user.h @@ -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 diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index a009be2fa..e896b1853 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -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(); }