Commit Graph

269 Commits

Author SHA1 Message Date
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
Tim Edwards e453f130ee Also corrected the "lef write" output to always put "END LIBRARY"
at the end of a macro output, even if it is not part of a library.
According to some commercial tools, this is what is expected, even
though the use of "END LIBRARY" is never explained in the LEF/DEF
spec.
2020-07-19 22:10:19 -04:00
Tim Edwards 9c4fb65a58 Corrected a problem with "lef read" that prevents it from working
with non-standard extensions such as ".tlef".
2020-07-19 21:56:00 -04:00
Tim Edwards 7a8e6352a3 Two changes to "lef write": (1) Added support for generating output
for geometry on MASTERSLICE layers (which was inadvertantly broken),
and (2) Added option "lef write -toplayer", which outputs pin geometry
only for the topmost layer belonging to a pin, with connected layers
underneath being designated as obstructions.
2020-07-15 17:29:56 -04:00
Tim Edwards bf4364da44 Corrected an error in the GDS output hierarchical adjustments code
caused by the new bloat-all with templayers, which used the distance
record in the bloat structure differently than the other bloat
functions, and therefore was messing up the enumeration of layers
needing to be handled by the hierarchical output.  This was probably
also wrong for the existing bloat-all function, which might explain
some problems recently with the GDS output.
2020-06-16 22:54:48 -04:00
Tim Edwards f1c432585a Applied a patch from Ahmed Ghazy to correct the last change to
"lef write", which had one typo in the formatting, plus was using
a static string method for generating the formatted output that was
implementation-dependent on fprintf().  These have been fixed.
2020-06-15 09:35:21 -04:00
Tim Edwards bdf684dafe An additional change to remove the formatting for the antenna area
output values, which were set to format according to database
distance precision (which is not the same as area).
2020-06-13 11:15:33 -04:00
Tim Edwards 95d1dfddc3 Changed the behavior of "lef write" (again) to set the UNITS to the
minimum manufacturing grid (normally 1000 but can be altered by the
"angstroms" flag in the cifoutput section, and by "gridlimit").
The output values then are truncated such that the floating-point
output value, when multiplied by the UNITS value, is always an
integer.  e.g., "gridlimit 5" will change UNITS to 200, and values
will be minimum precision 0.005, or 5 nanometers.
2020-06-13 11:05:53 -04:00
Tim Edwards f6c6e2c29c Reverted a change from a prior commit that removed backslashes in
front of brackets in LEF names.  These have a special meaning
that is not yet handled correctly, but removing them is the wrong
approach.
2020-06-05 14:55:45 -04:00
Tim Edwards 643bd096ea One more fix. . . 2020-05-29 16:51:20 -04:00
Tim Edwards 09e85dedab And the corresponding pointer. 2020-05-29 16:39:40 -04:00
Tim Edwards 112e58e371 And one more hash key type needed to be changed in the other call
to HashInit().
2020-05-29 16:36:07 -04:00
Tim Edwards 82106387a6 Corrected the type of hash key on the property definitions hash
table in lefWrite.
2020-05-29 16:26:37 -04:00
Tim Edwards 44ca5d996b Added handling of PROPERTYDEFINITIONS block in LEF output based on
properties in the cells.
2020-05-29 16:12:09 -04:00
Tim Edwards 4ad7ce3cf4 Modified LEF read and write to preserve macro PROPERTY lines. This
probably needs revisiting, because "lef write" and "lef writeall"
need handling to generate the PROPERTYDEFINITIONS block for the
PROPERTY entries to be correct.
2020-05-29 14:31:48 -04:00
Tim Edwards bad4842707 Corrected a improperly placed call to freeMagic() from the last
commit.
2020-05-29 13:10:03 -04:00
Tim Edwards 9372a9e0e8 Added more behavior to "lef read" annotation to include handling
bracket characters in the LEF file that are escaped with backslashes.
2020-05-29 12:51:21 -04:00
Tim Edwards a57f024587 Making the "lef read" usage for annotation of an existing layout
somewhat flexible with regard to pin name translations between
the LEF and the layout.
2020-05-29 12:37:10 -04:00
Tim Edwards bf061f0012 Additional change to readspice script to handle various issues with
pins not matching between netlist and layout due to delimiter changes
or case sensitivity.
2020-05-29 11:55:30 -04:00
Tim Edwards 36f2d0cca9 Corrected an out-of-order code block that can cause the USE statement
to be printed twice for a pin during "lef write".
2020-05-29 09:35:54 -04:00
Tim Edwards 483f15360a Added support for "PORT SHAPE" in LEF files. 2020-05-28 22:06:22 -04:00
Tim 'mithro' Ansell b47d4c5642 Removing extra `$Header$` 2020-05-27 20:35:27 -04:00
Tim Edwards e63e8f5761 Corrected the expected position of top and bottom layers in a
DEF VIA ENCLOSURE when doing "def read".  Thanks to Ahmed Ghazy
for finding the error and providing the patch.
2020-05-27 18:02:36 -04:00
Tim Edwards b6f4553cef One additional place where the port number needed to be taken from
the existing label on "lef read", where the port record is never
read.
2020-05-26 20:40:41 -04:00
Tim Edwards 8b159a07cd Corrected LEF annotation so that it does not try to change or any
port indexes, or create duplicated port indexes.
2020-05-26 17:58:05 -04:00
Tim Edwards 582539e95d Modified LEF and DEF writes to set VERSION to 5.7, as nothing in
the output is known to be incompatible with LEF/DEF version 5.7.
2020-05-26 17:25:44 -04:00
Tim Edwards da9c180670 Modified lefWrite with the odd trick of adding a zero to prevent
fprint from printing "negative zeros", which routinely happens in
the ORIGIN output of LEF files with "lef write".
2020-05-26 17:19:57 -04:00
Tim Edwards 84f63ad545 Corrected segfault condition when running "lef write" on a cell
with split tiles (error caused by previous commit).
2020-05-25 16:13:42 -04:00
Tim Edwards 994c6aaf57 Modified the LEF write routine so that it correctly handles contact
layers (apart from the fact that contacts are output as magic's
contact layer representation, and not as cuts;  this still needs to
be handled properly).
2020-05-25 12:26:01 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim 'mithro' Ansell c81d9add00 LEF writer: Fix indenting.
I missed the LAYER value and the geometry was one level to high.

