Commit Graph

693 Commits

Author SHA1 Message Date
Tim Edwards 0ae54b500a Added the ability to track the first CellDef to fail to read and
report it after "Failure to read in entire sub-tree".  This will
not report every failing cell (since it quits reading after the
first failure) but will avoid the existing issue of printing
nothing and leaving the user with no feedback as to which cell
was the problem.
2024-04-29 17:43:37 -04:00
Tim Edwards 41e65b5214 Committing a patch to prevent segfaulting during "extresist" when
non-Manhattan geometry is analyzed for resistance extraction.
This patch merely prevents the crash condition.  It does not
solve the root of the problem, which is that split tiles can
belong to two different nets, but the tile can hold extraction
information for at most one of those nets.
2024-04-16 20:51:52 -04:00
Tim Edwards 3a1f4dc816 Removed an "if" statement that was apparently designed to
reduce the amount of redundant painting done by the connectivity
search algorithm, but which was preventing composed types (such
as FET gates) from getting added to a net if one of the composing
types (such as poly) was drawn over the device in an ancestor
cell.  Removing the "if" statement does not appear to have any
significant performance impact, so this change is being adopted.
2024-04-11 15:18:25 -04:00
Tim Edwards 82d64aa4b1 Corrected an issue with passing a Tcl script as a command-line
argument.  For interactive magic in the Tcl/Tk wrapper, the
"-nowindow" option was appended to the command line.  But for
Tcl scripts on the command line, all arguments following the
script name are considered arguments of the script.  So the
"-nowindow" argument has to be inserted at the beginning of
the command line as the first argument after "magic".
2024-04-10 20:51:05 -04:00
Tim Edwards 38d890c407 Made a slight modification to the "lef write -hide" routine;
previously, MASTERSLICE layers would not be added to obstruction
layers made by "-hide".  However, an nwell, for example, that
stuck outside of a prBoundary *would* be recorded, which was
inconsistent.  Resolved this by allowing MASTERSLICE layers
in the OBS block, but only for layers that are not a substrate
type.  NOTE:  It may be better to just insist that a MASTERSLICE
layer define an obstruction type in the "lef" section of the
tech file, and treat it like routing obstructions.  Alternatively,
one may question whether special obstruction types are needed at
all, as one could simply define an obstruction as a type without
a port label.
2024-04-08 14:10:46 -04:00
Tim Edwards 8b3524575f Corrected the failure to copy mask hints to the flattened DRC yank
cell.  Otherwise, DRC errors corrected by mask hints will get
flagged.
2024-04-06 15:03:37 -04:00
Tim Edwards 4e5af57f3c Corrected an issue with "instance celldef" when the instance name
contains brackets which are not indicating a cell array.  Also
fixed a related issue with the PDK toolkit code, in which the
gencell routines fail if an instance name contains brackets which
are not indicating a cell array.
2024-04-05 17:47:44 -04:00
Tim Edwards 9800d98dee Corrects "ext2spice hierarchy off" when subcircuits with ports are
present.  Note, however, this fix breaks the use of "ext2spice
subcircuit descend off" because subcircuits are always descended
into.  It's not clear that "subcircuit descend off" worked at all
before, anyway.  That still needs fixing.
2024-04-02 21:55:57 -04:00
Tim Edwards d0f6dab896 Corrected issue from github issue tracker #297, where "Import SPICE"
fails on instances with names containing brackets.
2024-04-01 16:42:10 -04:00
Tim Edwards fede9d5c4d Fixed an error when reading a DEF file using generated vias in a
non-default rule.  The code was first failing to identify the via
cut type from the generated via record, and then it was failing
to return to the non-default rule width after the route exits the
via.  Both issues have been fixed.  Thanks to Sylvain Munaut for
providing a reproducible test case.
2024-03-20 17:19:45 -04:00
Tim Edwards 54773957c9 Corrected an issue with annotating a layout from a LEF file; if
new port labels are created for an existing port, then they must
take the existing port number.  The code was previously causing
collisions between port numbers on different pins.
2024-03-18 16:25:49 -04:00
Tim Edwards eeeaf49ec7 Corrected an error in defGetType() that incorrectly looks at a
lefLayer's "via" record even when the layer might not be a via,
causing potential issues with uninitialized variables.  Not sure
if this is related to the bug that started this investigation,
but it was the only thing that looked relevant.
2024-03-08 09:33:13 -05:00
Tim Edwards 191bff6c47 Modified the schematic-to-layout script to be better at being
used in a re-entrant manner.  Applied to an existing layout,
it will no longer keep generating new instances and ports over
top existing ones.  Could use improvement by attempting to
retain the location of a device when the instance changes
device type (such as when a device parameter was changed in
the netlist).  However, the current set of changes should
help, whether the re-entrant use is purposeful or accidental.
2024-02-27 15:41:17 -05:00
Tim Edwards 3691b53dde Was given a use case by Carsten Wulff (github issue #289) that
fails in the bplane code for subcell binning.  It is still not
clear why this example causes a failure when the bplane code
has been working for so long.  However, simply checking for the
BT_ARRAY bit at one additional point in the code prevents the
crash condition and appears not to have caused any issue with
the database.
2024-02-19 12:54:51 -05:00
Tim Edwards 814fb6f18d Corrected two separate issues with R-C extraction: (1) There was
a method that failed to work on devices with complex shapes on the
device recognition layer, such as snake-geometry resistors.  (2)
The use of contact type "xpc" in the sky130 tech file as its own
contact residue caused the contact tracing in extresist to fail.
I opted to keep the unorthodox contact description in the tech
file and wrote an extension to a routine in extresist to handle
the case.
2024-02-18 14:04:21 -05:00
Tim Edwards 038f02d2b2 Updated the version to go along with the merge of pull request #288
from Ryan Schmidt, changing regular expression strings in the python
preprocessor to raw string types so that they don't produce warnings
in python 3.12.
2024-01-23 15:34:05 -05:00
Tim Edwards 5f6ba3be69 Corrected an error when using the "instance" command with an instance
name.  The instance search routine was not rejecting internal cells,
and so would choose, e.g., a selection cell and reject it because it
was not the edit cell.
2024-01-21 11:00:19 -05:00
Tim Edwards 6b8239e258 Corrected a recently-discovered error in the "minimum area" DRC rule.
The fractional part of the rule distance (modulus after scaling)
does not fit in the unsigned char variable unless it is first
divided by the scalefactor (also requires multiplying up by the same
amount when scaling the other direction).  The truncation of the
unsigned char value was causing the minimum area value to be off by
a small amount, causing false negatives (no DRC violation is shown
when metal area is slightly smaller than the minimum allowed).
2024-01-14 15:19:39 -05:00
Tim Edwards a816da60f9 Updated the HTML command reference files to refer to magic version 8.3,
since all of the title images still had 8.2, and the title text still
said 7.3 or 7.4, having not been updated for a long time.
2024-01-09 16:37:00 -05:00
Tim Edwards 006c07082b Inadvertently introduced a segfault on exit on the last commit,
while trying to get rid of a compiler warning.  Fixed by this
update.
2024-01-01 15:36:05 -05:00
Tim Edwards 68e537b968 Added a tile unfracture routine at the end of CIFMakeManhattanPath
that resolves issues of excessive tile fracturing during read-in
of GDS (or CIF) polygons and paths that have non-manhattan geometry.
This was particularly noticeable when reading the GF180MCU corner
I/O cell, which ended up being something close to a worst-case
scenario.
2023-12-30 14:10:09 -05:00
Tim Edwards 0cd4a10036 Updated version to go along with the merge of pull request #283
from Vasil Yordanov, which changes the toolbar icon into a
scrollable list with layer names, much better than the former
minimalist array of icons.
2023-12-15 15:58:20 -05:00
Tim Edwards 943e0d4d8d Updated version to go along with the merge of pull request #282 from
Donn (corrects a pointer incorrectly passed to dbReadOpen() that
should have been a boolean).
2023-12-04 10:33:05 -05:00
Tim Edwards 83ed73ac52 One more change to the "extresist" code which prevents extresist
from substituting a regular label for a port during a node merge,
which can cause ports to become orphaned.
2023-11-27 16:18:43 -05:00
Tim Edwards 84af801608 Fixed two independent errors, both of which can cause devices to be
missing from a netlist generated by ext2spice with the "extresist"
option enabled.  The first had to do with some parts of nets being
given alias names for a net, and the second was caused during
"extresist" and would also result in error messages about devices
missing terminals.
2023-11-24 16:51:26 -05:00
Tim Edwards 21336607e0 Added checks for GDS scalefactor (DBU) both when reading GDS in
"gds readonly true" mode and when writing a GDS file in full-dump
mode.  Reading or writing a file with an incompatible DBU is now
prohibited.  This is not a great solution, as it forces the
original file to be rewritten with a different DBU.  Preferably
there should be code to scale the units during a dump, but that
needs to be coded.
2023-11-21 09:44:16 -05:00
Tim Edwards 5352a23577 Updated the SPICE import routine in the toolkit so that it will
correctly handle subcircuits that are used before they are
defined, and will determine whether the imported spice does or
does not contain a top level, and either return to the top level
or any top level cell found in the netlist.
2023-11-15 11:46:22 -05:00
Tim Edwards d09b0e8c51 Corrected an error that can prevent capacitances to substrate from
being output if the substrate node is declared as a port.
2023-11-14 20:10:57 -05:00
Tim Edwards 11080465ad Corrected the Tcl exit hook routine so that it passes on the
client data value as the exit status value (this was not at
all clear from the documentation and required a bit of
experimentation).  The fix allows Tcl scripts to exit magic
with a non-zero status by invoking "exit" in Tcl.
2023-11-11 13:09:59 -05:00
Tim Edwards 67d68717ca Corrected a typo in the ext2spice code as pointed out (with
corretion) user cgurleyuk on github.
2023-11-10 08:01:51 -05:00
Tim Edwards 8445f3eb5d Corrected ext2spice to avoid incorrect precision when writing out
values.  The "%.3g" format was changed to "%.*g" with a variable
precision that accounts for the actual precision required by the
manufacturing grid.
2023-11-05 11:00:30 -05:00
Tim Edwards 0894248e0a Updated version to go along with the merge of pull request #278
from user pinu-73 (updates to the MacOS install instructions
with additional information and explanation).
2023-11-02 10:11:10 -04:00
Tim Edwards df6333bb7b Modified the "makedbh.in" script ("makedbh", after running
configure) so that it does not use python-3.6-style f-strings,
and so is backwardly compatible with any python-3 revision.
2023-10-28 12:14:26 -04:00
Tim Edwards 22ea7a924f Corrected an extraction error that can cause an infinite loop
depending on the order of extraction devices.  Specifically, the
case of a source-drain tied FET was breaking out of a loop when
it should have been breaking out of a double loop.
2023-10-27 14:32:44 -04:00
Tim Edwards 610c86a234 When writing a GDS file, there is a statement printed about each
cell being generated.  This statement does not disambiguate the
case where a cell is being ripped verbatim from GDS instead of
being generated from the magic database.  This print statement
has been split into two cases, and where a cell is being ripped
verbatim, the name of the file is indicated.  This provides better
information to the user.
2023-10-24 10:36:57 -04:00
Tim Edwards fdcc178bcd After a discussion about "cifinput" rules, realized that there is
no way to implement boolean operators on labels, so any "label"
statement in the section can apply only to one magic layer.  This
is regularly violated in most (all?) techfiles (due mainly to lack
of explanation and guidance).  The addition of the "no-reconnect-
labels" option for cifinput made it worse, as it can cause a label
to be attached to the wrong layer and be stuck that way.  Even
without the option, an attachment to a non-connecting type is a
problem;  DIFF cannot simultaneously have a connection to both
ndiff and pdiff, so it will be one or the other, and the one not
connected can easily get labels moved to other nets.  To avoid
this:  (1) removed the "no-reconnect-labels" option, and (2) made
the automatic label reconnection smarter, as well as splitting it
into two different behaviors based on whether a label is being
created or manipulated from the command line (more or less the
original behavior) vs. being read from GDS or LEF.  The new rules
assume that labels attached to a GDS type will all map to the
same plane in magic.  To avoid excessive error messages from
existing tech files, a warning is issued only if "labels" changes
the plane of the target layer (a realistic solution rather than
the preferred one).  Also:  Fixed an error that causes a crash on
the "wizard" command "*watch" if the cell being observed is
read-only (see github issue #271).
2023-10-17 15:54:38 -04:00
Tim Edwards 5b29870fce Corrected an extraction issue in which an error message about
"unexpected asymmetric device" is printed prematurely, as it
is inside a loop checking over all device entries compatible
with a device type.  Also:  Flagged an issue with the "label"
keyword in the "cifinput" section of a tech file.  The "label"
keyword cannot be used in conjunction with boolean operators.
It can only connect labels on a specific GDS type to one magic
type.  Unfortunately, because this was not flagged before as
an error or warning, the incorrect usage has crept into a lot
of tech files.  This uncovers an underlying issue that labels
must be allowed to automatically reconnect types, which is
undermined by the "no-reconnect-labels" cifinput option.  That
issue will be addressed in an upcoming commit.
2023-10-16 17:29:05 -04:00
Tim Edwards 8798a3256c Corrected an error in which DRCStatus is set outside of an #ifdef
for MAGIC_WRAPPER, which is required.
2023-10-12 15:14:13 -04:00
Tim Edwards 9e7c104d29 Corrected a small error in the device generator toolkit that fails
to pick up properties from an existing cell and prints an error
message instead.  This will likely cause non-default properties
of an instance to be lost if the SPICE import is used in a
re-entrant manner (not exactly a common use-case).
2023-10-06 17:51:40 -04:00
Tim Edwards ce6f7840db Backed up the version by one minor revision because I accidentally
upped it twice in one day.
2023-09-29 17:47:03 -04:00
Tim Edwards dacbfc4e1f Found that "extresist" double-counts contacts because no attempt
was made to limit the ExtFindRegions() search to one plane per
contact.  Fixed this simply by doubling the resistance per via
so that the final result is correct.
2023-09-29 10:48:05 -04:00
Tim Edwards b156e79b2c Corrected a toolkit error where the callback to check parameter
bounds should be called whenever an entry is changed and either
the entry window loses focus or the <Enter> key is pressed.
This had ended up disabled when the scrollbar was added to the
dialog window, causing the window hierarchy to change, which
invalidated the regexp used to identify the entry and checkbox
widgets.
2023-09-29 09:38:48 -04:00
Tim Edwards 656b5dbabe Corrected an error in the calculation of the number of contact
cuts per contact area during parasitic resistance extraction.
Previously, the result was divided by the via pitch twice,
resulting in most contact areas being reported as a single
cut.
2023-09-28 12:38:08 -04:00
Tim Edwards 7aa846443a Corrected an issue with the implementation of nondefault rules
in DEF read and write.  The NONDEFAULT LAYER WIREEXT was assumed
to refer to the default wire extension at segments, when instead
it refers to the wire extension only at vias.  The wire
extension at segments is presumably defined by the nondefault
segment (and wire extension at vias remains unimplemented, which
is probably not a big issue because everyone puts the wire
extensions into the via definitions anyway).
2023-09-26 21:26:31 -04:00
Tim Edwards b244d45688 Fixed an error that causes magic to segfault when doing "def write"
on a layout that is caused by either having no .ext file, having
labels attached to space, or possibly both.
2023-09-25 14:18:21 -04:00
Tim Edwards f1e60fe8b1 Found an extreme issue in "extresist" in which the algorithm spent
all of its time running area searches on zero-area rectangles,
which was causing simple extractions to run hours.  Checking for
a zero area rectangle and conditionally skipping the area search
resulted in a massive speed-up in parasitic extraction.
2023-09-23 12:57:03 -04:00
Tim Edwards a54a20ee58 Corrected an issue with "drc catchup" that causes it not to work
because commands issued during initialization set the DRC status
in a way that causes DRCContinuous() to return immediately.
Also:  Implemented a slightly different method when automatically
finding the tech file from the input .mag file that loads a
technology .magicrc file if one exists.  If not, just the .tech
file is loaded.  This replaces the method of a previous commit
that loads the technology .tcl script.  The .magicrc file will
include the .tcl script but does other things as well.
2023-09-20 10:27:07 -04:00
Tim Edwards 93eeb1b703 Documented the "extract halo" command option (which was missed at
the time the option was implemented), and also implemented (and
documented!) a similar command option "extract stepsize" for
reporting or changing the extraction step size.
2023-09-13 10:03:20 -04:00
Tim Edwards 68a088943f Made an enhancement to the code that automatically tries to figure
out where to find the technology corresponding to a file given on
the command line: (1) Changed the default search location from
/usr/share/pdk to /usr/local/share/pdk, which is the actual default
for open_pdks (can still be overridden by environment variable
PDK_ROOT).  (2) Made the PDK name by itself preferable to the PDK
name plus any extension when searching (e.g., "sky130A" is preferred
over "sky130A_backup").  (3) Check the located directory for any
file <tech_name>.tcl and source it if it exists.  (4) Run any tag
callbacks on the "tech load" command, which rebuilds the tool icons.
2023-09-12 11:12:00 -04:00
Tim Edwards a8cc403e4b Modified "lef write -hide" behavior to fix problems that occur
when a label has no area and magic has to go searching for the
label area.  The resulting behavior is better but is not really
a substitute for adding ports on the proper layers in the proper
locations for routing connections.
2023-09-11 14:34:42 -04:00
Tim Edwards d624b76712 Updated the version to go along with Donn's pull request #266
(fixes some issues around python3 on the Mac, python3 conflicting
with that found by /usr/bin/env, and an issue around "make clean"
attempting to rebuild the Depend files).
2023-08-29 15:50:38 -04:00
Tim Edwards 8e25303db4 Corrected what looks like a very long-standing error in the DRC
engine.  Rule checks of triggering rules are not subject to
clipping to the clip area.  However, they *must* be clipped to
the (larger) overall DRC check area, because no layout is valid
outside of that area.  This clipping was missed, allowing
triggering rules to trigger on areas outside the valid layout,
resulting in mysterious false-positive DRC errors.  This has
been fixed.
2023-08-27 14:21:02 -04:00
Tim Edwards f4d7646c1e Changed Lookup() to LookupFull() in all the LEF and DEF read routines.
Lookup() is used for command-line parsing in magic and accepts any
unique string that matches a partial keyword.  LEF and DEF do not
allow partial keywords, so only LookupFull() is appropriate to use
for LEF and DEF file parsing.  This fixes issue #263 from Christian
Haufe.
2023-08-25 09:48:24 -04:00
Tim Edwards 71e6bc5dd5 Added an include for <wchar.h> which is needed for readline to avoid
an implicit declaration error.
2023-08-08 13:44:37 -04:00
Tim Edwards 13a7cc32e2 Corrected an issue with the last commit for fixing the "extresist"
command for use with "extract path";  the cellname was being cleared
after generating the filename with the extract path, but was being
used afterward, so it needed to be reverted back to the original
value, not just free'd.  Otherwise "extresist" will fail to produce
any results.
2023-08-07 15:37:04 -04:00
Tim Edwards 22fbb28656 Corrected one major error which will cause magic to fail to find the
".res.ext" file from "extresist" after using "extract do local" (and
probably with "extract path" as well).  Fixed this, and also made
sure that "extresist" writes the ".res.ext" file to the same location
as ".ext" always, so that handling is consistent throughout the
full R-C extraction process, across the use of "extract", "ext2sim",
"extresist", and "ext2spice".
2023-08-06 16:53:07 -04:00
Tim Edwards 952b20d2a2 Corrected an issue where code expected sticky labels to be at the
front of the list during extraction, except that after copying
they're not.  Removed the expectation, although that causes the
entire linked list of labels to be parsed and may cause excessive
run-times in pathological situations.  Keep an eye out for
unintended consequences.
2023-08-01 13:59:46 -04:00
Tim Edwards 96ea4aa2fb Made a minor change to the handling of device nodes in EFBuildDevNode()
to catch cases where a device terminal is connected to the global
substrate node even when the terminal is not specifically a substrate
terminal (e.g., diode cathode or bipolar collector) and  mark them with
the "substrate is port" flag.
2023-07-31 12:11:04 -04:00
Tim Edwards 2aab645308 Discovered an error in region and net selection that can cause
unrelated nets to be captured in the same selection, due to the
use of the label bounding box instead of the label rectangle.
The bounding box is used for display only and should not be used
for connectivity.
2023-07-29 20:36:46 -04:00
Tim Edwards 89f1c4ee67 Corrected a previous implementation that was supposed to not print
warning messages about ports being electrically connected when
those ports have names that match under rules of case-insensitivity,
and the .ext file is being read for the purpose of generating a
SPICE netlist, which is case-insensitive.  Also:  Corrected a crash
condition when using "extract path <name>" when directory <name>
does not exist.
2023-07-28 09:40:41 -04:00
Tim Edwards d4f8fe04c5 Corrected the variable string "RCS" in tkcon.tcl, which had
become truncated, causing the "About" menu item in the console
to generate an error message.  Since the tkcon.tcl used in my
other software packages like IRSIM was correct, I just pulled
the RCS string from there, and it seems to be okay now.  This
solves github issue #259.
2023-07-25 17:15:11 -04:00
Tim Edwards 0afe4d87d4 Corrected an error introduced by the code added recently for support
of command logging, which caused the "select cell <instance>" command
option to become invalid;  this command option is used by the
parameterized cell generator and makes it impossible to edit the
parameterized cells.
2023-07-21 15:35:58 -04:00
Tim Edwards 90a3cf2d72 Corrected an issue that undermined the "locking disable" command,
and would keep files open (even though they were not marked as
locked) and not close them, causing an open file descriptor overflow
when too many files are read for the same design.
2023-07-20 14:51:05 -04:00
Tim Edwards 36fa9aabd1 Implemented a new command option "gds magscale" to reinterpret the
meaning of the MAG record in GDS files.  Most available GDS
documentation is decidedly vague about what MAG means.  Most
layout tools seem to interpret a MAG of 1 as corresponding to a
text height of 1um.  However, there are a few tools that
interpret it as 1 centimicron, and there's no reason to assume
that any given interpretation is correct.  "gds magscale" allows
the scale to be redefined.
2023-07-19 20:33:01 -04:00
Tim Edwards 8b3bb1ae77 Updated the version to go along with pull request #256 from Proppy. 2023-07-11 16:52:03 -04:00
Tim Edwards 081058a41b Corrected an issue in which ports which have the same name under
the assumption of case insensitivity (e.g., VSS, Vss, and vss)
are kept separate even when writing SPICE netlists, which are
case insensitive.  The code fix both avoids flagging these ports
when running ext2spice, and more importantly, allows the use of
"ext2spice short" without these ports ending up separate in the
output netlist.
2023-07-08 12:14:57 -04:00
Tim Edwards b899a500d5 Added a new method to the extraction which allows parameter limits
to be declared for each device model, so that different models can
be specified for different parameter ranges.  For example, this
will simplify the definition of the high-sheet-rho poly resistors
and the bipolar transistors in sky130 by removing the need for ID
marker layers;  it also allows the correct device model to be
extracted when reading data from GDS that does not contain the
extra (and not foundry-approved) ID markers.
2023-07-06 12:35:47 -04:00
Tim Edwards cc4eef4eb1 Added a (obvious, in retrospect) additional automatic handling of
nets to be avoided for running antenna gate and diffusion area
checks when doing "lef write", which is to check if the pin of
the net is flagged with use "power" or use "ground".  This avoids
the need to use the (recently added) "lef nocheck" option (although
that still exists as an additional way to control which nets do and
do not get checked).
2023-07-05 12:37:56 -04:00
Tim Edwards c8a2d06e08 Finally got around to fixing the "logcommands" command, which has
been broken ever since moving to the Tcl/Tk wrapped version.  Added
some new features that allow background commands from the window
handling (like pointer tracking) to be omitted from the log file
via a suspend/resume function.  Added a header file and a few
commands at the top of the log file that align the log file contents
with the screen and box state at the start of logging.  This makes
a log file which can be "played back" by sourcing it from the magic
console prompt.  Per request from Harald Pretl.
2023-06-28 21:31:24 -04:00
Tim Edwards ca469510d5 Found that extNodeName() prefers the first name in a region's label
list for output, but that the code in ExtRegion.c does not sort a
region's label list to keep ports at the beginning of the list.  So
any net with multiple labels may end up with a non-port label as
the name of the node, which eventually becomes the name of the port.
A quick fix keeps these lists sorted.
2023-06-27 15:35:57 -04:00
Tim Edwards 60a378842f Corrected one array overrun error caused by using the command
"drc printrules".  Implemented a new "drc" command option called
"drc ignore", which can be used to suppress reporting of specific
rules, for both "drc why" and "drc find".  This can help with
finding an error buried among a large number of other errors.
2023-06-26 20:47:37 -04:00
Tim Edwards ca985edbd0 Corrected a typo in the previous commit that causes parameters to
be output twice for scaled devices (such as diodes in the sky130
process).  Above and beyond the typo, though, the implementation
of offsets is not very well thought out and needs to be revised.
For one, the +/- notation can be confused with signs in the
parameter expression;  that is also fixed in this commit.  But
there is currently no way to express both a scale and an offset
for a device parameter.
2023-06-23 08:39:59 -04:00
Tim Edwards 07267dc126 Extended the device parameter notation to include offsets using
'+' and '-' in the same way that '*' is currently used for specifying
a parameter scaling.  The combination of a scale and offset for the
same parameter has not (yet) been implemented.
2023-06-21 20:44:38 -04:00
Tim Edwards 482d7534a2 Reimplemented the "extract do local" option as "extract path <name>"
with "extract do local" now being equivalent to "extract path .".
This allows extraction files to be put in a subdirectory and not
clog up the current working directory.  Also:  Fixed some behavior
around the use of "ext2spice -p <path>" so that it (1) works, and
(2) is compatible with the new "extract path".  Since the ext2spice
and ext2sim commands are effectively independent of the primary
extraction, the "-p" option is needed to correspond to the use of
"extract path".  Hopefully this is seen as only a minor inconvenience.
2023-06-14 13:55:59 -04:00
Tim Edwards 31b3c0d8b4 Extended the "lef" command to include a new option "lef nocheck"
to create a list of net names to ignore for antenna gate and
diffusion area checks.  This allows the nets not to have to be
selected in their entirity but selected by chunk only.  This
reduces the time to write LEF on a large layout back to approximately
what it was before the change to include the hidden area from "-hide"
in the antenna area checks.  Plus, it greatly reduces the time to
generate LEF for large layouts when not using the "-hide" option.
2023-06-13 11:28:46 -04:00
Tim Edwards 5300f322de Added code to calculate area and perimeter of layers that are not
on the same plane as a device identifier layer.  This (finally!)
allows proper calculation of area and perimeter of diodes and
bipolars, for example.
2023-06-09 15:31:58 -04:00
Tim Edwards 6caab5da37 (1) Corrected an error with extraction in which terminal area and
perimeter are not initialized, and if a terminal perimeter/area
calculation is missed (which is happening on devices with terminals
in planes other than the plane of the identifying type), then the
perimeter/area of a previously handled device will get output.
(2) Corrected an error with "flatten -inplace" in which the command
fails to deal with instance arrays.
2023-06-07 08:06:18 -04:00
Tim Edwards 666c3c2c97 Corrected an issue in which the device merging routine can generate
NaN results for devices which are not FETs (specifically, devices
that are declared using "msubckt" but are not FETs, although there
may have been a related issue with non-FET devices not getting the
correct M count), due to the device having zero measured width or
length.  NOTE:  This may need more investigation.  If a subcircuit
device's method of merging cannot be understood, then such devices
should never extract with "merge aggressive", and should always
merge conservatively if and only if all parameters match.
2023-05-21 12:13:01 -04:00
Tim Edwards c514f5ce0b Apparently forgot to push the last set of changed. Fixes a null
return value in EFbuild.c and adds a couple of sanity checks.
2023-05-18 09:25:37 -04:00
Tim Edwards 44b269e037 Modified the handling of substrate ports so that an existing port
number for a substrate port does not get reassigned, which will
cause port ordering issues.
2023-05-08 09:51:13 -04:00
Tim Edwards 79dc621626 Added a warning message if attempting to extract an empty cell,
so that it is not so mysterious as to why no output was generated.
2023-04-28 09:24:04 -04:00
Tim Edwards c4124b033f Corrected a potential crash condition in extflat which can show up
when reading .ext files with "equiv" statements in them.  The
generation of "equiv" statements was expanded recently, making it
more likely for this issue to show up.  There may be devices in
a file that have a terminal node pointing to the node that gets
removed, and these must be updated to point to the node that
remains after merging.  This requires a full loop over all
devices and so could have a potentially large impact;  but in
general there are not many equiv statements (implying multiple
different labels attached to the same node) and so it is unlikely
that there would be a noticeable performance hit in practice.
2023-04-27 20:47:55 -04:00
Tim Edwards e66b2e1338 Rearranged the "lef write" routine so that the search for antenna
gate and diffusion area on each pin is done before erasing parts
of the cell that are to be hidden by obstruction layers.  That
preserves the antenna information even when "-hide" is used.  This
corrects the issue raised by Kareem Farid in the github issue
tracker #236.
2023-04-26 10:24:13 -04:00
Tim Edwards a33d7b78b5 Corrected an error in search for substrate under a device. If
"space" is considered part of the substrate, then the check for
planes to search should exclude "space" from the type mask
first.  Otherwise, all planes get searched, not just the substrate.
Also:  The same routine can falsely flag a device terminal as
substrate if a split tile is marked as the device's region.  This
was also fixed.
2023-04-24 17:30:40 -04:00
Tim Edwards bf7f1ab39e Updated version with the merge of pull request #235 from Brad Smith. 2023-04-22 14:14:20 -04:00
Tim Edwards c1f4555ba0 Corrected behavior of "load ... -dereference" to bring back a
previous behavior that had inadvertently been changed.  In recent
versions, "load <absolute_path> -dereference" would incorrectly
apply the dereferencing to <absolute_path> rather than just its
subcells.  Cleaned up the code around DBCellRead() in the process,
so everything is more straightforward (although probably more
could be done in that regard).
2023-04-18 11:01:58 -04:00
Tim Edwards cff2b97678 Changed the default extraction options to include "do aliases" by
default, since not setting it can have unfortunate consequences
for cells that don't declare ports and have multiple conflicting
labels on a node.
2023-04-16 12:18:16 -04:00
Tim Edwards adf9a7703f Added a statement for every file load that prints the file path
of the cell.  This will greatly help in diagnosing issues when
reading cells from multiple locations including cwd, relative
paths, PDK libraries, and the search path.  Also:  Reworked
the timestamp update message so that it prints all at once at
the end of processing, not printing output for every cell
processed as it is being processed.  That prevents output from
the file read routine from getting interleaved with the
timestamp processing output.
2023-04-15 10:44:50 -04:00
Tim Edwards 1d8fcca09b Implemented a change to differentiate between "sticky" labels and
labels that are not connected to their declared layers.  It's the
latter type that need additional processing in ExtSubtree.
Limiting this processing significantly cuts down on processing
time when there are many labels in a layout, as happens with the
"def read -labels" command option.
2023-04-06 12:26:18 -04:00
Tim Edwards fc62a63d41 Corrected errors in the extresist code and in extflat, both of which
can result in negative resistors due to integer overflow.  In all
cases, the target was floating-point and it was only necessary to
recast everything to float first.
2023-03-25 11:01:52 -04:00
Tim Edwards 30184cb506 Finally tracked down several bugs in the sidewall walking routines
that had been causing negative capacitances to substrate to be
generated for certain complex geometries.
2023-03-24 09:51:22 -04:00
Tim Edwards f0c94d59f3 Minor adjustment to output from esSIvalue() to avoid round-off error
causing the SI suffix not to be the expected one.  Adjusted the
bounds where each SI suffix is used to keep output in the range of
0.1 to 100, although the boundary is very subjective.  Made a
correction to the extresist code to scan through all device records
for a tile type.  However, (1) there are cases being missed, and (2)
this should not be necessary since all device types should be able
to be known exactly from the contents of the .sim file.  Needs more
work.
2023-03-23 15:38:31 -04:00
Tim Edwards 6dd5f4d7e3 Corrected problem caused by adding a scrollbar to the parameters
window in the toolkit, which was to the "tkwait" command, which
waits for a change in state.  What was intended was to wait for
a change in state to visible only;  once visible, the "tkwait"
command should not invoked or else the process will block.
2023-03-22 15:28:00 -04:00
Tim Edwards 58c6a32a6c Applied patch from Donn that converts strcpy() calls in ext2spice
to "safer" strncpy() calls to prevent string buffer overflow.
Also:  Reimplemented the loop in the GDS write routine that counts
ports and then outputs them in order.  It was possible to hang
magic for a long time by giving a port a very, very large index
number.  The new implementation uses qsort() to sort the ports
by index, which is obviously much more efficient for the worst
case (and efficient enough for all normal cases).
2023-03-21 22:04:30 -04:00
Tim Edwards d8f926865d Modified the behavior of cell reading, mainly with respect to
dereferencing, and making the behavior of "load" on the command
line (i.e., loading a cell from a file) the same as the
behavior of loading a cell as a result of expanding an unloaded
instance.  In both cases, if "load -dereference" is used, and
a cell does not exist in any search path but does exist in the
original location, without dereferencing, then the cell will be
loaded from the original location.  Also:  Corrected an error
that has existed since adding the capability to read compressed
files, which causes magic to crash when attempting to run the
"crash recover" command (because that routine was mixing
compressed and regular file stream calls).
2023-03-20 21:00:35 -04:00
Tim Edwards edb05fb3d1 More corrections to the method of calculating fringe capacitance
inside a halo area.  The previous implementation used a linear
accounting of error to determine the amount of shielding, but
since the shielding is nonlinear, this is a poor approximation
and regularly overestimates the shielding and leads to negative
capacitances.  The corrected method makes many more calls to
the atan() function and the performance impact for extraction
will need to be evaluated.
2023-03-17 13:51:33 -04:00
Tim Edwards e9d434597a Corrected issue with the commit of version 8.3.378, which can
cause a crash when extracting some devices like bipolars with
terminals on different plance.
2023-03-15 14:36:15 -04:00
Tim Edwards a2687d4385 Corrected an issue from the last commit, which is that the default
ground node name (which is static) gets put on the node list and
is improperly deallocated.  Corrected by simply allocating the
string for the default substrate node instead of using the static
string.
2023-03-14 12:53:22 -04:00
Tim Edwards c077e1acef Removed from the "lef" HTML document some mentions of property names
that aren't actually handled by the "lef write" command.  The three
mentions are "LEFsource", "LEFuse", and "LEFshape", all of which
refer to names of pin properties, not macro properties.  These
mentions were probably left over from early work.
2023-03-13 10:18:17 -04:00
Tim Edwards 913c830dee Corrected the extraction of length and width of devices that are
(truly) missing a terminal (such as a MOSCAP made with a gate
extending into but not crossing a diffusion region).  Added the
most requested GUI feature, which is a vertical scrollbar on the
parameterized device window (could be improved by maximizing
window height without exceeding display height).
2023-03-12 16:57:47 -04:00
Tim Edwards e10901e32b Updated the version to go along with the merge of pull request
222 from Sean Cross.  Corrected a few places where the blanket
conversion "Region"->"ExtRegion" picked up some comment lines
that were unrelated to the structure name.
2023-03-10 11:14:23 -05:00
Tim Edwards 5e5879c53d Made a simple but important change to "readspice.tcl" to unexpand
the cell being reworked for port numbering.  Otherwise *all*
labels are selected, which can take a very long time depending on
how many labels are in the layout.  Note:  Need a "select area
ports" function, and better yet, rework the whole label database
so that magic no longer has to run compute-intensive routines
like DBEraseLabelsByContent().
2023-03-08 11:14:22 -05:00
Tim Edwards a8c3117020 Implemented and revised the "CIFhier" property to override the
"cif *hier write disable" and "cif *array write disable" commands
for a specific cell def and its descendents.  The revision ensures
that all descendents apply the override.  The "cif write" command
uses a stack instead of recursion, which makes it difficult to
apply the same method.  Currently the method only works for the
"gds write" command, and implementing the feature for "cif write"
is deemed not worth the effort.
2023-03-07 11:16:49 -05:00
Tim Edwards 73398e7e0b Corrected a buffer overrun situation in ExtBasic.c when printing
the "connected other node to. . ." message when terminals of a
device are shorted.  A long enough node name, especially one
created by concatenating hierarchy when flattening a cell, can
easily overrun the short 256-byte string buffer.  Fixed by
changing strcat() to strncat().
2023-03-05 16:39:58 -05:00
Tim Edwards eb36edf35a Corrected the ext2spice device output for device length, which
somehow acquired a typo which made it write "w=".  Resolves
issue #223 from Mitch Bailey.
2023-02-28 09:34:25 -05:00
Tim Edwards 3da6172706 Modified the "port renumber" command to use (case-insensitive)
natural sort instead of ASCII-based sorting, so that ports that
are numbered arrays will be indexed properly by count.  Also:
Modified the "extresist" handling of substrate to draw the default
substrate type over the entire cell area (less areas of nwell or
other conflicting type).  This allows extresist to extract the
entire substrate as a resistive network.  The result is ugly and
may warrant some aggressive network simplification, but it should
at least be realistic.
2023-02-27 22:22:09 -05:00
Tim Edwards e72f85fd10 Corrected the ext2sim output and extresist to properly handle
2-terminal devices without complaining.  The previous handling
seemed to be technically correct other than spitting out warnings
about missing terminals.
2023-02-24 12:58:46 -05:00
Tim Edwards 7b485efa9b Added code to handle string overflows in property strings. It
might be better to flag a warning, as property strings longer than
the original buffer size of 2048 are probably a bad idea.
2023-02-23 16:44:58 -05:00
Tim Edwards be577d4318 Corrected the reading of the "defaultsidewall" statement in the
tech file "extract" section to work correctly when the offset is
negative.  Generally, a negative offset is nonphysical and is just
curve-fitting round-off error, but the existing code was failing
to divide out the factor of 1000 that had been multiplied through
when reading the tech file, resulting in a very wrong offset.
2023-02-22 15:30:50 -05:00
Tim Edwards d4790d2f31 Corrected the "measure" (Tcl scripted) command to fix an error
when internal units no longer match lambda units.  The text
would match the dimension of the cursor box, but the measurement
lines would be drawn assuming a lambda scale, not the internal
scale.
2023-02-20 16:06:18 -05:00
Tim Edwards c7f11d2169 Important update: Reworked the extraction method to properly
isolate the terminal areas of a device (e.g., source and drain)
and calculate their area and perimeter individually for the
device (in addition to the traditional method of calculating
area and perimeter of each resistance class for the entire node).

Also:  Reworked the SPICE syntax output to generate SI values
in the range 1-1000 with the appropriate suffix (e.g., "20u")
instead of defaulting to "u" for lengths and "p" for areas.
This prevents it from producing weird units like "150000u" when
a process definition already includes a scalefactor.

Reworked the "extresist" code to use the device terminal area
and perimeter.  This fixes an error in which "extresist" would
lose these values and "ext2spice" with option "extresist on"
would generate a new netlist output with zero terminal areas
and perimeters.
2023-02-16 11:59:13 -05:00
Tim Edwards 5fcd4441c1 Corrected the "extresist" command behavior to ensure that
transistor records match between the ".ext" file and the ".res.ext"
file for the number of terminals per device.  Previously, the first
device type for the layer type was always being used, and if it had
fewer terminals (e.g., a MOScap), then one terminal would go missing
in the output.
2023-02-13 10:57:43 -05:00
Tim Edwards adda4092d6 Updated version to go along with the merge of pull request #217 from
Anton Blanchard.
2023-02-02 09:18:22 -05:00
Tim Edwards 1a3caee376 (1) Added a check for unclosed boundaries when reading GDS.
This is diagnostic only and does not change the read-in
    behavior.
(2) ext2spice:  Corrected an error that had been introduced
    into version 8.3.171 that accidentally marks all devices
    as visited which causes all source/drain areas and
    perimeters to be output as zero.
(3) extract:  Sweeping changes to handling of fringe
    capacitance.  Removed the (recently added) "fringeshieldhalo"
    parameter from the tech file.  Reworked the fringe
    capacitance models based on results from the "capiche"
    project (github/RTimothyEdwards/capiche).  Fringe shielding
    is now done by clipping fringe at the boundary of a
    shielding shape, rather than trying to calculate the
    amount of shielding (as the "capiche" project proved this
    to be equivalent).  Values for partial fringing are modeled
    by atan(x), which like the sidewall (1/x) curve, extends to
    infinity and values are limited by the halo but do not
    otherwise depend on the halo.  Because of this, the halo can
    be made variable and controlled by the user for deciding on
    the tradeoff between accuracy and run time.  A new command
    option "extract halo" was added to allow this control over
    the halo distance.
2023-01-27 11:47:37 -05:00
Tim Edwards be59d787a1 Modified the "gds subcell polygon" command option to split into
three types:  "none", "temporary", and "keep" (instead of "true"
or "false").  "none" now reverts back to the original behavior,
because it was found that saving polygons in subcells prevents
them from participating in boolean operations.  The "keep"
option is the original option (polygons kept in subcells), and
"temporary" is the one recently introduced (which puts polygons
in subcells and then flattens them).  This restores the original
method while retaining the recently implemented method.  However,
a proper solution needs to be found that deals with the problem
of boolean operators.
2023-01-17 20:14:38 -05:00
Tim Edwards 05ad386500 Updated the version to go along with the merge of pull request
213 from Anton Blanchard (1. Don't cast pointer to struct and back
again in DBDiagonalProc(), 2.  Fix compiler warning in
drcMaskSpacing(), 3. Fix a few issues in leaDBSearchForTech(),
4. Remove spurious ";" from PlotPS()).
2023-01-16 22:11:15 -05:00
Tim Edwards f06f3b47db Added an experimental option for the cifoutput tech file section to
force magic to scale down the internal grid to the minimum
manufacturing grid size specified in the cifoutput section, upon
reading the techfile.
2023-01-13 17:21:37 -05:00
Tim Edwards ff608b51f1 Updated version to go along with pull requests #208 from
Alessandro de Laurenzis, and pull requests #209 and #210
from Anton Blanchard.
2023-01-08 13:11:06 -05:00
Tim Edwards 6d99e5326e Added a command option "setlabel box" to modify the attachment box
of a label from the command line.  Also fixed a long-standing
irritation that "setlabel" would change the properties of a label
in the edit cell but not in the selection itself, which would
cause the label to be drawn both with the original properties
in the selection and the new properties in the edit cell.  Now
both views will track the same changes.
2023-01-04 14:08:39 -05:00
Tim Edwards 83e17706fe Added handling of mask-hints properties to the flatten-in-place
method to ensure that mask hint geometry is retained when a
cell instance is flattened into the parent cell.
2022-12-22 11:27:37 -05:00
Tim Edwards 0bbb558b94 Reworked the "port" and "noport" label type designations in the
tech file to correct the underlying problem with the SkyWater
sky130 process in which a different layer/purpose pair is used
for TEXTTYPE and DATATYPE for the same layer.  Previously, all
output from magic writes the same pair for both when writing a
port label.  The new method preserves existing syntax, although
there are some differences based on what order the "port"
statement appears relative to other types for the same layer.
2022-12-21 17:49:43 -05:00
Tim Edwards 23b8d08f86 Modified the "load" command so that "-quiet" is promoted to
"-silent", and "-quiet" now produces relatively little output
except for important warnings and errors.
2022-12-19 11:20:50 -05:00
Tim Edwards a0f502501e Corrected the method of "flatten in place" from the previous
commit to prevent port labels from being copied up from the
flattened cell into the parent, and prefixing the instance
name to text in the instance top level so that there will be
no port or label collisions in the parent cell after flattening
the child cell in place.  Also:  Changed "extract dolabelcheck"
to be the default setting.
2022-12-16 12:03:38 -05:00
Tim Edwards 3b396d65f0 Reverted the toolkit change from the last commit after realizing
that the feature for implementing callbacks on a selection list
was already implemented via the add_dependency procedure.
Modified the GDS read to remove cell instances that are placed
directly on top of one another in the same cell.  Modified the
GDS read to make a better selection of a default font size for
text that specifies a font but not a size, using the minimum
width for the layer the text is placed on.  Modified the GDS
read to remove text with empty-string placeholders (created when
a pin layer is read but no text exists to go along with it, due
to GDS not having a specific way to make pins, such that pins
have to be split between one record for geometry and another
for text).
2022-12-15 12:25:23 -05:00
Tim Edwards e5813f51fa Added a new option "-doinplace" for the "flatten" command. This
should have been done a long time ago!  Allows an instance to be
flattened in place inside a cell def, which otherwise requires
a complicated set of commands to do.  Also:  Modified the polygon
handling routine from the previous commit so that it correctly
removes the polygon cell defs after flattening them into the
parent cell.
2022-12-14 12:44:30 -05:00
Tim Edwards 53682af668 Added a new special device model name "Short" which enables the
use of a resistor type as a FET extended drain, allowing the
FET drain node to short across to the other side of the resistor
so that the resistor is absorbed into the FET device.  Used with
the GF180MCU process to describe the salicide-block ESD FET types.
2022-12-13 16:02:49 -05:00
Tim Edwards 86b4ac3e4c Modified the "lef read -annotate" method so that pins are checked
for compatible layout over the area of the pin rectangle in the
entire hierarchy of the cell, not just in the top level.  This
corrects issues where pins are placed in the top level cell with
no metal underneath.  It is written in such a way that it will
work regardless of whether paint is split across the hierarchy,
or the label spans different types (such as crossing a contact).
2022-12-12 14:49:42 -05:00
Tim Edwards 11ddd559b2 Fixed an error with LEF read where duplicate macros are encountered
in the input.  The name of one was being modified but was being
right-justified into the string, resulting in a name starting with
many space characters.  Also:  Fixed an issue with extresist where
a label that ends up with an empty string can become a node with
an empty string name in the .res.ext file output.
2022-12-09 17:31:47 -05:00
Tim Edwards 02bbb1064e Corrected an error in "extresist" that can output an incorrect
number of terminals for devices that don't have the usual gate/
source/drain terminals (e.g., diodes, resistors, capacitors) when
writing the devices with re-mapped terminals into the .res.ext
file.  Also:  Changed the size of the word containing the name
refcount for "equiv" statements, since an accidental shorting
of pins can cause a large number of "equiv" statements in a .ext
file, causing an overrun of the previously 1-byte refcount (this
probably does not make the structure any longer, since it likely
has to fit to a word boundary).
2022-12-06 21:55:01 -05:00
Tim Edwards e5e1e04146 Made a variant of the "directional surround" rule to be able to
implement a GF DRC rule.  This variant allows for a difference
between the minimum allowed surround on one side and the amount
that must be extended on the adjacent side.
2022-11-30 15:33:21 -05:00
Tim Edwards f222004d65 Fixed an error in "lef read" that fails to apply an annotated
pin on a compatible area due to an incorrect type mask.  (Also
note that this routine only works (after correction) for RECT
statements, but there should be a similar check for POLYGON
statements.)
2022-11-29 17:02:36 -05:00
Tim Edwards 01f2ce37b8 Modified the "dereference" behavior so that it does not produce
warnings when rereferencing a layout file as intended.
2022-11-22 11:05:55 -05:00
Tim Edwards 71dffb2fd2 Implemented a method to handle empty subcells that exist because a
library has been read in with the "gds readonly true" option set
because the cell contains information on where in the GDS the
cell is located, but the cell is empty because it was flattened
into the magic view and all of its contents were erased.  This can
cause issues with LVS if magic generates an empty cell into the
netlist and the LVS tool tries to compare the cells by name.  Also,
this prevents unnecessary .ext files and unnecessary merges to the
substrate of such cells (since all cells have an implied substrate).
2022-11-21 17:13:33 -05:00
Tim Edwards 44af9aaf9f Added pin connection to the list of NET connections in a DEF file
when doing "def write", which was missing.
2022-11-20 13:30:19 -05:00
Tim Edwards 65ef9a1ad3 Final (I hope!) corrections to the "def write" command. 2022-11-19 22:02:44 -05:00
Tim Edwards fe89170f5a Small correction to defWrite to cancel a non-default rule when a
wire with default width is encountered.
2022-11-18 21:00:23 -05:00
Tim Edwards f066844761 Substantially revised the "def write" and "def read" routines.
Both were corrected with respect to the definition of non-default
(taper) rules.  "def write" was additionally modified to avoid
redundantly processing tiles where tile areas were merged together
to form a complete wire.  There is plenty of room for optimization,
but the output appears to be matching the layout.  Also:  Revised
the definition of "(not) visible layers" to include labels attached
to those layers, so that turning off visibility of any layer will
also hide all labels attached to that layer.
2022-11-17 20:24:39 -05:00
Tim Edwards 2519d0a4d8 Corrected an issue with readline that breaks the non-Tcl/Tk flow
due to a missing function prototype.  Modified the GDS output
flow to always output instance IDs as a property, not just in the
non-default case.  The property has been used for many years and
appears to be accepted by all tools reading GDS, so there is no
downside to always generating this output.  This has the upside
that default instance names don't get scrambled by going from
magic to GDS and back to magic.
2022-11-11 11:20:34 -05:00
Tim Edwards e37a4f418a Based on output from a large contact array for a pad, modified the
default behavior of magic to make use of the "gds contacts true"
option to output contacts as arrays of subcells instead of
individual boundary entries, as the former is much more efficient
than the latter.  Set the option to be true by default, and set
the "gds flatglob" option to have one entry "$$*$$" corresponding
to the contact subcells created by the "gds contacts" option, so
that GDS reads and writes as it did previously (but using a
different method).  Expanded the method to include "squares-grid"
and "slots" operators (the latter should produce much more
efficient fill pattern arrays).  Implemented for both compressed
and uncompressed GDS.  Tested in all variations.
2022-11-10 14:08:58 -05:00
Tim Edwards f4c5ec3a78 Fixed the DEF write routine, which had an error in identifying
"slivers";  the error tended to produce artifacts (extra metal)
around contacts.  Fixed an issue that caused the DEF write routine
to open the same file twice instead of a new file for the second
part of the DEF data, and then potentially hit a runaway condition
when trying to merge the two files together.
2022-11-09 11:15:06 -05:00
Tim Edwards 2059d6fbb1 Corrected an error in "def write" that starts output on the wrong
layer when the first part of the route is a contact (starts on the
via top instead of the via bottom).
2022-11-08 09:59:43 -05:00
Tim Edwards a9aafebfc4 Corrected the antenna checking routines, which were incorrect with
respect to calculations around diode-connected diffusion regions.
The diffusion area calculation needed to be fixed to avoid double-
counting contacts, and the value for the ratioDiffA coefficient
needed to be scaled, since it is multiplied by the diffusion area
and therefore has dimensioned units of (1/area^2) and should be
treated like all other dimensioned units in magic.
2022-11-06 11:50:05 -05:00
Tim Edwards 3534b79994 Fixed an instance where dbFgets() was used in the "def write"
routine;  that is incorrect, and it should have been fgets().
When dbFgets() is recast to a zlib version, then its use in
"def write" causes magic to crash.
2022-11-03 16:15:36 -04:00
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 d229aefb15 A handful of changes after applying pull request #191 from
Alessandro De Laurenzis.  That pull request cleaned up the vast
majority of compiler warnings.  However, that cleanup exposed a
few additional warnings pointing to errors in the code that needed
fixing.  The code now compiles cleanly except for one warning
about redefined CAD_DIR that I have not looked into.
2022-10-29 09:57:41 -04:00
Tim Edwards 9d40fbfecb Corrected an error in parsing the "defaultperimeter" statement in
tech files which incorrectly parses the syntax using five
parameters.  This syntax variant does not get used often, which
is why the error went undetected for a long time.
2022-10-22 22:12:15 -04:00
Tim Edwards 94daf986ab Corrected the GDS write for "boundary" to make sure that the
calculation of the area to check for output and the clip box
does not reduce the size of any layer associated with the
fixed bounding box declared by the FIXED_BBOX property.
2022-10-18 14:14:22 -04:00
Tim Edwards eecdc3c642 Added a "flatten -doproperty" command option that allows selective
flattening based on cells which have a property "flatten".  Also:
Modified the DEF read and write to convert DIEAREA into a
FIXED_BBOX property.  This solves issues with placing of components
from DEF, when those components may not have have come from place &
route and may not have P&R bounding boxes.  Also:  Fixed the
documentation for the "dump" command, which was missing the optional
orientation in the description.
2022-10-15 11:33:59 -04:00
Tim Edwards bc5093502c Corrected a small error in "extract unique" that will attempt to
run free() on a memory location that was never allocated.  This
error has no effect on anything, but correcting it prevents magic
from issuing a mysterious warning.
2022-10-07 08:43:49 -04:00
Tim Edwards 189d62da9b Corrected a really stupid error which prevented the "extract
unique notopports" from working.  Fixes issue #186 reported by
Mitch Bailey.
2022-09-28 17:45:28 -04:00