From 00b906c1099f01ecd20add363c89b6050b4e7c83 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 27 Oct 2023 09:38:14 -0400 Subject: [PATCH] Corrected an error in the previous commit which made primitive devices from a .prm file into class "subckt" when they should be class "module" (because they are primitives). Otherwise, netgen will crash when attempting to flatten them. --- VERSION | 2 +- base/ext.c | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/VERSION b/VERSION index 774046f..7defbbd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.261 +1.5.262 diff --git a/base/ext.c b/base/ext.c index 55fdf7d..e0d2f86 100644 --- a/base/ext.c +++ b/base/ext.c @@ -462,11 +462,6 @@ void simCell(char *name, int filenum) return; } - /* Check procedure disabled because new extensions to .sim format - * allow 'x' records to represent low-level components that are - * modeled as SPICE subcircuits. - */ -#if 0 /* check to see that all children have been dumped */ ob = tp->cell; while (ob != NULL) { @@ -478,7 +473,6 @@ void simCell(char *name, int filenum) } ob = ob->next; } -#endif SetExtension(FileName, name, SIM_EXTENSION); if (!OpenFile(FileName, 0)) { @@ -603,7 +597,7 @@ void simCell(char *name, int filenum) FlushString(" %g\n", v); break; - case CLASS_SUBCKT: case CLASS_MODULE: + case CLASS_MODULE: *writeLine = 'x'; *(writeLine + 1) = '\0'; mult = 1; @@ -812,7 +806,7 @@ char *ReadPrm(char *fname, int *fnum) PropertyDouble(devicename, filenum, "w", 0.01, 0.0); PropertyInteger(devicename, filenum, "nf", 0, 1); PropertyInteger(devicename, filenum, "m", 0, 1); - SetClass(CLASS_SUBCKT); + SetClass(CLASS_MODULE); EndCell(); ReopenCellDef(fname, filenum); } @@ -833,7 +827,7 @@ char *ReadPrm(char *fname, int *fnum) PropertyDouble(devicename, filenum, "w", 0.01, 0.0); PropertyInteger(devicename, filenum, "nf", 0, 1); PropertyInteger(devicename, filenum, "m", 0, 1); - SetClass(CLASS_SUBCKT); + SetClass(CLASS_MODULE); EndCell(); ReopenCellDef(fname, filenum); } @@ -855,7 +849,7 @@ char *ReadPrm(char *fname, int *fnum) PropertyDouble(devicename, filenum, "l", 0.01, 0.0); PropertyDouble(devicename, filenum, "w", 0.01, 0.0); PropertyInteger(devicename, filenum, "m", 0, 1); - SetClass(CLASS_SUBCKT); + SetClass(CLASS_MODULE); EndCell(); ReopenCellDef(fname, filenum); } @@ -877,7 +871,7 @@ char *ReadPrm(char *fname, int *fnum) PropertyDouble(devicename, filenum, "l", 0.01, 0.0); PropertyDouble(devicename, filenum, "w", 0.01, 0.0); PropertyInteger(devicename, filenum, "m", 0, 1); - SetClass(CLASS_SUBCKT); + SetClass(CLASS_MODULE); EndCell(); ReopenCellDef(fname, filenum); /* Reopen */ } @@ -893,7 +887,7 @@ char *ReadPrm(char *fname, int *fnum) Port("anode"); Port("cathode"); PropertyInteger(devicename, filenum, "m", 0, 1); - SetClass(CLASS_SUBCKT); + SetClass(CLASS_MODULE); EndCell(); ReopenCellDef(fname, filenum); /* Reopen */ }