From e4476d544fc3bba30b8e286b135b9739dcaac8ca Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 25 Apr 2014 13:49:11 -0700 Subject: [PATCH] Improve SDF warnings to separate name and scope Some of the SDF warnings were mixing some of the scope path with the instance name. These are now separated into just scope and instance name. There was also a place where vpi_get_str() was being called twice in a single print statement. This is illegal since vpi_get_str() uses a single buffer and multiple calls will overwrite the buffer. --- vpi/sys_sdf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vpi/sys_sdf.c b/vpi/sys_sdf.c index 506446912..2ee6c1fe1 100644 --- a/vpi/sys_sdf.c +++ b/vpi/sys_sdf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2007-2014 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -101,7 +101,7 @@ void sdf_select_instance(const char*celltype, const char*cellinst) vpi_printf("SDF WARNING: %s:%d: ", vpi_get_str(vpiFile, sdf_callh), (int)vpi_get(vpiLineNo, sdf_callh)); vpi_printf("Unable to find %s in scope %s.\n", - cellinst, vpi_get_str(vpiFullName, scope)); + src, vpi_get_str(vpiFullName, scope)); return; } @@ -110,16 +110,16 @@ void sdf_select_instance(const char*celltype, const char*cellinst) vpi_printf("SDF WARNING: %s:%d: ", vpi_get_str(vpiFile, sdf_callh), (int)vpi_get(vpiLineNo, sdf_callh)); vpi_printf("Scope %s in %s is not a module.\n", - cellinst, vpi_get_str(vpiFullName, sdf_scope)); + src, vpi_get_str(vpiFullName, scope)); } /* The matching scope (a module) should have the expected type. */ if (strcmp(celltype,vpi_get_str(vpiDefName,sdf_cur_cell)) != 0) { vpi_printf("SDF WARNING: %s:%d: ", vpi_get_str(vpiFile, sdf_callh), (int)vpi_get(vpiLineNo, sdf_callh)); - vpi_printf("Module %s in %s is not a %s; it is an %s\n", cellinst, - vpi_get_str(vpiFullName, sdf_scope), celltype, - vpi_get_str(vpiDefName, sdf_cur_cell)); + vpi_printf("Module %s in %s is not a %s; it is a ", src, + vpi_get_str(vpiFullName, scope), celltype); + vpi_printf("%s\n", vpi_get_str(vpiDefName, sdf_cur_cell)); } }