Commit Graph

43 Commits

Author SHA1 Message Date
Tim Edwards fcc884332b Made some corrections to the "extresist" code to avoid issues with
extracting a port-to-port net that does not touch any devices.
The error happens in a fairly rare set of cases.
2022-05-02 12:27:39 -04:00
Tim Edwards 6ecd077ab4 Restored compiling of the non-Tcl/Tk version of magic. This has
traditionally been kept for backwards compatibility.  However, the
operation of "ext2spice" and "ext2sim" as separate programs has
become extremely difficult to maintain, and so it has been dropped
in favor of folding both into the program as commands, as was done
a long time ago in the Tcl/Tk version.
2022-02-08 16:12:07 -05:00
Tim Edwards b5f2b75768 Removed code from ext2spice that is no longer functional.
Implemented a separate check for ports when writing a subcircuit
that cross-checks against the port list in the flattened
extraction.  This allows ports that were optimized out during
flattening of the hierarchy to be removed from the cell's port
list, which cuts down on disconnected nodes in the output port
list.
2022-01-12 15:30:07 -05:00
Tim Edwards 9a17539ca7 Corrected the use of EF_SUBS_NODE to distinguish between device
substrate (bulk terminal) and global substrate.  Otherwise, the
routine in ext2hier.c that finds the substrate node will find the
first device bulk connection, not the default substrate.
2021-12-30 13:27:42 -05:00
Tim Edwards 5e3c26c95a Tracked down two more memory leaks coming from ext2spice, due to
client data generated by ext2spice and attached to a node's
nodeClient record;  there is an initNodeClient() routine but no
corresponding freeNodeClient() routine.  Eventually had to add a
callback function passed to EFDone() and EFFlatDone() to clean up
these entries.  After doing that, valgrind reports clean for all
memory allocated within ext2spice (there are other things that are
not freed but not related to a specific command, so do not need to
be treated as leaks).
2021-12-13 18:05:53 -05:00
Tim Edwards 5913643ad0 Reverted most of yesterday's modifications. Instead located the
issue at the change made in revision 214.  This was done incorrectly
in two ways, one being a set of statements inside an if() block that
should have been executed always, and the other an incorrect use of
the EF_DEVTERM flag, setting it when it should not have been set.
2021-12-03 12:29:02 -05:00
Tim Edwards 6a8f1226d1 Corrected a problem with implicit substrate ports and connections;
implicit substrate connections under some conditions were not added
to the subcircuit pin list.  When this was corrected, the call to
the subcircuit was missing the implicit substrate port.  When that
was corrected, the implicit substrate port printed was the subcircuit's
local node name, not the connection from above in the hierarchy.  The
underlying problem was that the substrate was marked as a port in a
node record that was in another (flattened and unused) def and so not
seen when enumerating the def's node list.  It's possible that the
better solution is that the efNodeHashTable() should be enumerated to
write subcircuit ports, not def->def_nodes.  However, now, by using
EFHNLook(), the corresponding entry in efNodeHashTable() is found and
used.
2021-12-02 11:38:46 -05: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 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 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 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 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 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 '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 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 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 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 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 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 39ab59e7ec Corrected error causing a crash when parasitic extraction is
invoked on a layout with an array of instances.  Also, continued
implementation of antenna violation checking (not done yet).
2019-10-18 14:12:52 -04:00
Tim Edwards b493334c73 Preliminary changes to support extraction devices other than the original
simple FET device in extresist.  Also:  Extended the bloat-all CIF operator
again, allowing the trigger layer for the bloat operation to include both
CIF layers and magic layers (previously only magic layers were supported).
This extension is possible due to the previous extension allowing the
trigger layer and bloating layers to be on separate planes.  This operator
extension is useful for tagging geometry that is in the proximity of, but
not overlapping, geometry on another plane.
2019-10-17 16:21:56 -04:00
Tim Edwards 798e87deaf Corrected method relating to use of array notation in the base
use name (not part of an array in magic).  This was failing in
ext2spice due to code in extflat dealing incorrectly with the
array delimiters.  The correction fixes the problem but leaves
the possibility that there could be a conflict between a use
name that is an array and a use name that has the array index
as part of the name.
2019-10-01 19:32:52 -04:00
Tim Edwards 982bb8aa63 Changed a recent commit which removed brackets from instance names
while reading DEF.  To preserve names as much as possible, such
names are now kept.  To avoid problems, EFbuild.c and ext2hier
behavior has been changed to only parse entries in a .ext file as
instance arrays if the array notation follows the specific syntax
of [ax:bx:cx][ay:by:cy], letting all other uses of brackets pass
through unaffected.
2019-07-25 10:20:24 -04:00
Tim Edwards 53078588ae Changed the size of argv[] in efReadLine() to be 128 instead of
64 because I overran the 64 array with too many resistclasses in
a techfile.  This really should be dynamically allocated;  this
requires parsing the line to count tokens and reallocating as
needed (to be done).
2019-06-06 14:53:07 -04:00
Tim Edwards 9f5936c7cb Found an additional scaling-up problem in ext2spice (previously handled
a scaling issue in extract) which was caused by the addition of
hierarchical netlist generation.  Finding hierarchical connections
requires finding instances by name, so it is vastly better to create a
hash table of instances instead of a linked list.
2019-02-07 10:54:07 -05:00
Tim Edwards 395fb1a8d6 Corrected node merging, which failed to copy the EF_TOP_PORT flag
bit into the merged node.  Corrected reference to efNodeHashTable
to the more proper call to EFHNLook().
2018-11-15 15:55:41 -05:00
Tim Edwards 7dc15a7d28 Added extraction device type "csubcircuit", which should have been
added a long time ago, since capacitors use a different method for
calculating width and length than either transistors or resistors,
so subcircuits need a special class designator or else the extraction
may calculate the wrong dimensions for device width by totalling the
perimeter between the device and terminal types, as it would for a
MOSFET.
2018-10-30 16:19:20 -04:00
Tim Edwards 79a3934d40 Corrected an error that was previously assumed to be fixed in
8.2.74.  Top-level port names are now flagged independently of
any subcircuit port, so they are easier to identify when determining
naming precedence for the net.  This makes the code cleaner and
removes the problems arising from non-top-level ports and global
names overriding the subcircuit port names.
2018-10-29 17:29:15 -04:00
Tim Edwards 7d3cf14cdb Oops, Sept. 25 commit introduced an error that causes exactly what
the patch was attempting to fix.  For node naming, ports were given
precedence over globals.  However, this failed to distinguish between
ports on the top level and ports down in the hierarchy.  This has now
been fixed.  Ports on the hierarchy top level have naming precedence
over everything else;  otherwise, the traditional rules of node
naming precedence apply.
2018-09-27 08:13:31 -04:00
Tim Edwards 7189d84a08 Corrected the routines that determine the "best" name for a node
so that they always give precedence to a port name over a global
name.
2018-09-25 15:18:51 -04:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00