From c768805d9f8dcc7f2f3d8c9f59e18aa7db69bac0 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 28 Apr 2009 14:57:46 -0700 Subject: [PATCH] Add a warning message for some array words when dumping. When dumping an array word the name is implicitly converted to an escaped identifier. If this implicit name conflicts with an explicitly created escaped identifier this patch will print a warning message warning that the array word will conflict with an escaped identifier. --- vpi/sys_lxt.c | 9 +++++++++ vpi/sys_lxt2.c | 9 +++++++++ vpi/sys_vcd.c | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index 10311c203..a784a4643 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -563,6 +563,15 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) case vpiTimeVar: case vpiReg: type = "reg"; } + /* An array word is implicitly escaped so look for an + * escaped identifier that this could conflict with. */ + if (vpi_get(vpiType, item) == vpiMemoryWord && + vpi_handle_by_name(vpi_get_str(vpiFullName, item), 0)) { + vpi_printf("LXT warning: dumping array word %s will " + "conflict with an escaped identifier.\n", + vpi_get_str(vpiFullName, item)); + } + if (skip || vpi_get(vpiAutomatic, item)) break; name = vpi_get_str(vpiName, item); diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index e4776dc1e..016aeb8c2 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -575,6 +575,15 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) case vpiTimeVar: case vpiReg: type = "reg"; } + /* An array word is implicitly escaped so look for an + * escaped identifier that this could conflict with. */ + if (vpi_get(vpiType, item) == vpiMemoryWord && + vpi_handle_by_name(vpi_get_str(vpiFullName, item), 0)) { + vpi_printf("LXT2 warning: dumping array word %s will " + "conflict with an escaped identifier.\n", + vpi_get_str(vpiFullName, item)); + } + if (skip || vpi_get(vpiAutomatic, item)) break; name = vpi_get_str(vpiName, item); diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 8f2b1d531..12780d78c 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -539,6 +539,15 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) break; } + /* An array word is implicitly escaped so look for an + * escaped identifier that this could conflict with. */ + if (vpi_get(vpiType, item) == vpiMemoryWord && + vpi_handle_by_name(vpi_get_str(vpiFullName, item), 0)) { + vpi_printf("VCD warning: dumping array word %s will " + "conflict with an escaped identifier.\n", + vpi_get_str(vpiFullName, item)); + } + if (skip || vpi_get(vpiAutomatic, item)) break; name = vpi_get_str(vpiName, item);