Compare commits

...
6 Commits
Author SHA1 Message Date
Tim Edwards 4250525e19 Merge branch 'master' into netgen-1.5 2023-11-21 02:00:01 -05:00
Tim Edwards a7e859fcde Corrected an error in parallel_sort and series_sort that does not
move to the start index before relinking the sorted entries.  That
will cause properties to be lost whenever the start index is greater
than zero.  Not sure why this hasn't been caught previously, or
whether other errors are involved here.
2023-11-20 10:38:41 -05:00
Tim Edwards c1ed4ce49e Merge branch 'master' into netgen-1.5 2023-10-28 02:00:04 -04:00
Tim Edwards 6d23844483 Corrected an error in the flattening routine that will cause the
"flatten" command to crash if there are black-box subcircuits in
the netlist.
2023-10-27 10:35:27 -04:00
Tim Edwards cc84364263 Added code to the netgen Tcl startup script to grab the PDK_ROOT
variable used with open_pdks, so that PDK references can be made
independent of the local filesystem.
2023-10-27 09:54:21 -04:00
Tim Edwards 00b906c109 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.
2023-10-27 09:38:14 -04:00
5 changed files with 24 additions and 16 deletions
+1 -1
View File
@@ -1 +1 @@
1.5.261
1.5.263
+6 -12
View File
@@ -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 */
}
+2 -3
View File
@@ -136,17 +136,16 @@ void flattenCell(char *name, int file)
ob2 = ob2->next;
}
/* delete all port elements from child */
while (IsPort(ChildObjList)) {
/* delete all ports at beginning of list */
if (Debug) Printf("deleting leading port from child\n");
tmp = ChildObjList->next;
FreeObjectAndHash(ChildObjList, ChildCell);
ChildObjList = tmp;
if ((ChildObjList = tmp) == NULL) break;
}
tmp = ChildObjList;
while (tmp->next != NULL) {
while (tmp && (tmp->next != NULL)) {
if (IsPort(tmp->next)) {
ob2 = (tmp->next)->next;
if (Debug) Printf("deleting a port from child\n");
+2
View File
@@ -4331,6 +4331,7 @@ void series_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
// Re-sort list
obp = ob1;
for (i = 0; i < idx1; i++) obp = obp->next;
for (i = 0; i < run; i++) {
obp->next = proplist[i].ob;
obp = obp->next;
@@ -4534,6 +4535,7 @@ void parallel_sort(struct objlist *ob1, struct nlist *tp1, int idx1, int run)
// Re-sort list
obp = ob1;
for (i = 0; i < idx1; i++) obp = obp->next;
for (i = 0; i < run; i++) {
obp->next = proplist[i].ob;
obp = obp->next;
+13
View File
@@ -741,6 +741,19 @@ set auto_noexec 1 ;# don't EVER call UNIX commands w/o "shell" in front
# Cross-Application section
#----------------------------------------------------------------------
# For use with open_pdks, set PDK_ROOT from the environment. If no
# such environment variable exists, check some common locations.
if {[catch {set PDK_ROOT $::env(PDK_ROOT)}]} {
if {[file isdir /usr/local/share/pdk] == 1} {
set PDK_ROOT /usr/local/share/pdk
} elseif {[file isdir /usr/share/pdk] == 1} {
set PDK_ROOT /usr/share/pdk
} elseif {[file isdir /foss/pdk] == 1} {
set PDK_ROOT /foss/pdk
}
}
# Setup IRSIM assuming that the Tcl version is installed.
# We do not need to rename procedure irsim to NULL because it is
# redefined in a script, which simply overwrites the original.