From 251622c8bc3239adc099faaea498630fa6a9ef2a Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 24 Jul 2020 20:50:07 -0400 Subject: [PATCH] Corrected the routines DescendCountQueue and DescendCompareQueue to include type CLASS_MODULE in the list of types to descend into, since "module" (black-box) types need to be checked for pin matching even if they have no contents. This allows two verilog netlists to be compared against each other. --- VERSION | 2 +- base/netcmp.c | 7 +++++-- base/netfile.c | 7 ++++++- base/netfile.h | 7 ++++++- base/query.c | 2 +- base/spice.c | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 3059829..5065a9f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.149 +1.5.150 diff --git a/base/netcmp.c b/base/netcmp.c index 28326fb..a571fa3 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -3145,7 +3145,9 @@ void DescendCountQueue(struct nlist *tc, int *level, int loclevel) if (ob->type == FIRSTPIN) { /* First check if there is a class equivalent */ tcsub = LookupCellFile(ob->model.class, tc->file); - if (!tcsub || (tcsub->class != CLASS_SUBCKT)) continue; + /* Module (black-box) class needs pin checking */ + if (!tcsub || ((tcsub->class != CLASS_SUBCKT) && + (tcsub->class != CLASS_MODULE))) continue; else if (tcsub == tc) continue; DescendCountQueue(tcsub, level, loclevel + 1); } @@ -3238,7 +3240,8 @@ void DescendCompareQueue(struct nlist *tc, struct nlist *tctop, int stoplevel, tcsub = NULL; if (ob->type == FIRSTPIN) { tcsub = LookupCellFile(ob->model.class, tc->file); - if (!tcsub || (tcsub->class != CLASS_SUBCKT)) continue; + if (!tcsub || ((tcsub->class != CLASS_SUBCKT) && + (tcsub->class != CLASS_MODULE))) continue; else if (tcsub == tc) continue; DescendCompareQueue(tcsub, tctop, stoplevel, loclevel + 1, flip); } diff --git a/base/netfile.c b/base/netfile.c index 6bd5944..e54c615 100644 --- a/base/netfile.c +++ b/base/netfile.c @@ -798,7 +798,7 @@ int OpenParseFile(char *name, int fnum) FILE *locfile; struct filestack *newfile; - locfile = fopen(name,"r"); + locfile = fopen(name, "r"); linenum = 0; /* reset the token scanner */ nexttok = NULL; @@ -883,7 +883,12 @@ char *ReadNetlist(char *fname, int *fnum) {SPICE_EXTENSION, ReadSpice}, {SPICE_EXT2, ReadSpice}, {SPICE_EXT3, ReadSpice}, + {SPICE_EXT4, ReadSpice}, + {SPICE_EXT5, ReadSpice}, + {SPICE_EXT6, ReadSpice}, + {SPICE_EXT7, ReadSpice}, {VERILOG_EXTENSION, ReadVerilog}, + {SYS_VERILOG_EXTENSION, ReadVerilog}, {NETGEN_EXTENSION, ReadNetgenFile}, {NULL, NULL} }; diff --git a/base/netfile.h b/base/netfile.h index 32e0437..bef3dba 100644 --- a/base/netfile.h +++ b/base/netfile.h @@ -9,11 +9,16 @@ #define SIM_EXTENSION ".sim" #define SPICE_EXTENSION ".spice" #define SPICE_EXT2 ".spc" -#define SPICE_EXT3 ".fspc" +#define SPICE_EXT3 ".sp" +#define SPICE_EXT4 ".spi" +#define SPICE_EXT5 ".fspc" +#define SPICE_EXT6 ".cir" +#define SPICE_EXT7 ".ckt" #define NETGEN_EXTENSION ".ntg" #define CCODE_EXTENSION ".c.code" #define ESACAP_EXTENSION ".esa" #define VERILOG_EXTENSION ".v" +#define SYS_VERILOG_EXTENSION ".sv" #define LINELENGTH 80 diff --git a/base/query.c b/base/query.c index 8517d80..7067242 100644 --- a/base/query.c +++ b/base/query.c @@ -1066,7 +1066,7 @@ void Query(void) ActelLib(); break; case 'S': - promptstring("Read SPICE (.ckt) file? ", repstr); + promptstring("Read SPICE (.spice) file? ", repstr); ReadSpice(repstr, &filenum); break; case 'V': diff --git a/base/spice.c b/base/spice.c index 2e040dd..0c29b0a 100644 --- a/base/spice.c +++ b/base/spice.c @@ -1980,7 +1980,7 @@ void IncludeSpice(char *fname, int parent, struct cellstack **CellStackPtr, /* helps, if the file didn't have an extension. But */ /* really, we're getting desperate at this point. */ - if (strchr(fname, '.') == NULL) { + if (strrchr(fname, '.') == NULL) { SetExtension(name, fname, SPICE_EXTENSION); filenum = OpenParseFile(name, parent); if (filenum < 0) {