Suppress unnecessary VCD/LXT/LXT2 warnings about packages.

Only output a warning if a package contains dumpable items. This is
mainly to avoid the warning about the $unit scope when a design has
been compiled for a SV generation (issue #710).
This commit is contained in:
Martin Whitaker 2024-01-07 20:16:49 +00:00
parent fa2dfe690c
commit 96df251c95
5 changed files with 86 additions and 68 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002-2023 Stephen Williams (steve@icarus.com)
* Copyright (c) 2002-2024 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
@ -501,6 +501,23 @@ static PLI_INT32 sys_dumplimit_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
static void scan_item(unsigned depth, vpiHandle item, int skip)
{
static int dumpable_types[] = {
/* Value */
/* vpiNamedEvent, */
vpiNet,
/* vpiParameter, */
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
struct t_cb_data cb;
struct vcd_info* info;
@ -629,23 +646,6 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
if (depth > 0) {
const char* fullname = vpi_get_str(vpiFullName, item);
/* list of types to iterate upon */
static int types[] = {
/* Value */
/* vpiNamedEvent, */
vpiNet,
/* vpiParameter, */
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
int i;
int nskip = (vcd_names_search(&lxt_tab, fullname) != 0);
@ -665,9 +665,9 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
push_scope(name);
for (i=0; types[i]>0; i++) {
for (i=0; dumpable_types[i]>0; i++) {
vpiHandle hand;
vpiHandle argv = vpi_iterate(types[i], item);
vpiHandle argv = vpi_iterate(dumpable_types[i], item);
while (argv && (hand = vpi_scan(argv))) {
scan_item(depth-1, hand, nskip);
}
@ -678,6 +678,8 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break;
case vpiPackage: /* Skipped */
// Don't print a warning for empty packages.
if (vcd_instance_contains_dumpable_items(dumpable_types, item))
vpi_printf("LXT warning: $dumpvars: Package (%s) is not dumpable "
"with LXT.\n", vpi_get_str(vpiFullName, item));
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2023 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2024 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
@ -561,6 +561,23 @@ static PLI_INT32 sys_dumplimit_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
static void scan_item(unsigned depth, vpiHandle item, int skip)
{
static int dumpable_types[] = {
/* Value */
/* vpiNamedEvent, */
vpiNet,
/* vpiParameter, */
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
struct t_cb_data cb;
struct vcd_info* info;
@ -681,23 +698,6 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
if (depth > 0) {
const char* fullname = vpi_get_str(vpiFullName, item);
/* list of types to iterate upon */
static int types[] = {
/* Value */
/* vpiNamedEvent, */
vpiNet,
/* vpiParameter, */
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
int i;
int nskip = vcd_scope_names_test(fullname);
@ -717,9 +717,9 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
push_scope(name);
for (i=0; types[i]>0; i++) {
for (i=0; dumpable_types[i]>0; i++) {
vpiHandle hand;
vpiHandle argv = vpi_iterate(types[i], item);
vpiHandle argv = vpi_iterate(dumpable_types[i], item);
while (argv && (hand = vpi_scan(argv))) {
scan_item(depth-1, hand, nskip);
}
@ -730,6 +730,8 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break;
case vpiPackage:
// Don't print a warning for empty packages.
if (vcd_instance_contains_dumpable_items(dumpable_types, item))
vpi_printf("LXT2 warning: $dumpvars: Package (%s) is not dumpable "
"with LXT2.\n", vpi_get_str(vpiFullName, item));
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2023 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2024 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
@ -485,6 +485,23 @@ static PLI_INT32 sys_dumplimit_calltf(ICARUS_VPI_CONST PLI_BYTE8 *name)
static void scan_item(unsigned depth, vpiHandle item, int skip)
{
static int dumpable_types[] = {
/* Value */
vpiNamedEvent,
vpiNet,
vpiParameter,
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
struct t_cb_data cb;
struct vcd_info* info;
@ -694,23 +711,6 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
case vpiNamedFork:
if (depth > 0) {
/* list of types to iterate upon */
static int types[] = {
/* Value */
vpiNamedEvent,
vpiNet,
vpiParameter,
vpiReg,
vpiVariables,
/* Scope */
vpiFunction,
vpiGenScope,
vpiModule,
vpiNamedBegin,
vpiNamedFork,
vpiTask,
-1
};
int i;
int nskip = (vcd_names_search(&vcd_tab, fullname) != 0);
@ -726,9 +726,9 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
name = vpi_get_str(vpiName, item);
fprintf(dump_file, "$scope %s %s $end\n", type, name);
for (i=0; types[i]>0; i++) {
for (i=0; dumpable_types[i]>0; i++) {
vpiHandle hand;
vpiHandle argv = vpi_iterate(types[i], item);
vpiHandle argv = vpi_iterate(dumpable_types[i], item);
while (argv && (hand = vpi_scan(argv))) {
scan_item(depth-1, hand, nskip);
}
@ -740,6 +740,8 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break;
case vpiPackage:
// Don't print a warning for empty packages.
if (vcd_instance_contains_dumpable_items(dumpable_types, item))
vpi_printf("VCD warning: $dumpvars: Package (%s) is not dumpable "
"with VCD.\n", vpi_get_str(vpiFullName, item));
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003-2023 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2024 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
@ -51,6 +51,16 @@ int is_escaped_id(const char *name)
return 1;
}
int vcd_instance_contains_dumpable_items(int dumpable_types[], vpiHandle item)
{
int i;
for (i = 0; dumpable_types[i] > 0; i++) {
if (vpi_iterate(dumpable_types[i], item))
return 1;
}
return 0;
}
struct stringheap_s name_heap = {0, 0};
struct vcd_names_s {

View File

@ -1,7 +1,7 @@
#ifndef IVL_vcd_priv_H
#define IVL_vcd_priv_H
/*
* Copyright (c) 2003-2023 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2024 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
@ -29,6 +29,8 @@
EXTERN int is_escaped_id(const char *name);
EXTERN int vcd_instance_contains_dumpable_items(int dumpable_types[], vpiHandle item);
struct vcd_names_s;
EXTERN struct stringheap_s name_heap;