Previous;
```
    PORT
         LAYER li1 ;
      RECT 1.145000 1.075000 1.690000 1.275000 ;
      RECT 3.720000 1.075000 4.490000 1.275000 ;
         LAYER met1 ;
      RECT 1.105000 1.260000 1.395000 1.305000 ;
      RECT 3.765000 1.260000 4.055000 1.305000 ;
```

After;
```
    PORT
      LAYER li1 ;
        RECT 1.145000 1.075000 1.690000 1.275000 ;
        RECT 3.720000 1.075000 4.490000 1.275000 ;
      LAYER met1 ;
        RECT 1.105000 1.260000 1.395000 1.305000 ;
        RECT 3.765000 1.260000 4.055000 1.305000 ;
```
2020-05-23 17:03:03 -04:00
Tim 'mithro' Ansell 2c066c8df0 Remove trailing whitespace. 2020-05-22 20:14:13 -04:00
Tim 'mithro' Ansell e2f0832cdf LEF writer: Move formatting properties to #defines 2020-05-22 20:14:13 -04:00
Tim 'mithro' Ansell c04a33cbf1 LEF writer: Use 6 decimal places of accuracy in output. 2020-05-22 20:14:13 -04:00
Tim Edwards 89c9335727 Modified area accumulation routines to avoid double-counting contacts
during "lef write".
2020-05-22 20:13:33 -04:00
Tim Edwards 77d17a4fa7 One correction to yesterday's commit for "lef write" enhancements:
If the last pin to be parsed generated no output, then the
obstructions would generate no output as well.
2020-05-22 16:14:27 -04:00
Tim Edwards 1e9334664c Modified the LEF write routine so that it will not output ports
that have no geometry (that do not exist on planes defined in
LEF).
2020-05-21 21:53:23 -04:00
Tim Edwards 6adb5dbacf Enhanced the "lef write" routine: (1) Calculates gate and diff
areas and writes ANTENNAGATEAREA and ANTENNADIFFAREA values.
(2) Determines "USE POWER" or "USE GROUND" from label names
matching Tcl variables $VDD and $GND, if the USE has not been
registered as a cell property (knowning the use allows magic
to avoid writing an ANTENNADIFFAREA for power rails, although
doing so should not be an issue).
2020-05-21 16:26:24 -04:00
Tim Edwards 6635817383 Modified LEF read to give all labels the sticky flag so that they
cannot be moved from the layer on which they are defined in the
LEF file.
2020-05-21 13:47:14 -04:00
Tim Edwards 838591bdf2 Corrected unfortunate typo from today's previous commit, and
corrected a wrong typecasting that results in a compile warning.
2020-05-10 20:01:05 -04:00
Tim Edwards f0d2c8db0f Corrected the LEF read routine so that it parses an ORIGIN line in
a LEF macro that has parentheses around the coordinates.  Weirdly,
this is requires by the LEF/DEF spec, but is rarely if ever seen
in actual LEF files.  Go figure.
2020-05-10 12:21:04 -04:00
Tim Edwards 7e1fcc8ef6 Fixed lefWrite, which was not including drc.h and so was messing up
one of the arguments to the DRC technology query.  Also, drc/drc.h
itself did not export that particular function, so it was added.
2020-04-07 20:08:42 -04:00
Tim Edwards 08fabeedd5 Merge branch 'master' into bplane
Merging fix to "lef write" to preserve SITE, from master branch.
2020-04-01 11:02:08 -04:00
Tim Edwards e98b768c45 Corrected "lef write" to add the SITE definition that it may have
been preserving in the cell properties (which was inadvertently
omitted).
2020-04-01 11:01:13 -04:00
Tim Edwards 706e342171 Merge branch 'master' into bplane
Conflicts:
	lef/lefWrite.c

