Commit Graph

61 Commits

Author SHA1 Message Date
Tim Edwards 0dac37cb46 Changed the behavior of GDS writing to halt with an error if an
attempt is made to write an abstract view to GDS.  This behavior can
be overridded with the new command option "gds abstract [enable|disable]".
Also:  Corrected extraction to allow split tiles to be set as the
reference tile for a node.  Previously this was allowed only if the
tile was the first to be searched, but that can cause different tiles to
be marked as the reference depending on where the search starts,
resulting in different names for the same node in .ext files, which is
bad.  Also:  Modified the LEF annotation to avoid bad entries in the LEF
that would create layers in the layout where none exist.
2022-11-02 09:40:20 -04:00
Tim Edwards 5d51e10fb9 Corrected an error with perimeter calculation of a device that was
caused by other code that can move the plane of a device to match
the plane of a port.  Solved by retaining the original plane of the
node in the extTransRec structure, and using that to determine the
device plane for purposes of calculating perimeters and not double-
counting contacts.
2022-08-30 10:13:18 -04:00
Tim Edwards 1d570a5b67 Found one more error that was causing issues with the hierarchical
capacitance adjustments, and may have caused issues with basic
hierarchical extraction as well (although I have not checked or
proven the latter).
2022-06-04 21:09:54 -04:00
Tim Edwards bcf35db713 Working through various issues with parasitic capacitance extraction
using the newer methods for nearest-edge searching and fringe area
of effect.  Removed a same-net check in a routine that removes
capacitances that are redundant due to hierarchical overlaps;  these
redundancies must be checked on shapes within the same net.  Corrected
(again) an out-of-clip-bounds check.
2022-06-04 08:16:50 -07:00
Tim Edwards 3d4b3ad914 Found another place where a bounds check on the clip area was not
done (at all), again resulting in negative capacitances.
2022-06-01 04:54:59 +00:00
Tim Edwards 468a8ae0be Added a 2nd use of the "device" property, which has long been needed,
which instead of defining a device or subcircuit that exists inside
the cell, instead redefines the cell itself as a device or subcircuit
model that exists in the PDK.  This is used where a specific layout
subcell has its own associated device definition in the PDK.  Instead
of the "device" property value being the line that gets generated for
a device in the subcells .ext file, the property value should be the
word "primitive" optionally followed by any parameters that need to
be passed to the subcircuit call.
2022-05-04 16:43:38 -04:00
Tim Edwards e00633b8a1 Corrected an issue in the extraction where a region could be set to
a split tile type, causing a crash if the node name had to be
discovered by a "hard search".
2022-05-04 12:00:09 -04:00
Tim Edwards db4fa65bfc Corrected some issues related to the handling of substrate hierarchy.
Most of this had to do with the incorrect use of the parent's substrate
name in extHierSubstrate().  After the correction, there still remains
an issue that is caused when a labeled isolated substrate region overlaps
an extraction tile boundary.  I believe that this particular error has
existed for some time and is not new, so I am committing these changes.
2022-02-24 16:47:11 -05:00
Tim Edwards 7d601628e4 This commit adds an additional function to the substrate generation,
effectively forcing the substrate type (e.g., "pwell") to be defined
as delineating isolated substrate areas only (e.g., pwell in deep nwell
or isosub a.k.a. subcut).  It does so by erasing all of the substrate
type out of a cell prior to extraction before redrawing it in the
isolated areas.  This avoids issues caused by pwell drawn in separate
unconnected areas of a cell, as these are removed and the area treated
as the default substrate everywhere.  Has worked on all layouts tested
so far.
2022-02-17 17:06:25 -05:00
Tim Edwards 2e99d0cff7 Changed the behavior of "extract" routine extFindNodes() to not
check for abstract views to determine how to handle the substrate
node.  Running tests to check if this has any negative impact on
the extraction of abstract views that do not specify substrate
and well types.
2022-02-17 11:27:43 -05: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 d4961f244d Modified the extraction code to work around a problem created some
time ago by cleaning up excess usage of "equiv" lines in the .ext
file output.  The hierarchical extraction code did not distinguish
between node names which were output and those that were not,
requiring a setting "extract do aliases" to force all node aliases
to be output with "equiv" statements.  So hierarchical names
might be any alias, whether output or not, and "merge" and "cap"
lines might contain references to nodes that were not output,
causing them to be disconnected nodes.  This fix handles the
"extract no aliases" (default) case by flagging node names that
are redundant and not output, and not creating hierarchical names
with them.
2022-01-14 16:13:36 -05:00
Tim Edwards b68744a944 Made a change to basic extraction to avoid generating an extra
node representing the global substrate on cells that are abstract
views.  Corrected a typecasting issue in ext2spice.c that throws
a compiler warning.  Added another check for a cell being editable
when painting, which is a case that was not covered by the
previous code change to address the same issue.
2022-01-13 12:56:20 -05:00
Anton Blanchard 4f79580248 Add missing includes
A number of places are using isspace(), tolower(), toupper() and strcmp()
without including the relevant header.
2022-01-10 14:01:36 -05:00
Tim Edwards 86f7c1f2cf Corrected the return value of extSubsFunc2(), which was returning
value 1 after finding a substrate connecting type shielded (by deep
nwell, in the example) from the substrate, thus preventing the
search from processing any remaining substrate types.  Solved by
changing the return value to zero to keep the search going.
2021-12-23 16:31:34 -05:00
Tim Edwards 43bb499bcf Corrected an issue with the limited bitfield dedicated to port numbers;
this limited ports to 16384, which seemed reasonable at the time.
However, the sky130_sram_macro layouts connect power and ground in a
way that when coupled with "extract unique" can generate tens of
thousands of ports and overrun the bit field, showing that automation
can do the unexpected.  The solution was to split out the port number
from the label record as its own 32-bit value.
2021-12-12 22:09:31 -05:00
Tim Edwards 537b1f057d Modified the generation of "equiv" statements in "extract" some more,
to eliminate all redundant names resulting from redundant labels.
Changed the behavior of "goto" so that it will find local names with
slashes, which are the result of using "flatten".  A hierarchical
search is done first, as before, but on failure to find a subcell
component, the local cell is searched for the verbatim name.
2021-10-08 10:58:10 -04:00
Tim Edwards bf89c834f4 Removed a line that should have been removed before the last commit. 2021-10-08 08:43:05 -04:00
Tim Edwards 4fae7a1a2b One more correction to limit, by default, the generation of "equiv"
statements in the .ext file output to those that mark a port as
equivalent to the node name used elsewhere in the file.  This
limits unnecessary output of "equiv" statements that can bog down
ext2spice and other commands that use the .ext file contents.
2021-10-07 21:36:10 -04:00
Tim Edwards b598ce8f94 Modified "ext2sim" behavior so that "=" statements are output
(since these are interpreted by IRSIM, the only known program to
parse .sim output)---the "ext2sim alias on" option now just moves
such statements from the ".sim" file to a ".al" file.  Corrected the
ResSimMerge() routine to reverse the nodes, so that the devices
belonging to the aliased node are added to the original node, instead
of the other way around.  This corrects "missing gate" and "missing SD"
errors that occur due to nodes connected through the substrate.
2021-09-13 12:25:38 -04:00
Tim Edwards 88d672c7a5 Corrected an error that prematurely exists the substrate search
if a shielded type is found, preventing any other substrate types
from being discovered and processed.
2021-08-25 21:40:27 -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 fca21c8fc0 Corrected an error causing weird and undefined behavior when
extracting substrate regions, due to failure to clean up the tagged
tiles after exiting a search due to finding a substrate type that
was not the global substrate.
2021-04-05 14:16:28 -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 3c42c5a7f3 Corrected the extraction method for devices with terminals on the
implicit global substrate, as a block of code meant to handle this
case was left unreachable by another recent code fix.
2021-01-21 09:57:03 -05:00
Dan Moore 86c0b7dbbd One last change for issue #50 2021-01-14 12:14:40 -05:00
Tim Edwards 67d0d8c3f0 Corrected the use of the global substrate node name; this has been
restricted to its original intent, which is to replace the long name
formed from the plane short name and the "minfinity" coordinate.
This avoids issues with conflicting substrate names derived from a
real layer such as pwell.  Also, the global substrate node name now
returns the variable name without the "$" in front if the variable
has not been set to anything.  This avoids potential syntax errors
in the netlist.
2021-01-07 15:19:36 -05:00
Tim Edwards d6eeb90f6b Made corrections to the extraction based on a pull request by
Dan Moore for preventing integer overflow in the area calculations.
2021-01-05 12:25:25 -05:00
Tim Edwards 3aef946167 Corrected an error that can confuse a source-drain tied device
with another device record for the same magic type.
2020-12-23 13:39:25 -05:00
Tim Edwards a660d73d5a Fixed a problem with extraction. If an extraction line specifies
one terminal of a device as the substrate, but also specifies
shielding types for the substrate, then the extraction cannot just
assume that a missing terminal is connected to the substrate without
first checking that there are no substrate shielding types under the
device.
2020-12-21 10:10:18 -05:00
Tim Edwards d50fd1c42c Corrected a wayward cut-and-paste error from the last commit. 2020-10-26 13:23:52 -04:00
Tim Edwards 1891abe348 Also added code to not put parameters for a device marked "Ignore"
into the .ext file, in case such devices were assigned parameters.
2020-10-26 13:12:18 -04:00
Tim Edwards 0a1cb9ca99 Added a method to ignore a specific device extraction combination
by setting the model name to "Ignore" in the tech file.
2020-10-26 11:41:36 -04:00
Tim Edwards a015b7f8eb Corrected a problem in which extraction of MOS caps (or any device
with two or more terminals other than the device identifier type
tied together) would fail if there were not a device record
specifically matching a one-S/D-terminal device.  This is
inconsistent with past behavior, and so has been fixed.
2020-10-17 12:43:22 -04:00
Tim Edwards 5308c35268 Corrected one final case of extracting an extended-drain pFET
because the opposite type (pwell) is not directly underneath the
gate, but touches it on the plane below.  Because the pwell may
be represented by space tiles on the well plane, it was also
necessary to deal with the space type in the bitmask.
2020-09-21 20:23:37 -04:00
Tim Edwards ec3ac4863f Also corrected an error where the bounds search uses the device
type in the device record, which was not updated at the end of
checking terminals for matching device extraction types.  so the
boundary survey might see the wrong device type and generate an
incorrect boundary survey as a result.
2020-09-21 16:52:49 -04:00
Tim Edwards 380b287aa9 Modified the extraction code to properly handle length and width
of devices that have a terminal underneath the device.  Code not
yet tested.
2020-09-21 16:03:37 -04:00
Tim Edwards 32ec962535 Separated drain and source records for the esFetInfo array, to
support asymmetric FETs and other devices like bipolars that have
three distinct terminals.  This does not go as far as it should to
make the array independent of the number of declared terminals of
the device.  However, it suffices to make, e.g., parameter "a2=area"
work for a bipolar device, and to generate the right drain and source
areas and perimeters for asymmetric (e.g., extended-drain) devices.
2020-09-11 17:29:12 -04:00
Tim Edwards ebe12fecfe Corrected an extraction error that prevented the use of the same
device layer type to describe the extraction for both a regular FET
and an extended-drain device.  Note that the current code still
requires that the extended-drain device be declared first, and does
not check for this or attempt to reorder if incorrect.
2020-09-10 21:44:02 -04:00
Tim Edwards d0febe7614 Corrected an error in the global substrate name method added recently;
the extractor was not checking temp_subsname as well as glob_subsname,
and so was failing to apply the substrate name to child cells in
"merge" statements in the extract file, causing the substrate to get
disconnected between parent and child.
2020-06-13 16:31:37 -04:00
Tim Edwards 15f1c82bc9 Added two new features: (1) Default substrate name: Added an
optional name field to the "substrate" line in the extract section
of the techfile.  This is the default name of the substrate if not
connected to anything labeled.  It may use a Tcl variable (preferred).
(2) Added command option "instance orientation [-def]" that returns
the orientation of the named or selected instance.  The -def option
returns the orientation using DEF naming convention;  otherwise, the
naming used with "getcell" is generated.
2020-06-01 16:49:59 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 311c223114 Merge branch 'master' into bplane
Conflicts:
	VERSION

