Commit Graph

81 Commits

Author SHA1 Message Date
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
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 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 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
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 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 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 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 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 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
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 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 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 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 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 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 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 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