Merged change to "lef write -hide" method from the master branch.
2020-04-01 10:46:06 -04:00
Tim Edwards d6cadeb0cd Decided that "lef write -hide" should always use widespacing rules,
because otherwise all pins will flag metal-to-obstruction spacing
within the cell if the cell is wide enough that the obstruction
layer satisfies the width requirement for the rule.  It is too
complicated to try to find specific places where the wide spacing
might not be needed.  Potentially this could be a problem for
technologies that define a number of graded wide-spacing rules,
as the largest-width rule is always used now by "lef write -hide",
and the largest-width rule could theoretically allow enough space
to route through, which would cause a short that cannot be
detected.  That would be a pathological case that may not show up
in practice.
2020-04-01 10:39:43 -04:00
Tim Edwards daf93e5bad Merge branch 'master' into bplane
Conflicts:
	VERSION

Merged from master correction that should prevent "lef write" from
creating pins with no geometry in them.
2020-04-01 09:01:33 -04:00
Tim Edwards e296fc5ba0 Corrected an error in lefWrite that should have avoided degenerate
labels by expanding a zero area label rectangle, but then if "select
chunk" returns nothing, it sets the area to the zero area label
rectangle instead of the expanded one that it just created.  This
is the reason that "lef write" is producing pins with no geometry
in the LEF file output.
2020-04-01 08:59:19 -04:00
Tim Edwards d742550edc Merge branch 'master' into bplane
Conflicts:
	VERSION