Merged changes from master into the bplane branch.
2020-03-18 10:43:45 -04:00
Tim Edwards f4174d3670 Fixed a recent addition to the extraction method that prevents
generating duplicate devices that may have parts overlaid in
different subcells;  this failed to filter the check by plane of
the device, and so if any two devices exist at the same point in
two different planes (e.g., metal resistor and a transistor), one
of them would get eliminated.
2020-03-17 21:26:46 -04:00
Tim Edwards cd87b08b21 Merge branch 'master' into bplane
Conflicts:
	VERSION
	database/DBcellsrch.c
	database/DBconnect.c
	extract/ExtInter.c
	lef/Depend
	utils/Depend

Updated bplane branch with all changes to master since the bplane branch
was last modified.
2020-03-12 08:29:33 -04:00
Tim Edwards 3aa09725cb Changed extraction to avoid generating an error message for devices
like resistors where a tile other than space may border the resistor
device on its non-terminal sides (which is handled correctly, and
should not be considered an error).
2019-11-19 11:39:59 -05:00
Tim Edwards 8e22b1504e Corrected an error introduced with the extension of extraction methods
to multiple entries per device;  the resistor length and width calculating
routine lost a break statement and would go into an infinite loop for
resistors with bends in them.
2019-11-13 14:29:19 -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 b0719384e4 Modified the new extraction method with multiple records for each
device type so that it is now properly backwards compatible with
the old-style "fet" records.  Also corrected the record matching
such that it properly matches according to the number of terminals
while allowing the traditional interpretation that there may be
fewer S/D type records than terminals if the S/D types are the
same for all terminals.
2019-10-14 11:09:58 -04:00
Tim Edwards 4b5566af3e Corrected an error that causes alias names for layers to become the
principle layer name, which should not happen (especially in the
case of space, where layers may be aliased to "space" to make them
ignored on input).  Also:  Implemented a "-<types>" option to the
"substrate" record in the techfile to declare types which shield
layers from the substrate.  This allows types like pwell to be used
in different contexts, e.g., as part of the substrate, or as a P-well
in deep N-well, without requiring a different type.  This works in
conjunction with the recently-implemented "+<types>" ID types for
devices.  All of this may seem unnecessary but helps to reduce the
number of layers needing to be defined, and the subsequent complexity
of the DRC rulesets.
2019-09-18 20:48:33 -04:00