Commit Graph

69 Commits

Author SHA1 Message Date
Tim Edwards c0ea133e98 A recent commit caused connections to implicit (unlabeled) substrate
to not get into the subcircuit port list during ext2spice.  The new
fix brings back (unfortunately) the behavior of creating a substrate
node for cells that have no substrate connection to any device;
this will have to be handled separately.
2021-11-03 17:34:38 -04:00
Tim Edwards 15f081b4da Made a change to ext2hier.c that should prevent the propagation of
substrate nodes in subcircuits that don't make connections to the
substrate (such as arrays of pFETs).  This is done under the
restriction that ext2spice is being called without generating
parasitics (otherwise the connection to substrate is valid), as it
would be when extracting for LVS.  The ground node must not appear
as a connection to any device.  This is then propagated up the
hierarchy such that if none of a subcell's descendents connect to
the substrate, then neither does the subcell.
2021-10-05 20:34:22 -04:00
Tim Edwards bd59849309 Reverted a line in EFread.c back to the way it had been before
magic version 8.1.154.
2021-09-28 22:07:58 -04:00
Tim Edwards 73929a0bcc One more round of edits on that issue. . . 2021-09-20 20:14:25 -04:00
Tim Edwards 07ed2c13f4 Fix to the last commit, which was in error as pointed out by
Manar Abdelatty.
2021-09-20 19:46:57 -04:00
Tim Edwards c101d98921 Modified EFbuild.c to stop generating an error message when an
"equiv" statement is encountered in a .ext file when using the
"ext2spice short" option.
2021-09-20 15:02:57 -04:00
Tim Edwards c7077d38c3 Separated out the flag used for "ext2spice extresist on" and
"ext2sim extresist on", which was being shared;  that leads to
confusion, especially when using "ext2sim" to generate a node
name input file for "extresist".  Also:  Added a warning when two
ports are merged in a .ext file, as this can lead to numerous
incorrect entries in netlist output.
2021-09-13 10:36:01 -04:00
Tim Edwards d4a09bbc45 Correction to prior commit to remove collision between defined
flag bits for name trimming and short handling method in the
ext2spice options.
2021-07-10 21:27:19 -04:00
Tim Edwards 6136d3ff0f Implemented a command option "ext2spice short voltage|resistor|none" that
implements a method for handling ports in a subcircuit that have different
port names and indexes but are shorted together.  "none" is the default
and backwards-compatible behavior that merges ports together, which will
often cause one of the ports to be optimized out of the netlist.  "resistor"
will separate the port names with a 0-ohm ideal resistor.  "voltage" will
separate the port names with a 0-volt voltage source.  This should work
well for simulation and potentially for LVS, although its impact on LVS
has not been fully investigated.
2021-07-10 21:13:24 -04:00
Tim Edwards 1c0dbc907a Recast all uses of resist-class and device class in routines using
code from extflat from type unsigned long to type TileTypeBitMask.
This increases the number of types of each to 256 and tracks the
number of types, so it should be difficult to exceed this amount.
2021-05-27 16:13:06 -04:00
Tim Edwards 0809dddbe0 Resolved an outstanding issue with extresist, which is that the
extresist extractor is less sophisticated than the standard extraction
and will not check through the list of device records belonging to a
single device type.  Therefore a device in the .res.ext may have a
different device name.  So name hashing and checks are made against
the tile type, not the device name, as the tile type + device
coordinates is sufficient to uniquely identify the device.  However,
the extresist extractor does need to be sophisticated enough to find
all the terminal types, so that needs to be fixed.
2021-05-21 22:41:51 -04:00
Tim Edwards 123219b5f1 Corrected an error in the extresist code that will cause an infinite
recursive loop and crash magic.  Corrected a number of other issues
along the way, especially one where routines in EFantenna and extresist
make use of array EFDevTypes which was only created by ext2sim and
ext2spice, and freed when done.  Having run extresist through valgrind,
there are still issues in the code.
2021-05-21 16:33:20 -04:00
Tim Edwards 59fc24729c Corrected issues in the extresist function found after the previous
commit, mostly relating to the scale of values in the ".nodes" file
produced by ext2sim.  Making this file CIF syntax seemed unnecessary,
so I removed the CIF syntax and scaling.  "extresist" can now produce
an apparently valid output on a standard cell layout.  Even with the
change, the extresist output is still only pseudo-hierarchical, so
this does not preclude the need for eliminating the .sim format file
in favor of the .ext file, but it provides a working intermediate
form.
2021-04-21 13:03:26 -04:00
Tim Edwards f84de3676a Moved the substrate plane/restore further out so that planes are
not restored until after all cells have been processed through
extraction.  Otherwise, top-down connections can end up with
different generated names for the same node, resulting in a
disconnect in the netlist.
2021-04-05 16:03:54 -04:00
Tim Edwards 2532a696e4 Correction from a recent commit; complicated sets of "equiv"
statement in a .ext file require that all aliases of a node name be
rehashed after a node merge, or else node loops can occur.  Also
prevented statements of the form "equiv A A" from being output in
the .ext file, as they are useless.
2021-03-18 11:37:44 -04:00
Tim Edwards fd4569081e Added a reference count to the node structure in extflat to account
for the "equiv" statement---equivalent nodes names have to be
registered in the def->def_nodes hash table, and if they point to
the same node, then that node can't be free'd until the last
referenced node is seen when iterating through the hash table to
free the node records during EFDone().  This is handled by the
reference count.
2021-03-17 14:54:36 -04:00
Tim Edwards 010c0599bd Encountered a crash condition caused by the "equiv" statement, for
circuits with nets having multiple conflicting labels, depending
on where the "equiv" statement occurs in the .ext file output.
Corrected the error but am still puzzled as to why this has never
shown up before, as it does not appear to be the result of any
recent development work.
2021-03-16 20:31:29 -04:00
Tim Edwards 324721b514 Added some options to the net selection with respect to labels.
The previous behavior was to generate hierarchical names for all
labels when copying contents of subcells.  This is "safe" for
copying selections without accidentally shorting things through
labeling, but it can make a mess of the selection.  Options are
now "select do labels" for the existing behavior, "select no labels"
to not show any labels, and "select simple labels" to show only the
root name of labels in subcells.
2021-03-04 14:00:31 -05:00
Tim Edwards 83808dcf79 Corrected an error that was causing disconnects in the hierarchical
SPICE netlist output that appears to have come from flags created
for writing DEF that inappropriately got set during ext2spice.
A redundant call to efAddNodes() was adding confusion by appearing
to handle most cases but actually missing some.  With the corrected
flag, the redundant call is really redundant and can be removed.
It has not been tested whether DEF output is affected by the change
(DEF output from magic is rarely used, anyway).
2021-03-01 11:08:25 -05:00
Tim Edwards a61026588c Revert "Modified the .ext file reading and the .spice file writing so that"
This reverts commit 46baae0ce6.