Merge from master (LEF read:  Read all tokens for LEF CLASS record)
2020-03-30 09:37:42 -04:00
Tim Edwards b5e06455c5 Corrected LEF read routine so as not to truncate LEF "CLASS" to a
single token (LEF CLASS records may have a subclass, such as "PAD
INPUT").
2020-03-30 09:36:24 -04:00
Tim Edwards 521efeb929 Corrected uninitialized variable problem in lefWrite. 2020-03-25 15:21:05 -04:00
Tim Edwards aab318176b Corrected lefWrite, which was not initializing the count of items
written, so that a LEF output with no ports would fail to write
the OBS ... END around the obstruction geometry.
2020-03-25 15:19:28 -04:00
Tim Edwards 79ada35815 Merge branch 'master' into bplane
Conflicts:
	VERSION
	extract/ExtMain.c
	lef/lefWrite.c

Pulled master branch changes to lefWrite into the bplane branch.
2020-03-25 11:23:16 -04:00
Tim Edwards 195e096d64 Modified lefWrite to ensure maximum spacing per all widespacing rules
for any gap between a pin touching the cell boundary and the internal
obstruction layer.
2020-03-25 11:07:54 -04:00
Tim Edwards 6bae7c25c4 Enhanced the "lef write -hide" command option to check for metal
wide spacing rules; should result in LEF views that can import
back into magic without DRC errors.
2020-03-25 09:29:16 -04:00
Tim Edwards 007806521c Updated the "lef write -hide" to understand and use widespacing rules
(may still need additional enhancements, as it does not specifically
look for layer-to-obstruction rules).
2020-03-25 09:25:32 -04:00
Tim Edwards ff0ba7f89d Merge branch 'master' into bplane
Conflicts:
	VERSION

Merged recent changes from master back into bplane, as the efficiency of
bplane for doing extraction on large layouts is unquestionably better.
Fixed the implementation of DBMoveCell() for bplane.  Corrected an error
in the bplane version of dbScaleCell() that enumerates cell uses but
does not free the list.
2020-03-22 14:07:25 -04:00
Tim Edwards 276bf1d78a Corrected a bad error from a few commits ago, probably 198, which
can deallocate the cell name and causes all sorts of unexpected and
unwanted behavior.
2020-03-21 12:40:35 -04:00
Tim Edwards fe8e229920 Corrected the DEF read routine's ROWCOL parsing. It was not treated
as an optional argument (which it is), and so defaults were not
applied, potentially leading to the wrong number of rows/columns in
a generated via if ROWCOL is not present in the DEF file.
2020-03-21 10:16:33 -04:00
Tim Edwards a1ee1720f1 Corrected the "lef write -hide" method to keep a list of the areas
of the pin port geometry and using those areas to create the
spacing between them and the obstruction layer.  Otherwise, the
existing method used different databases (source vs. flattened) to
find the pin area, and they did not always agree on the exact
dimensions, leading to spacing errors within the LEF view.
2020-03-20 21:29:29 -04:00
Tim Edwards be1c0d1368 Merge branch 'master' into bplane
Conflicts:
	VERSION
	calma/Depend
	cif/Depend
	cmwind/Depend
	commands/Depend
	database/Depend
	dbwind/Depend
	debug/Depend
	drc/Depend
	ext2sim/Depend
	ext2spice/Depend
	extflat/Depend
	extract/Depend
	garouter/Depend
	gcr/Depend
	graphics/Depend
	grouter/Depend
	irouter/Depend
	lef/Depend
	lisp/Depend
	mzrouter/Depend
	netmenu/Depend
	plot/Depend
	plow/Depend
	resis/Depend
	router/Depend
	select/Depend
	sim/Depend
	tcltk/Depend
	textio/Depend
	tiles/Depend
	utils/Depend
	windows/Depend
	wiring/Depend

Merged recent changes from master branch into bplane branch.  Testing the
bplane implementation which has about a 5x improvement in extraction times
for large layouts, which is significant enough to move ahead with the bplane
implementation;  however, the bplane implementation has not been thoroughly
vetted yet, so it will remain a branch until such time that it has been
validated.
2020-03-15 13:23:24 -04:00
Tim Edwards 4f8ac38b27 Substantially enhanced the "lef write" methods. This now preserves
multiple ports;  also, when using the "-hide" option, the obstruction
area is computed from layer geometry, not from the bounding box.
Still left to do:  Ensure minimum width on pins, and remove slivers
of obstruction that are below minimum width.
2020-03-14 13:00:03 -04:00
Tim Edwards 80fa495103 Removed the Depend files, which were being tracked with .gitignore
pointing to Depend instead of */Depend.
2020-03-13 15:39:08 -04:00
Tim Edwards cd87b08b21 Merge branch 'master' into bplane
Conflicts:
	VERSION
	database/DBcellsrch.c
	database/DBconnect.c
	extract/ExtInter.c
	lef/Depend
	utils/Depend

Updated bplane branch with all changes to master since the bplane branch
was last modified.
2020-03-12 08:29:33 -04:00
Tim Edwards 86cad629ec Modified the LEF read routine to use the via geometry manipulations
from the cifoutput section, NOT the cifinput section.  This change
underscores the point that LEF and DEF formats define mask data,
and therefore all LEF and DEF routines should be using the CIF
input/output methods and layers.  That is a major code change;
meanwhile, getting via layer values from the cifoutput parameters
is slightly more reliable than using cifinput, since there is good
reason to use templayers to read vias, and that sort of indirection
makes it difficult to determine a simple relationship between a
LEF cut layer and a magic contact.
2020-03-06 09:15:22 -05:00
Tim Edwards a37fc1e242 Implemented the "def read ... -labels" option, which labels each net
with the name given to the net in the DEF file.  Especially useful
for LVS.
2020-03-05 14:29:54 -05:00
Tim Edwards 7413d89da1 Corrected the "lef writeall" command to add the "-hide" option, as
is available for "lef write".  This was inadvertently omitted.
2020-03-05 13:14:47 -05:00
Tim Edwards b6cb1fb54a Modified the LEF VIAGEN reading such that it can accomodate a different
order of layers than specified in the LEF/DEF spec.  It is not clear
whether this is common practice, or a bug in the tool that produced the
DEF file that prompted this change.  NOTE:  The "grow" function applied
in this case should be replaced by the actual GDS input rule sequence,
that includes the grow and shrink merge.  Otherwise, vias read from
DEF files do not match the layout from those read from GDS, even though
the mask layers represented by the layouts are the same.
2020-03-03 17:13:37 -05:00
Tim Edwards cb7926ab0d Corrected lefTech.c not to issue a warning if defining a contact
type as an obstruction;  that should be perfectly acceptible.
2020-02-28 14:25:57 -05:00
Tim Edwards bc00b5578b Implemented a new configuration variable "dist_prefix" for
distributed installations, where the immediate installation location
is different from the final installation location, but in the case
where it is not desirable to put the entire install hierarchy as a
subdirectory of DESTDIR.
2020-01-28 10:40:01 -05:00
Tim Edwards 82e33248f2 Corrected dereferencing of cell dependencies, which was being applied
only at the time of running the command "load".  But cells are generally
loaded only on an as-needed basis, so the dereferencing option must be
saved as a flag in the cell and honored whenever its subcells are expanded
or otherwise read at a later time.
2020-01-02 10:13:04 -05:00
Tim Edwards f15ea2a135 Modified "lef writeall" to only generate output for the set of subcells
that are direct children of the top level cell.  The "-all" option was
added to enable the previous behavior, although its usefulness is
doubtful.
2019-12-19 10:33:22 -05:00
Tim Edwards d0f3aaeb59 Corrected ext2hier.c so that resistance output from extresist takes
the right argument type (float, not int).  Otherwise all resistances
from extresist come out zero when doing "ext2spice extresist on"
and "ext2spice hierarchy on".  Also changed the format of the resistance
in the SPICE output to type float, since values are in standard units of
ohms, and rounding to the nearest ohm seems excessively coarse-grained.
2019-12-16 09:55:11 -05:00
Tim Edwards a374230d88 Modified the behavior of the LEF read routine when used to annotate
an existing cell.  If the existing cell has labels but the labels
are defined as point labels (no rectangle defined using specific
layer-purpose pairs), then the LEF macro's port geometry will be
used for the labels.  Because the GDS file can define label sizes
and fonts, which the LEF file cannot, but because the LEF file may
define multiple rectangles per port, the original point label is
given the first port rectangle from the LEF file, while the
remainder of the labels in the LEF file generate new non-rendered
labels in the cell.
2019-11-26 10:57:42 -05:00
Tim Edwards 0eb3b1fe1c Corrected an error in ext2spice related to the recent modification to get
rid of redundant port entries in subcircuits.  There is still an outstanding
issue as to whether nodes and connections need to be recursively iterated
to the hierarchy bottom.  The current fix corrected the test case.  Also,
added a "-dereference" option to the "load" command to revert to the
original behavior of using only search paths from "addpath" when searching
for files to load.
2019-11-14 15:18:26 -05:00
Tim Edwards 5007f3f602 Modified "lef write" so that if a cell has a bounding box declared
by FIXED_BBOX derived from GDS and the new "boundary" cif input
rule, then the bbox property values take precedence over the
extent-of-geometry bounding box.
2019-11-13 15:10:01 -05:00
Tim Edwards e3624d3e5f Added code to avoid a problem with "lef write" when a sticky label
is placed over multiple types.  This causes SelectChunk() to fail
and the pin will have no geometry output in the LEF file.  To avoid
this, the area of the label is always painted into the select cell
so that if SelectChunk() fails, the label area still exists with
the label tile type.
2019-11-12 21:46:52 -05:00
Tim Edwards 0aca80dbc2 Corrected problem that can cause magic to crash on a "lef read"
command due to an uninitialized variable.
2019-11-01 13:23:31 -04:00
Tim Edwards 0e966af926 Modified the check for redundant label indexes in lefWrite so that
it only complains about (i.e., issues an error message) ports with
the same index but different text, indicating a read port number
collision and a true error.
2019-10-25 12:21:19 -04:00
Tim Edwards 2046318942 Corrected routine lefFileOpen() so that it will read files with
extensions other than specifically ".lef" or ".def" (such as
".tlef" for technology LEF, recently encountered).
2019-10-24 16:57:46 -04:00
Tim Edwards df77f7853c Corrected the handling of UNPLACED components in a DEF file, which
was previously (and erroneously) lumped with PLACED and FIXED which
take a position argument afterward.  Note that this fix allows the
DEF file to be read without error but does not have the (presumably
desired) behavior of parsing SITE information from the LEF file and
ROWS information from the DEF file and giving each unplaced component
an arbitrary but legal position.  That would require a significant
amount of additional coding work.
2019-07-29 09:51:48 -04:00
Tim Edwards 982bb8aa63 Changed a recent commit which removed brackets from instance names
while reading DEF.  To preserve names as much as possible, such
names are now kept.  To avoid problems, EFbuild.c and ext2hier
behavior has been changed to only parse entries in a .ext file as
instance arrays if the array notation follows the specific syntax
of [ax:bx:cx][ay:by:cy], letting all other uses of brackets pass
through unaffected.
2019-07-25 10:20:24 -04:00
Tim Edwards 197c3f3448 Merge branch 'master' into bplane
Conflicts:
	commands/CmdCD.c
	database/DBcellsrch.c
	database/DBconnect.c
	database/DBio.c
	lef/lefRead.c
	select/selDisplay.c

Updated the bplane implementation with all recent updates (merged master).
2019-07-24 20:36:55 -04:00
Tim Edwards c229139150 Changed two output lines in the LEF read subroutine to conform to
the standard message/warning/error method.
2019-07-23 08:06:41 -04:00
Tim Edwards 9ec5e8e747 Modified DEF reads to avoid instance names with brackets. Not
sure if this is the best policy.  The brackets should be okay
but interfere with ext2spice when it reads them from the .ext
file and decides that they refer to arrays.  May be a better
way to handle this.
2019-07-19 22:58:45 -04:00
Tim Edwards 8183f72b00 Added a missing include for utils/utils.h which has the function
prototype for StrDup().  Otherwise, use of StrDup() in the LEF
read routine can cause an inscrutible crash.
2019-07-17 10:20:52 -04:00
Tim Edwards c31b305848 Corrected the dependency list in the Makefile for "modules", which
should depend on database/database.h;  otherwise running distributed
make can start compiling modules before the database.h file is
created.
2019-07-14 12:07:38 -04:00
Tim Edwards d839cc26e2 One last problem fixed, as RECT entries in nets are relative, not
absolute.
2019-07-03 15:36:21 -04:00
Tim Edwards 0141ca8c95 Corrected error in generated vias (set top layer type on bottom,
so bottom layer went missing).
2019-07-03 14:52:22 -04:00
Tim Edwards 5ba84b068a Was missing needed expansion of via cut sizes to match magic's
internal definition of via areas, when reading parameterized vias
from a DEF file.
2019-07-03 14:24:52 -04:00
Tim Edwards 38fa141db5 One minor correction to the creation of generated vias in defRead.c. 2019-07-03 14:05:01 -04:00
Tim Edwards 49d98115bb Added a number of enhancements to the DEF reading to handle various
forms of syntax found in the LEF/DEF spec up to version 5.8.  Handles
vias formed by parameter and a number of syntax variations that mess
up the usual parsing.  Corrected an error in the calculation of wire
extensions when wires are given with three coordinates.
2019-07-03 13:58:13 -04:00
Tim Edwards 95ca3d93cc Added the handling of SHAPE statements in NET records in the DEF
file read routine.
2019-07-02 10:48:34 -04:00
Tim Edwards 51b70f6577 Corrected an error in the LEF/DEF geometry reading, because I
discovered that not all LEF/DEF rectangle coordinates are in
canonical order.  Took the opportunity to update the LefError()
routine with an additional argument so that it can separate
errors, warnings, and informational messages, and will correctly
state whether the output is for a LEF or DEF read operation.
2019-06-06 09:59:56 -04:00
Tim Edwards 87c07451d1 Corrected the LEF read routine so that when LEF is read to annotate
an existing GDS file, the "LEFview" property is not set (i.e., it
should not be marked as an abstract view because it is still a GDS
view).
2019-06-05 17:02:20 -04:00
Tim Edwards b098fbbfbb Modified the "def write" routine to strip any path component off of
a cell name (although cell names are not supposed to have path
components, so need to find out where they came from. . .).
2019-05-28 17:14:24 -04:00
Tim Edwards f7d57c913c Modified "def write" to prevent out-of-bounds array access when
writing vias.  However, the underlying problem, which is that
stacked vias are not decomposed into their constituent parts, has
not been addressed.  A "-units" option was added to the "def write"
command to force the units of the output file to be different than
the default of 1000 (nanometers).  No checks are made for whether
values can be accurately represented at the specified scale.
2019-05-11 15:09:01 -04:00
Tim Edwards 770a6f4a17 Updated the handling of fixed bounding boxes for abstract views
(once corrected in an experimental branch but never merged).  This
avoids changing the actual bounding box of the cell to match the
LEF bounding box, but defines a property instead and uses that
property for certain functions such as displaying the bounding box
outline or selecting the cell.  This avoids certain related errors
such as the failure to extract connections to areas outside of the
fixed bounding box.
2019-05-06 16:30:29 -04:00
Tim Edwards 7e738576bc Corrected errors in LEF output syntax (missing semicolons at
statement ends on properties imported from a LEF file).  Never
noticed before because writing LEF after reading LEF was unusual.
2019-04-01 12:23:48 -04:00
Tim Edwards f6d4da56ce Extended the "lef read" command when used to annotate existing cells
so that PIN information including USE and CLASS are added to port
labels (previously only the bounding box was annotated).
2019-04-01 11:26:00 -04:00
Tim Edwards 1d04f20f5d Moved new work on magic-8.4 (experimental merging of micromagic bplane structure
into magic-8.2) into the newly-reorganized git repo as branch "bplane".
2019-03-22 19:58:47 -04:00