Commit Graph

666 Commits

Author SHA1 Message Date
R. Timothy Edwards e04307c085 Corrected an issue in computing the extended (includes area of
label text) vs. non-extended bounding box of a cell when doing
"getcell" (and probably a number of other commands/functions, as
well).  A function was always computing the extended bounding box
and then setting both the normal and extended bounding boxes of
the cell to this value, resulting in incorrect cell selections.
2025-08-26 11:00:20 -04:00
R. Timothy Edwards d2acdac901 Corrected an error accidentally introduced a few commits ago in
(commit 4084a6a246) in which a
misplaced close-brace altered the way that "getcell" handles
some orientation cases.  Thanks to Sylvain Munaut for discovering
the error.
2025-08-21 10:44:24 -04:00
R. Timothy Edwards 8d762b4f59 Corrected an error that accidentally misses an input line from a
LEF macro if the FOREIGN statement ends without the optional
coordinates.
2025-08-20 15:01:57 -04:00
R. Timothy Edwards 0301bdec9e Made a simple change to "extresist" to set the REDUNDANT flag on
nodes which are created due to having multiple ports with different
names on the same wire (electrically connected pins).  This prevents
"extresist" from double-counting the wire.
2025-08-19 10:00:05 -04:00
R. Timothy Edwards 4084a6a246 Modified the syntax of the "getcell" command to make the
arguments unambiguous, and to allow coordinates to be given in
any units.  To do this, the (seldom if ever used) passing of a
label as a reference point was changed to require the "label"
keyword before the label name, avoiding the code having to
disambiguate arguments from label text.  This now makes it
possible to specify the coordinates in microns, lambda, etc.,
units.
2025-08-15 10:24:31 -04:00
R. Timothy Edwards 117ca41b8a Corrected an error in the substrate generation for extraction, where
non-manhattan geometry was not being transformed into the parent
orientation.  This went unnoticed for some time due to testing on
PDKs where substrate and well were not allowed to have non-orthogonal
edges.
2025-08-14 08:51:36 -04:00
R. Timothy Edwards 0fb19e568c Extended the "spacing" and "edge"/"edge4way" rules to take an
option "manhattan_dist" that causes corner checks to assume a
manhattan distance measure.  This is useful for checking
distances involving generated edges that are created by a CIF
"grow" operator.  For "spacing", "manhattan_dist" is equivalent
to "touching_illegal", as a use-case for forcing manhattan
distance measurements in corners has not been found for other
"spacing" options.
2025-08-13 11:34:29 -04:00
R. Timothy Edwards 5791ae3701 Made a small change to the "cifmaxwidth" rule check implementation
to ignore non-Manhattan (split) tiles.  This avoids creating false-
positive DRC results on split tiles which are larger in X and Y
than the max-width distance.  False negatives are possible but
correctly implementing a "maxwidth" rule for non-orthogonal areas
requires a completely different algorithm.
2025-08-11 12:10:09 -04:00
R. Timothy Edwards b4912fd550 Updated the version to go along with the merge of pull request
version 8.3.521 that, due to an argument size mismatch, causes
device parameters in netlist output to be printed as zero.
Also added a small extension to the list of extraction types
to include "device veriloga", which has the same syntax as
"device subcircuit" but generates a component type "N"
(Verilog-A component) in the netlist output.
2025-08-07 11:54:49 -04:00
R. Timothy Edwards 3472474617 Re-implemented parts of the DRC angle check to make it consider
that all layer types passed to a single "angles" statement in the
tech file are mutually non-interacting.  That is, "angles allm1 45"
will check angles on edges between metal1 and space, but not edges
between metal1 and via (which makes sense, given that a via is an
area into which to place contact cuts, and its edge is not a
physical boundary).
2025-08-06 09:22:12 -04:00
R. Timothy Edwards 2630ebcde1 Reverted a change made to "select area" earlier in the year, which
changed the behavior from selecting subcells if they are unexpanded
to selecting subcells regardless of the expansion state.  The
change was short-sighted and the implementation hard to use.  There
is a need, I think, for a selection method that effectively
unexpands instances, selects everything, and re-expands afterward.
But it's not clear if it is better to select all touching instances
or instances inside the box area;  maybe only interacting
instances (instances with non-space content inside the box).
Regardless, it needs more thought, and meanwhile, the original
behavior works better.
2025-08-04 14:39:10 -04:00
R. Timothy Edwards 8ed7394431 Corrected some basic paint code related to drawing over top non-
Manhattan tiles.  After splitting a non-Manhattan tile crossing
a search area to paint, the routine was automatically merging
tiles to the right.  This is incorrect for tiles inside the search
area, as it can cause the search algorithm to miss unvisited tiles
whose origins are to the left of the split tile, resulting in part
of the area not getting painted.
2025-08-01 10:47:01 -04:00
R. Timothy Edwards f52d90346e Updated the version to go along with the merge of pull request #428
from Darryl Miles, which overhauled the Makefile and cleaned up a
lot of long-standing minor issues.
2025-07-29 10:56:54 -04:00
R. Timothy Edwards 1cc4d83425 Corrected an issue with "bloat-all ... [dist]" in which an attempt
not to re-process processed tiles made an incorrect assumption,
causing tiles not to be re-processed when the clip area changed,
such that areas would be missed.  It is not clear that in its
corrected version, "bloat-all ... [dist]" is any more efficient
than the original implementation of an incremental series of bloat
+ AND.  At least the syntax in the tech file is much simplified.
2025-07-28 11:53:44 -04:00
R. Timothy Edwards 9fe7bf4ab7 Fixed an issue with a non-boolean variable in DBtiles.c being
cast as "bool", causing issues with the proper/strict use of
the "bool" type.  Changed the version back so that it will
update the github mirror tonight, since the current version
appears to be working.
2025-07-27 21:02:40 -04:00
R. Timothy Edwards 43bc006338 Reducing VERSION back to the previous value so that a mirror copy of the
bad code won't be made to github in case the issue with stdbool isn't
resolved by tonight.
2025-07-27 16:52:57 -04:00
R. Timothy Edwards 669604ace3 Updated the version number to go along with merges of pull requests
from Darryl Miles and Torleif Skoar.
2025-07-27 12:54:25 -04:00
R. Timothy Edwards d4f487266f Updating the version number to go along with the merge of a bunch
of pull requests (about half of those pending) from Darryl Miles.
2025-07-26 20:54:46 -04:00
R. Timothy Edwards eb81da6c56 Updated the version to go along with pull request #406 from Darryl
Miles (updates for github actions).
2025-06-19 09:55:57 -04:00
R. Timothy Edwards 490fc6f9d7 Added a quick hack solution from Darryl Miles to prevent the
database corruption discovered recently that was uncovered by a
commit on Jan. 31 and is caused by DBMergeNMTiles0() using a
freed tile (reported in github issue #404).
2025-06-12 19:54:33 -04:00
R. Timothy Edwards 5ecc55b37d Added some alternative key bindings to the keypad for "stretch"
commands, because the keypad numerical values no longer work
regardless of the setting of Num Lock.  The keypad arrow keys
alone implement "move", while Shift + keypad arrow keys
implement "stretch".
2025-05-22 08:47:03 -04:00
R. Timothy Edwards f1f4b82a30 Corrected an error caused by extending the parsing of the FOREIGN
keyword in LEF.  FOREIGN may take an origin offset, but it is
optional.  The routine to check that there were no offset values
in the statement incorrectly checked for a NULL token instead of
a value ";" which would indicate an end-of-statement.
2025-05-16 19:36:16 -04:00
R. Timothy Edwards 02669de267 Updated the version number to go along with a bunch of pull request
merges for PRs by Darryl Miles.
2025-04-09 15:27:18 -04:00
R. Timothy Edwards 6e83cbe2d3 Added handling of coordinates in a FOREIGN statement in a LEF
macro.  Based on observation of cells in PDKs where ORIGIN and/or
FOREIGN are non-zero, added code that forces a correction of LEF
macro coordinates to match the GDS coordinates, with an
equivalent negative shift of the LEF macro ORIGIN to compensate.
Normally, both ORIGIN and FOREIGN will be zero and the added code
will do nothing.  Note that this code does not handle the
additional optional orientation.  A LEF macro with a different
coordinate system than its GDS is already weird;  a LEF macro
with a different rotation than its GDS is hopefully something
that nobody ever does in practice.  If needed, I'll cross that
bridge when I come to it.
2025-03-29 15:46:23 -04:00
R. Timothy Edwards 6b9efefc02 Added a new "orthogonal" operator to cifoutput to allow non-
manhattan shapes (especially minimum-sized ones) to be eliminated,
as these can survive a shrink-grow operation intended to get rid
of such shapes.  This implementation may not be in its final form
but should suffice for now.
2025-03-28 10:11:17 -04:00
R. Timothy Edwards dde7144966 Modified the behavior of SelectCopy() so that it surveys cell
instance names in both the selection and in the root edit CellDef,
and then wipes duplicate names from the selection and regenerates
unique IDs.  This avoids the unexpected behavior displayed by
magic in which a "copy" function renames the *original* instance
and gives the original name to the copied instance.  This is not
only unexpected, but causes an error in which "undo" after
multiple copies fails to remove earlier copies because the name
change was not recorded, and the instance can no longer be found
by name.
2025-03-26 14:45:46 -04:00
Tim Edwards 48708c52a4 Removed two unused statements from EFantenna.c, per the discussion
in github pull request #377.
2025-02-23 10:15:48 -05:00
Tim Edwards 144c22f579 Added the ability to translate pointer-based "wire" commands from
interactive wiring into coordinate-based commands.  Added new
command extensions for "wire leg", "wire vertical", "wire type",
and "wire horizontal".  Modified the command logging such that
"wire show" (which does not modify layout) does not get logged,
which avoids unnecessary logging of mouse movement.
2025-02-22 17:06:06 -05:00
Tim Edwards 41d77558b7 Fixed an error in which using the command option "gds allow undefined"
will cause a segmentation fault.
2025-02-15 13:43:01 -05:00
Tim Edwards df84a36659 Added code to handle the case where GDS_FILE points to a filename
that has since been compressed and given a ".gz" extension.
Removed code that uses a system call to "gunzip" and "gzip" when
the target file is compressed, since the compression is handled
in the code.
2025-02-12 16:28:43 -05:00
Tim Edwards cd80d38d52 Fixed a rather long-standing error, which is that when scaling of
"MASK_HINTS" was implemented, it was put into a routine that
scales all coordinate-related properties, including "FIXED_BBOX",
but the original code that scaled only "FIXED_BBOX" was never
removed, resulting in the bounding box getting incorrectly scaled
twice by any grid scaling.
2025-02-09 12:48:22 -05:00
Tim Edwards 619191c6dd Corrected a crash condition caused by yesterday's commit, if the
new CIF operator is used in a tech file.  Reworked yesterday's
commit to add more related operators, so there are now four new
ones (also renamed them):  interacting, noninteracting, overlapping,
and nonoverlapping.  "interacting" now means overlapping or touching;
so the four cases allow all variations of adjacency between the two
material types.
2025-02-05 14:49:32 -05:00
Tim Edwards 21b810b375 Added a new CIF operator "interact" which enumerates disjoint
regions of a given type and retains only those regions which
interact with (overlap) another given type.  Both sets of types
can be either magic database types or CIF temp layers.  This will
allow the implementation of rules that were not previously
possible.
2025-02-04 17:21:26 -05:00
Tim Edwards 72368a3d13 Added a fallback method for "extresist" whenever a device terminal
connection to a net that has been decomposed into a resistor array
cannot be found.  This indicates some fundamental error in the way
extresist works.  However, it should not be producing an invalid
and unsimulatable netlist.  Instead, it makes an arbitrary connection
from the device terminal to the resistor array and adds an entry in
the output netlist (.res.ext file).  This results in a poor
representation of the resistor network to that terminal, but an
otherwise simulatable netlist.  A warning is issued to note that an
arbitrary connection has been made.  This is most typically a
"garbage in, garbage out" situation in which insufficient information
exists in a layout to inform magic on which direction current is
traveling through a net.  However, it should be possible to rewrite
the extresist code so that magic makes somewhat informed decisions
about current paths and produces a halfway decent representation of
the actual net, instead of just giving up on the detailed extraction.
2025-01-15 10:38:10 -05:00
Tim Edwards 4445663cb1 Modified a routine to return a valid string when attempting to
generate a name for an instance that is set to NULL.  It is not
clear to me by an instance would have a NULL name, but apparently
it can happen, and should not crash magic.
2025-01-12 17:36:05 -05:00
Tim Edwards 82a1dc98b4 Updated the version to go along with the merge of pul request 2025-01-10 09:21:28 -05:00
Tim Edwards 2afa222414 Updated the version number to go along with the merge of several
pull requests from Darryl Miles.
2025-01-07 14:02:58 -05:00
Tim Edwards 3df2aaaa16 Modified the code in ext2spice.c that prints parameter values;
the former code attempted to determine the precision and generate
an output without unnecessary trailing zeros.  Unfortunately there
were counterexamples that fail to be formatted correctly, as found
by Mark Martin, and which generate output that has roundoff error.
Reimplemented the method using code found on StackOverflow, which
appears to solve the problem more robustly.
2025-01-06 11:49:29 -05:00
Tim Edwards e334fb919f Updating the revision number to go along with the merging of a
series of pull requests from Darryl Miles.
2025-01-04 11:45:11 -05:00
Tim Edwards 8371d797ad Revised some code from PR#352 in response to questions from Darryl
Miles.  Updated the version number to go along with the merge of
a number of pull requests done today.
2024-12-26 15:29:54 -05:00
Tim Edwards 48abe30ea4 Implemented a new CIF/GDS generation operator option for
"bloat-all" which is "bloat-all types1 types2 distance" where the
"distance" value is a maximum amount to grow.  It is not (that I
know of) particularly useful for generating output GDS, but it is
very useful for generating temporary layers for DRC checks,
especially things like determining tap distance for latch-up
rules.  The alternative (used in the sky130 tech file) is a
tedious step-by-step "grow" followed by "and-not".  This rule
option is much cleaner to implement and computes faster (although
it is still a boolean operator and is much slower than an edge
rule).
2024-12-25 20:46:25 -05:00
Tim Edwards 89b6f4f92b Corrected an error with the bloat-all CIF operator in which
bloat-all would fail to operate from the top layer of a contact
type due to the use of DBplane(type) instead of counting all
planes of the contact.
2024-12-16 21:52:11 -05:00
Tim Edwards 5ebbed4c12 Corrected the run-length wide-spacing rule so that it correctly
identifies areas which meet the proper definition of run-length
(both edges are parallel for the run-length distance or more).
Previously, errors were getting triggered for geometry where
only one edge exceeded the run-length distance.
2024-12-12 14:10:03 -05:00
Tim Edwards 37dfe07edf Extended the "cifmaxwidth" function to include the option "both",
which has the same meaning as the "maxwidth" function ("both"
checks either tile dimension to see if it exceeds the maximum).
This is a simple per-tile check and assumes that violations do
not occur across multiple tiles.  This should be sufficient for
most checks.
2024-12-08 12:14:38 -05:00
Tim Edwards 0a67151292 Extended the device parameters to allow a terminal width that is
different from the device (i.e., gate) width, for devices that do
not define a MOS-like gate spanning the width of the device.  This
is restricted to the assumption that the terminal is rectangular
and therefore a simple width and length can be derived from the
area and perimeter.  Also, length is defined as the smaller
dimension and width as the larger dimension.  For additional
restrictions, see the updated documentation.  This was added to
allow correct width and length extraction of a bipolar emitter
window, but may be more generally useful.
2024-12-06 16:42:43 -05:00
Tim Edwards 9184ccd395 Corrected an error in which DRC rules for width of material drawn
at a 45 degree angle will shadow the DRC rule for the material
drawn orthogonally (that is, the DRC rule for the distance between
orthogonal shapes will be eliminated from the rule deck).
2024-12-02 10:00:20 -05:00
Tim Edwards 8b34aa78a9 Corrected a long-standing crash condition that happens when a
generated cell is modified multiple times.  If the original cell
is orphaned (no longer used anywhere in the design), it is deleted.
However, an instance of the cell may exist in the secondary
select buffer if the cell was previously moved or copied, and
an attempt to do another move or copy will clear the secondary
select buffer, encounter the deleted cell, and crash the program.
2024-11-26 13:43:27 -05:00
Tim Edwards ea29aa3306 Modified behavior of the "property device" value. It was
previously ignoring the parameters of the entire cell including
the device being overridden by the property, causing the output
to be wrong.  The parameters should always be written out to the
.ext file, including the device whose output is being overridden.
2024-11-19 16:16:48 -05:00
Tim Edwards 1fdca3a57a Tracked down an obscure error that was causing a property
mismatch in the SkyWater sky130_fd_io__top_pwrdetv2 circuit
because a resistor with ends shorted together was being assigned
an incorrect length and width.  This was due to the similarity
in characteristics of the boundary vector between a shorted
resistor and an annular resistor.  The terminals need to be
checked for shorted ends to disambiguate the two cases.
2024-11-14 22:22:27 -05:00
Tim Edwards 22c22228b3 Coded around an issue where the antenna violation checker comes up
with zero gate error (and was reporting an infinite antenna ratio).
For now, just ignoring the zero-area case.  However, since the
procedure is supposed to be looping through nets connected to
specific devices in the .ext file, then every entry is supposed to
have non-zero area, so there is some underlying problem here that
needs to be fixed.
2024-11-07 11:59:07 -05:00