Reverting the last commit, as it does not work completely the way it
is supposed to, and will most likely have to be done in a different
way.
2021-02-24 12:35:06 -05:00
Tim Edwards 46baae0ce6 Modified the .ext file reading and the .spice file writing so that
array delimiters and hierarchy separators (characters '/', '[', and ']')
that are part of instances or labels passed to magic, are preserved
from input to output, but internally marked (with a backslash escape)
so that they are not misinterpreted my magic when running ext2spice.
2021-02-23 13:46:12 -05:00
Tim Edwards 44325f81e6 Corrected two errors: (1) Do not write subcircuit calls to subcircuits
that have been removed by flattening into the parent cell due to lack
of devices.  Previously the checks on writing the subcircuit and writing
the call were slightly different, leading to instances in which the
subcircuit call would be written to the netlist output without the
subcircuit being defined.  (2) Corrected an error in the "bridge" CIF/GDS
output operator.  In certain (somewhat rare) geometries, the tile behind
(instead of in front of) the corner being checked may be incorrectly
flagged as a DRC spacing error.  The fix is to ignore tiles that are
behind the corner being checked.
2020-12-28 16:54:20 -05:00
Tim Edwards 47f37cc13a Corrected a subtle but very bad compiler-dependent error in the
extflat code;  failure to provide a forward external reference
to EFHNBest() resulted in a failure to correctly evaluate a
boolean expression.  That resulted in a failure to merge
hierarchical nodes during ext2spice, resulting in an incorrect
netlist with single nodes broken up into pieces.
2020-12-21 14:22:24 -05:00
Tim Edwards 4bbe4ef74e Added another fix from a pull request by Dan Moore, which apparently
fixes a problem with substrate nodes not being flagged as such when
reading .ext files.
2020-10-14 22:53:03 -04:00
Tim Edwards 0598f4edf7 Corrected a potential segfaulting error in which (apparently)
port labels that are unnattached ("attached" to space), or possibly
sticky labels without any geometry underneath, end up with a NULL
node during EFBuild().
2020-08-02 09:37:45 -04:00
Tim Edwards fc9ecd2c9b Corrected a problem with an uninitialized entry in ExtCurStyle that
could cause serious errors on systems that do not auto-zero allocated
memory.  Also:  Fixed an error introduced by a recent commit to allocate
character memory for efReadLine() which frees the memory before reading
a .res.ext file, causing a crash when using "ext2spice" with the
"extresist on" option.
2020-06-05 12:46:46 -04:00
Tim Edwards ac244109bc Modified the efReadLine() routine so that it dynamically allocates
memory for the input line instead of using a fixed 1024-character
buffer.  That avoids the issue of rare but possible overflow when
reading a .ext file with unknown line lengths.
2020-06-03 21:57:56 -04:00
Tim Edwards efe6af8465 Modified the EFread routine so that it will not infinite loop on
a truncated line.  There is still a question as to why an example
occurred that caused a line to be truncated, and whether a buffer
size needs to be made larger or made dynamically allocated.
2020-06-03 20:36:12 -04:00
Tim Edwards 01966d594e Additional modification to the devVisit routine in extflat to
change from passing the HierName to passing the HierContext (of which
HierName is a part) so that more information from HierContext (such
as the cell use being visited) can be passed to the callback
procedure (largely for diagnostic purposes).
2020-06-01 17:14:22 -04:00
Tim Edwards 28d8808c65 Corrected several improper uses of StrDup() that used the first
argument as a pointer but also set the same variable to the
return value.  This is ambiguous, because the behavior depends on
whether the value being set upon return is the original value or
the reallocated value.  The result is system-dependent behavior.
2020-05-28 17:09:03 -04:00
Tim 'mithro' Ansell b47d4c5642 Removing extra `$Header$` 2020-05-27 20:35:27 -04:00
Tim Edwards df9a52de6c Corrected potential crash condition that can happen if there is one
or more repeated "equiv" lines in a .ext file.  This implies two
ports with different names are connected, indicating probably a bad
layout, but that's not a reason to have magic crash.
2020-05-23 21:33:42 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 97df4e8dd1 Removed a diagnostic debugging message from the antennacheck routine. 2020-04-09 19:37:23 -04:00
Tim Edwards 7e1fcc8ef6 Fixed lefWrite, which was not including drc.h and so was messing up
one of the arguments to the DRC technology query.  Also, drc/drc.h
itself did not export that particular function, so it was added.
2020-04-07 20:08:42 -04:00
Tim Edwards 937e848d03 Modified DBTreeCopyConnect() so that it can take an argument to
not copy labels;  not copying labels speeds up the antenna checks
(which don't need labels) greatly.  Also fixed several numerical
overflow problems in the antenna checks, which resulted in false
positive errors, as well as nonsensical results.
2020-04-03 16:22:56 -04:00
Tim Edwards ad13e48a07 Corrected ext2spice for the case where a port has been given more
than one name, because in that case one of the port records ends
up with a null pointer to a node, and causes a crash condition.
This can happen inadvertently, as when a connected node is not
specifically designated a port, but is forced to be a port
because of the connection.
2020-03-20 14:50:56 -04:00
Tim Edwards 80fa495103 Removed the Depend files, which were being tracked with .gitignore
pointing to Depend instead of */Depend.
2020-03-13 15:39:08 -04:00
Tim Edwards 2569a06c1f Substantial improvements on several fronts, mostly to do with
extraction:  Fixed a problem causing long extraction times, at
least some of which had to do with a poor string hash function
implementation.  Fixed a huge problem in ext2spice, where the
node merge function was particularly poorly implemented, causing
exponentially increasing processing times with layout size.
Corrected a minor issue with ext2spice where arguments were
improperly specified, causing unnecessary error messages to be
issued.  Fixed an error in the "load -dereference" command option,
which again caused unnecessary error messages to be issued.
Changed .gitignore to ignore Depend files, which are now regenerated
on every build.
2020-03-13 10:33:44 -04:00
Tim Edwards fc4638634a Corrected the ifdef MAGIC_WRAPPER placement in the EFantenna.c file,
which should have been only around the tclmagic.h include.
2020-01-17 12:54:58 -05:00
Tim Edwards afe38c55c8 Resolved some issues with working with ext2spice using abstract
views.  Because the abstract view does not necessarily represent
actual connectivity, rely on the port indexes in the .ext file
to determine the number of ports and port order.  Do not use
SpiceNodeName() to look up the node name, or unique ports that
are deemed shorted will go missing.  Also:  Modified the read-in
of .ext files so that use names may contain backslashes.  Only
backslashes that end a line will be handled differently.
2020-01-13 12:58:04 -05:00
Tim Edwards d0f3aaeb59 Corrected ext2hier.c so that resistance output from extresist takes
the right argument type (float, not int).  Otherwise all resistances
from extresist come out zero when doing "ext2spice extresist on"
and "ext2spice hierarchy on".  Also changed the format of the resistance
in the SPICE output to type float, since values are in standard units of
ohms, and rounding to the nearest ohm seems excessively coarse-grained.
2019-12-16 09:55:11 -05:00
Tim Edwards fd737dbf80 Overhauled the extresist code (again), this time to (1) correct for
a long-standing error (introduced with the "extresist geometry"
option) that can cause nets not to be extracted (due to the first
record not having extraction data, which was itself a long-standing
error in the code but which was not fixed correctly);  (2) handle
"device mosfet" type transistors (previously only handled the old
"fet" type extraction devices);  and (3) correct for the res.ext
file having a different scalefactor relative to the .ext file.  The
latter item was solved by forcing all input to scale like
ExtCurStyle->exts_unitsPerLambda, locally correcting all input as
needed.  Note that extresist still needs to handle other extraction
devices (e.g., resistors and capacitors) but those will require
additional handling in the routines which analyze the current path
to determine how to break up wires into paths.
2019-12-08 17:37:48 -05:00
Tim Edwards cfaccd973f Expanded the antenna rule violation setup and calculations to
include (1) specification of sidewall or surface to use for
each type individually, rather than a single method for all
types, and (2) specification of a linear model R = Ax + B for
the ratio limit when diodes are attached to the wire, where x
is the diode surface area (unitless, as this is a ratio).
2019-11-27 10:38:47 -05:00
Tim Edwards d3eb03d19a Additional correction to extraction, still part of the effort to
remove redundant ports.  A comment that I left in the code at the
last commit asked if it was necessary to call efAddNodes and
efAddConns recursively.  An example came up in which the answer
is apparently "yes".  These routines have been replaced by
efFlatNodes(), which appears to solve the problem.  There is now
a question of whether efFlatNodesDeviceless() does anything, and
should its main behavior (to flag deviceless subcircuits) be
folded into efFlatNodes.
2019-11-17 19:08:47 -05:00
Tim Edwards 0eb3b1fe1c Corrected an error in ext2spice related to the recent modification to get
rid of redundant port entries in subcircuits.  There is still an outstanding
issue as to whether nodes and connections need to be recursively iterated
to the hierarchy bottom.  The current fix corrected the test case.  Also,
added a "-dereference" option to the "load" command to revert to the
original behavior of using only search paths from "addpath" when searching
for files to load.
2019-11-14 15:18:26 -05:00
Tim Edwards 3a6f868efc Corrected an error in ext2spice caused by recent changes, that can
generate an extra node in the extract output that comes out as a
"(none)" node in the SPICE netlist from ext2spice.
2019-11-13 13:05:03 -05:00
Tim Edwards c342178458 Made some changes to the way that ext2spice generates subcircuit
ports, to avoid creating ports for node names that are redundant.
It would probably be better to avoid creating the redundant node
names in the first place;  however, I am less certain why these
are generated.  The incorrect additional ports all have hierarchical
names in the cell, which is a sign that they are incorrect, as the
cell itself should not have any parents.  The level of certainty
about this fix is definitely not 100%, but it was tested on a
hierarchical analog design, and setting levels of parasitic caps
caused new nodes to appear in subcircuits and in no cases did
information appear to be lost.
2019-10-29 09:44:28 -04:00
Tim Edwards a4ea827d1e More corrections to extresist, which now appears to work if used
with ext2spice without the hierarchy option.  More work needed to
produce correct hierarchical output and to support extraction
devices other than the old "fet" record.
2019-10-28 13:10:16 -04:00
Tim Edwards d9ccd711d9 Realizing that the "no such node" messages were directly related to
the below-threshold coupling caps being removed from the hierarchy,
added code to suppress the error message when it is clearly related
to a below-threshold cap that has been removed.
2019-10-23 11:59:59 -04:00