From fbaecdff8746658ce0ce93264621a673d2a30968 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sat, 29 May 2010 22:09:27 -0700 Subject: [PATCH] V0.9 back port of dumpers only sort scope list when needed. We need a slightly different patch for V0.9 than development. The fst patch already has this change and the lxt2 file in V0.9 also needs this change. See the development patch for more information. --- vpi/sys_lxt.c | 7 ++++--- vpi/sys_lxt2.c | 3 ++- vpi/sys_vcd.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index c87ee4d58..87d01a1a6 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -759,8 +759,9 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) int dep = draw_scope(item); - vcd_names_sort(&lxt_tab); scan_item(depth, item, 0); + /* The scope list must be sorted after we scan an item. */ + vcd_names_sort(&lxt_tab); while (dep--) pop_scope(); } @@ -780,10 +781,10 @@ void sys_lxt_register() s_vpi_systf_data tf_data; - /* Scan the extended arguments, looking for lxt optimization - flags. */ + /* Scan the extended arguments, looking for lxt optimization flags. */ vpi_get_vlog_info(&vlog_info); + /* The "speed" option is not used in this dumper. */ for (idx = 0 ; idx < vlog_info.argc ; idx += 1) { if (strcmp(vlog_info.argv[idx],"-lxt-space") == 0) { lxm_optimum_mode = LXM_SPACE; diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index c44d2725b..4f9b8190e 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -770,8 +770,9 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) int dep = draw_scope(item); - vcd_names_sort(&lxt_tab); scan_item(depth, item, 0); + /* The scope list must be sorted after we scan an item. */ + vcd_names_sort(&lxt_tab); while (dep--) pop_scope(); } diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 18f2a5fe9..8ea42b449 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -691,7 +691,6 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) "previously scanned scope %s.\n", fullname); } else { vcd_names_add(&vcd_tab, fullname); - vcd_names_sort(&vcd_tab); } name = vpi_get_str(vpiName, item); @@ -822,6 +821,8 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) dep = draw_scope(item, callh); scan_item(depth, item, 0); + /* The scope list must be sorted after we scan an item. */ + vcd_names_sort(&vcd_tab); while (dep--) fprintf(dump_file, "$upscope $end\n");