Commit Graph

269 Commits

Author SHA1 Message Date
Tim Edwards f0c3ec33d6 Modified the "lef nocheck" command to take the argument "*", meaning
that no nets will be checked for antenna gate and diffusion area,
and no antenna properties will be output to the LEF file.  This can
greatly speed up LEF output file generation for a large design.
Thank you to Tamas Hubai for the code patch.
2024-05-11 20:48:35 -04:00
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 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 bfd938b5e2 Correction to the previous bug fix: The layer was correct and
did not need to be changed, but the line below it that depended
on the layer being a contact type was wrong;  the contact had
to be identified independently of the last layer type, which
might not be the contact cut type.
2024-03-20 22:15:41 -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 cb73ebfab0 Corrected an error in lefWrite where SelectClear() is called
without SelectRootDef being set, which causes SelectClear() to
return without doing anything.  However---question is why
SelectClear() needs SelectRootDef to be non-NULL since it is
clearing the selection, not the selection source.  For now, just
patching the failing case, not trying to mess with the whole
selection mechanism.
2024-03-08 12:28:29 -05: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 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 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 4557dd1639 Modified the "def write" function so that obstruction layers are
output as blockages.  That allows obstruction layers to be placed
in a layout specifically for the purpose of being output as a
blockage.  Otherwise, an obstruction layer is generally considered
non-electrical and will not show up as a node in the extraction
file, so obstruction layers were being missed entirely by "def
write".  Also:  Where "def write" complains about floating labels,
made an exception for labels on non-electrical layers (like
"comment").
2023-09-22 15:51:38 -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 cb00ede59d Corrected defRead.c so that "read def" will read multiple "+ ROUTED"
(and similar) independent routed segments in the SPECIALNETS section
(which was already working correctly for regular NETS).  This solves
github issue tracker issue #264 from Christian Haufe.
2023-08-25 12:15:58 -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 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 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 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 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 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 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 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 256a47d7b9 Added a method for a property named OBS_BBOX to specify a minimum
area to be marked as an obstruction when writing a LEF file with
the "-hide" option.
2022-11-30 16:29:37 -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 0f05bb1356 Corrected the LEF technology setup, where LEF layers (routes and
contacts) take default values from the DRC section.  Since both
are in lambda, but the DRC section uses a two-part integer and
modulus representation, if default values are taken before
scaling, the LEF layers may get rounded values.  This has been
solved by marking values with -1 to indicate that they require
defaults, and then set those defaults (from scaled DRC rules)
after scaling all other tech values.
2022-11-20 15:15:04 -05:00
Tim Edwards 18fc328289 Revised the last commit slightly to put the PIN entry as the first
entry of a set of net connections in a DEF file, instead of the
last entry.
2022-11-20 13:32:40 -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 6369c44821 One correction to the last commit, to avoid missing output of
port nets in "def write".
2022-11-18 22:28:20 -05:00
Tim Edwards 16da74a2f9 Implemented a method in EFBuildNode() to capture nodes which are
redundant (same name, different net).  Previously, the method was
to keep the first such node and ignore all others except to add
their resistance and capacitance to the original node.  This
prevented routines like "def write" from enumerating all nets
unless they had unique names.  The new method keeps the additional
records including the node location where they can be found by
EFNodeVisit(), but flags them with EF_UNIQUE_NODE so that routines
like ext2spice or ext2sim can choose to ignore them.  This implies
that this method could be used to reimplement "extract unique"
within "ext2spice" or "ext2sim" without altering label text.  This
has not yet been implemented.
2022-11-18 21:44:06 -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 70e15b1d33 Corrected the "def write" output with respect to the "-units"
option.  This is important as the default units of 1nm are not
necessarily able to be converted to integer values if the
minimum manufacturing grid is an odd number of nanometers.
2022-11-09 17:38:09 -05:00
Tim Edwards 31ba6eeba3 Corrected an error introduced with the last push which changes
wire direction on vias during DEF write without changing the
"orient" value, causing Y values to get copied into X positions
in the output.
2022-11-09 15:14:53 -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 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
Alessandro De Laurenzis b306a39560 Compatibility with C99 standard
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
2022-10-29 06:07:46 +02: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 f12a155ea7 Found a crash condition reported by Abhinav Uppal where labels
that are unattached (type = space) will cause magic to crash on
the command "lef write -hide"---The lowest level issue was in
SelectChunk(), so for good measure SelectChunk() now checks for
type == TT_SPACE, and "lef write" does also.
2022-09-23 15:44:49 -04:00
Tim Edwards a550d615c0 Made some modifications to the "def write" command: It now handles
non-default rules and so can accurately capture wire widths other
than the technology LEF defaults (also corrected a bug with non-
default rules for "def read").  Corrected via handling in "def
write" to function as claimed (although the algorithm is still
naive and expects all contacts to be rectangular, which is usually
true but doesn't have to be).
2022-09-23 15:02:22 -04:00
Tim Edwards 7905e15ae3 Enhanced the "def read -annotate" option to correctly annotate pins
with class, use, and shape information from the DEF file PINS record.
This is similar to what is done with LEF file annotation, but less
sophisticated (only erases an existing pin if it is an exact match
for pin name and location).
2022-09-14 13:02:55 -04:00
Tim Edwards f7df5e7c86 Added an option to "def read" to avoid creating obstructions from
"BLOCKAGES" statements.
2022-06-24 15:22:53 -04:00
Tim Edwards fcc884332b Made some corrections to the "extresist" code to avoid issues with
extracting a port-to-port net that does not touch any devices.
The error happens in a fairly rare set of cases.
2022-05-02 12:27:39 -04:00
Tim Edwards ff10aedf69 Added a prototype declaration for LefReadLayerSection (see github
issue tracker issue #154).
2022-04-05 09:50:36 -04:00
Tim Edwards a4c5945d60 Corrected parsing of NONDEFAULTRULES in a LEF file. Modified the
DEF reading to use vector fonts on PIN labels, with some ad hoc
rules for size and rotation (may need refinement).  Modified the
DEF annotation (def read -annotate) so that the preferred position
of labels is on a wire leading out from a pin connection, which
is a "safer" place to put it, in case the layout was manually
edited between the DEF read and annotation.  Fixed another two
crash conditions related to read-only views.  Corrected a startup
error caused by an uninitialized variable used by the "wiring"
section of the tech file.
2022-03-31 20:02:12 -04:00
Tim Edwards 37fec8a06a Tentative implementation of parsing NONDEFAULTRULE definitions in
a LEF file (complementary to the implementation recently added to
the DEF file parser).
2022-03-31 10:23:39 -04:00
Tim Edwards a74f11e3b2 One correction to prevent some unnecessary messages when doing a
label annotation from a DEF file.
2022-03-30 17:17:09 -04:00
Tim Edwards cfb81101ec Added command option "-annotate" for "def read" that allows nets
to be annotated from a DEF file.  This is particularly useful if
"def read" has been used without the "-labels" option, and the
labels are needed at some point.
2022-03-30 13:02:12 -04:00
Tim Edwards bfa4272481 Removed some diagnostic messages from "def write", and added code to
prevent "def write" from running on an unnamed cell.
2022-03-29 17:10:50 -04:00
Tim Edwards 0c584f9e77 Modified the configure scripts and makefile per Proppy's comments
in github issue #149.  This causes magic to no longer write log files
for "make" and "make install" but will properly exit with a non-zero
return code on any error during compile.

Also:  Corrected the command "tech drc surround <type1> <type2>" so
that it now returns the correct value when <type1> and <type2> are in
the same plane.  Added new command "tech drc directional <type1> <type2>"
which works the same way as "tech drc surround" except for directional
surround rules.  Used this to generate vias from "def write" with the
correct metal surround amounts included in the via definiton.  The
route analysis then ignores tile slivers that make up the surrounding
material around contacts.  Also implemented a method that handles
routes that are made of multiple thin tiles due to the maximum horizontal
stripes rule.  Now magic handles "def write" well except for not dealing
with non-minimum-width routes unless they're specifically called out as
"special" nets.
2022-03-29 16:52:01 -04:00
Tim Edwards 3b44dacab5 Corrected a minor issue in "def write" that will ignore a wire
completely if the width does not match the wire minimum width,
rather than attempt to cope with it gracefully.
2022-03-28 22:34:12 -04:00
Tim Edwards 2147d0a882 Corrected the offsets caused in "def write" when writing components
with "FIXED_BBOX" properties, which need to be positioned relative
to the abutment box, not the cell bounds.
2022-03-25 21:38:41 -04:00
Tim Edwards cf39fb102c Fixed some errors in DEF read/write and added behavior to "def write"
to treat unlabeled/unconnected layout as blockage statements in the
output.
2022-03-24 17:58:05 -04:00
Tim Edwards 645a872967 Implemented non-default rules for DEF reads. This is in preparation
for using such non-default rules for "def write" to capture any
layout geometry that is not a "special net" and does not have the
default wire width.
2022-03-23 17:08:39 -04:00
Tim Edwards 59b68606e0 Corrected the equations for fringe shielding, as the equation for
the shielding fraction was inverted---I do not know how the tests
could pass that way.
2022-03-23 10:49:02 -04:00
Anton Blanchard 3d41b3e98b Fix a few issues with missing or incorrect prototypes
There are a few places we either don't have a variable or
function prototype and need one, or we have one and they
don't match.
2022-02-23 21:04:19 -05:00
Tim Edwards 45bb62de2f Merge branch 'master' of opencircuitdesign.com:/home/tim/gitsrc/magic
Pull me.
2022-01-24 17:20:42 -05:00
Tim Edwards ee1d1ae5b0 Corrected an error in LEF write in which sticky labels that declare
the label to be attached to a non-contact type when the label is
actually over a contact are not handled correctly when checking if
multiple labels should belong to the same port record.
2022-01-24 17:19:13 -05:00
Tim Edwards 019b852d84 Corrected a typo from the previous commit (causes other flags to
be cleared when setting the fixed timestamp flag for LEF reads).
2022-01-22 14:35:33 -05:00
Tim Edwards 8e80644dd7 Could not get the LEF datestamp to work correctly as a pointer,
due to issues of declaring global variables;  rather than track
down the correct use, just reworked it so that the value is just
an integer and takes -1 as the default (fixed timestamping
disabled).
2022-01-22 13:30:11 -05:00
Tim Edwards 81ecdbf209 Added a "lef datestamp" command option which is the equivalent of
"gds datestamp" for LEF reads.  When set to non-default, all cell
definitions created from LEF macros will be given the specified
timestamp, which allows the stamps of abstract views to match the
stamps of full views, preventing issues of updated timestamps
whenever a layout is switched between views.
2022-01-22 13:02:47 -05:00
Anton Blanchard a5614e0d97 Fix typo in MakeLegalLEFSyntax
In MakeLegalLEFSyntax we step through the badLEFchars string
but instead of looking for the NULL terminator, we instead
look for a NULL pointer.
2022-01-07 20:37:00 +11:00
Tim Edwards 716848067e Made a few corrections that stem from the change to add a separate
record to the label structure to hold the port number.  One major
issue stemming from this was reported in github issue #203 by Anton
Blanchard.  This commit fixes that error.
2021-12-22 12:08:34 -05:00
Tim Edwards 5e3c26c95a Tracked down two more memory leaks coming from ext2spice, due to
client data generated by ext2spice and attached to a node's
nodeClient record;  there is an initNodeClient() routine but no
corresponding freeNodeClient() routine.  Eventually had to add a
callback function passed to EFDone() and EFFlatDone() to clean up
these entries.  After doing that, valgrind reports clean for all
memory allocated within ext2spice (there are other things that are
not freed but not related to a specific command, so do not need to
be treated as leaks).
2021-12-13 18:05:53 -05:00
Tim Edwards 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 552d6de0f7 Modification to prevent crashing on an attempt to do an area erase on
a read-only layout.
2021-12-07 14:25:50 -05:00
Tim Edwards 73bad08457 Updated the version to go along with the merge of pull request
the existing coding style.
2021-11-17 09:12:47 -05:00
Maximo 7083d1904c Quick fix of 'def write' issue with the nets extending beyond it's original shape in some cases. It would be good to analyze in more detail the use of the extlen variable 2021-11-17 09:10:00 -05:00
Maximo 730746664c Fixed 'def write' warning message about default net widths. It was informing the wrong dimension 2021-11-17 09:10:00 -05:00
Maximo 7c13915205 Corrected 'def write' location of components. It was using the boundaries on the parent without taking into account the internal cell origin point 2021-11-17 09:10:00 -05:00
Tim Edwards 898783467c Corrected the "lef write" routine to more correctly handle port
statements, with all "hard" connections being enumerated in the
same PORT entry, and "soft" connections (same label on unconnected
areas;  e.g., through substrate or resistor device) being
enumerated as separate PORT entries, per the LEF spec.  Also
corrected behavior with respect to the "lef write -toplayer"
option, which was treating each port label independently, and so
generating entries for lower layers of a port if there were ports
on those layers, in contravention to the "-toplayer" option.
Also:  Added the PINS section to the "def write" output;  this had
been left as a "to be completed" item but was never done in spite
of being easy to add.
2021-11-12 11:34:16 -05:00
Tim Edwards c82c96cb73 Added checks to prevent magic from crashing when running various
commands on selections in a cell that is not editable.  Moves
and Copies were already handled correctly;  this correction fixes
Delete and transforms (e.g., rotates and flips).
2021-10-28 15:57:17 -04:00
Tim Edwards 2f7813094b Implemented glob-style matching for label selection. Introduces
an optional extra argument to the "select" command that can be used
to select labels by glob-style matching;  e.g., "select area labels
VSS*" or "select less area labels *_1".  This will help in managing
labels after flattening a standard cell design;  e.g., by using
"select less area labels */VDD".
2021-10-09 13:44:04 -04:00
Tim Edwards 35a65a9ba1 Corrected the "def read" command so that when reading PIN blocks,
all geometry will be handled;  the previous behavior expected only
a single rectangle per pin and so would only acknowledge the last
entry in any list of rectangles for the pin.
2021-09-15 14:45:14 -04:00
Dan Moore 1aab7e5a3a parse USEMINSPACING LEF statement 2021-06-29 10:53:00 -07:00
Tim Edwards c22d584ac3 Corrected a problem with character array bound overflow when writing
values to a LEF file.
2021-05-25 11:05:33 -04:00
Tim Edwards 1e08e90b2f Additional modification to the previous commit to make the "-pinonly"
argument to "lef write" take an optional value which is a setback
distance, similar to "-hide", but specifically for limiting the
distance that pins can extend into the center of a macro.
2021-04-20 13:33:25 -04:00
Tim Edwards 5b00ee7b83 Added a "-pinonly" option to "lef write" to restrict the pin area
to what is defined by the label, and no additional surrounding
geometry.
2021-04-20 10:19:12 -04:00
Tim Edwards 2bb3580f3e Also modified DEF reads to avoid letting instance names contain
either slash or comma.
2021-02-24 14:51:46 -05:00
Tim Edwards 7dfe407787 Implemented a return value for the cell read-in checks with an option
to stop the search whenever a cell is not found.  Used this to implement
a new option for GDS writes, "gds undefined allow|disallow" (default
"disallow") controls whether or not GDS with undefined references will
be allowed to be written.  Similarly affects CIF and LEF writes, extraction,
and DRC (when running "drc check" from the top).
2021-01-14 15:21:39 -05:00
Anton Blanchard e30472d009 Skip over BLOCKAGES section when reading DEF files
I'm seeing warnings when parsing a DEF with BLOCKAGES in it:

DEF read, Line 572201 (Message): Unknown keyword "BLOCKAGES" in DEF file; ignoring.
DEF read, Line 572202 (Message): Unknown keyword "-" in DEF file; ignoring.
DEF read, Line 572205 (Error): END statement out of context.

Skip over the section.
2021-01-13 09:13:04 -05:00
Tim Edwards 5f64c2b3d7 Corrected the "lef" command so that "lef help" works again.
Corrected the "lef write -hide" command option so that obstructions
outside of the boundary are included in the obstruction list, in
addition to the block inside.  This had previously been done
correctly for use with the "setback" option but would fail only
for setback = 0.
2020-12-18 16:38:06 -05:00
Tim Edwards a78b459303 Modified the DEF read routine (following a diff script from Ahmed
Ghazy) to read pin uses from a DEF file, including the three types
that are not defined by the LEF format (go figure).  Expanded the
bitmask of label flags to include the additional use types.  Also
shifted the label flag bitmask up to make additional room for more
port number, as there is no point in having unused bits in the
bitmask.
2020-12-07 10:39:39 -05:00
Tim Edwards 414f4a8ccb Modified the DEF and LEF read/write routines to keep the
defMakeInverseLayerMap() from returning complete contact types when used
by the lefWrite command when writing LEF macros, which contain cut layers
but not entire contacts.
2020-12-03 21:37:32 -05:00
Tim Edwards 3a42a1aa58 Corrected the lefRead routine so that LEF annotation works properly
on cells with multiple ports per pin.  As written, the code was
erasing all labels before creating a new port label, which would
erase all previous port labels.  This should have been done only on
the first port.
2020-11-23 14:28:46 -05:00
Tim Edwards 61188031cb Corrected the LEF read routine so that it preserves the sticky flag
on labels while annotating other properties (this error was a simple
typo).
2020-11-07 17:00:17 -05:00
Tim Edwards 65b7ca8dac Corrected a few wayward commas in the "lef" command that prevented
correct operation of "lef write".
2020-10-16 21:14:10 -04:00
Tim Edwards e7074e5723 Added two small features: (1) Added the "-annotate" option to "lef
read".  While "lef read" normally annotates existing layout, this
option ensures that no additional cells are created from macros in
the input LEF file.  (2) Added a check on the "Input off lambda grid"
warning during CIF/GDS input such that it is not repeated once issued,
as it tends to be output many times when it occurs.
2020-10-14 17:20:45 -04:00
Tim Edwards dc99e382dd Corrected a simple error from the last commit. 2020-10-07 16:34:49 -04:00
Tim Edwards 4e5f7251b7 Modified the "lef write -toplayer" option so that masterslice layers
are considered an exception to the "-toplayer" restriction;  this is
because masterslice well/substrate layers will affect the electrical
connectivity between port and sustrate or well.
2020-10-07 16:26:56 -04:00
Tim Edwards 52d9639011 Added a "-nomaster" option to "lef write", and made writing masterslice
layers in the output a default option.  Use "-nomaster" to prevent the
output of masterslice layers.
2020-10-06 15:41:35 -04:00
Tim Edwards aac2c06dfd Corrected a problem with both the "port" command and the "lef read"
command when annotating an existing layout from a LEF database, if
there is a port in the layout that is shadowed by a label with the
same name that is not a port.
2020-09-25 22:39:50 -04:00
Tim Edwards c3e8ed545d Implemented an additional setback value for "lef write -hide <value>"
that produces a result that looks like "lef write -hide" in the middle
but "lef write" around the edge.  Can be useful for catching all the
detail around the edges but obscuring/simplifying the bulk of the cell
interior.
2020-09-14 15:54:38 -04:00
Tim Edwards 0a532f5721 Applied a patch from Ahmed Ghazy that corrects an error reading PINS
from a DEF file that have the PLACED or FIXED property declared before
LAYER.
2020-08-08 14:02:29 -04:00
Tim Edwards 78fbbfa032 Corrected some uninitialized variables in the "lef write" function. 2020-07-31 21:45:42 -04:00
Tim Edwards 19dd5638d6 Removed "UNITS \n DATABASE MICRONS" entry from all LEF file output
other than the technology LEF (when given the option to dump the
technology LEF information).
2020-07-25 12:00:18 -04:00
Tim Edwards 850df529b9 Removed "NAMESCASESENSITIVE" from "lef write", since this has been
deprecated since LEF version 5.6.
2020-07-22 12:18:47 -04:00
Tim Edwards ae1743e5ad Removed handling of LEF macro "SOURCE", which is only valid pre-
version 5.6, and Magic now officially writes version 5.7.
2020-07-21 08:40:25 -04:00