Commit Graph

36 Commits

Author SHA1 Message Date
Tim Edwards 0bbb558b94 Reworked the "port" and "noport" label type designations in the
tech file to correct the underlying problem with the SkyWater
sky130 process in which a different layer/purpose pair is used
for TEXTTYPE and DATATYPE for the same layer.  Previously, all
output from magic writes the same pair for both when writing a
port label.  The new method preserves existing syntax, although
there are some differences based on what order the "port"
statement appears relative to other types for the same layer.
2022-12-21 17:49:43 -05:00
Tim Edwards 583aaa1007 Added code to avoid making a call to get a default layer width on
an invalid type.  This prevents magic from generating unneeded
error messages about default layer widths on GDS read-in.
2022-12-19 11:52:38 -05:00
Tim Edwards 3b396d65f0 Reverted the toolkit change from the last commit after realizing
that the feature for implementing callbacks on a selection list
was already implemented via the add_dependency procedure.
Modified the GDS read to remove cell instances that are placed
directly on top of one another in the same cell.  Modified the
GDS read to make a better selection of a default font size for
text that specifies a font but not a size, using the minimum
width for the layer the text is placed on.  Modified the GDS
read to remove text with empty-string placeholders (created when
a pin layer is read but no text exists to go along with it, due
to GDS not having a specific way to make pins, such that pins
have to be split between one record for geometry and another
for text).
2022-12-15 12:25:23 -05:00
Tim Edwards 13a1bfcc2e Discovered that reading in polygons as subcells and then flattening
can be much, much faster than reading in polygons directly into a
cell from GDS.  Modified the handling of polygons so that they are
*always* read into subcells.  If the "polygon subcell flatten true"
option is not enabled, then the subcells are flattened at the end
of reading the cell, and the polygon cells are deleted.  This method
avoids most of the cases in which "polygon subcell flatten true"
has ever needed to be set.
2022-12-13 21:58:30 -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 65b54e0cd5 Corrected a stack corruption error (that I have never seen in
practice but which was detected by AddressSanitizer.  Also
corrected a crash condition in the absence of a window;  also
hard to reproduce.
2022-09-27 10:43:04 -04:00
Tim Edwards 82c79b36ee Added a check for unfortunate values of a MAG record in a GDS text
record.  Failure to use the right 8-byte real format can produce
bizarre results where a label's bounding box ends up in some random
place and messes up an entire top level circuit's bounding box.
2022-09-19 17:26:42 -04:00
Tim Edwards 371018ae4b Implemented native gzip compression/decompression using zlib routines.
Compression levels of the output can be controlled with the "gds
compress [<value>]" command, where <value> 0 (default) is uncompressed
output, 6 is "normal" gzip compression, and 9 is maximum compression.
2022-05-10 09:19:39 -04: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 b9f9f73c9b "Partly" corrected an issue in GDS read: The cd_client record is
used both for counting cells during GDS write and for saving
geometry data from the "copyup" operator during GDS read.  The write
routine does not clear the client record, and the read routine was
checking if the cd_client value was default.  Corrected the resulting
crash condition by resetting cd_client before GDS reads.  However, the
underlying problem is that the GDS read is reading data into a cell
that already exists in the database, and is not handling it robustly
by renaming the existing cell.  So this should be revisited.
2020-11-20 19:56:41 -05:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 38c6ce3b07 Changed the handling of GDS reads so that if the cifinput option
"ignore-unknown-layer-labels" is set, then error messages will not
be displayed when labels in the GDS input are on unknown layers
(this option is and has been otherwise handled correctly;  the only
issue is the generation of an error message on the output).
2020-05-14 15:41:46 -04:00
Tim Edwards 55ff3fd1ff Modified GDS read output to avoid generating error messages on
unrecognized layers when the "readonly" read option is set.
Added support to scale elements (from the "element" command,
such as the measurement text and arrows) when the grid scales,
which was missing.  Corrected the output of persistent elements
in a .mag file so that they are correctly scaled by the scale
reducer.
2020-05-12 12:03:38 -04:00
Tim Edwards 6737741902 Corrected CalmaRdpt() routine to avoid crashing if the cd_client
record is uninitialized when calling the rescale routine.
2020-05-08 16:44:29 -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 151f1fb470 Quick fix to last commit. 2020-03-25 12:07:14 -04:00
Tim Edwards c433534f4c Modified GDS read to assign the same port index to incoming port
labels with the same text.
2020-03-25 12:01:06 -04:00
Tim Edwards 0f45014d18 Corrected an erroneous scalefactor used when reading geometry
attached to a label in a GDS input file;  the scalefactor that was
being used is reset at the beginning of a GDS read, and so becomes
invalid after a database rescaling, resulting in improperly scaled
label geometry if "gds read" is used more than once.
2019-11-01 10:16:43 -04:00
Tim Edwards d08593997a Cleaned up an inconsistency with GDS read-in that generates
informational output that references a (non-existing) CIF file.
2019-07-23 08:45:42 -04:00
Tim Edwards cd32e39d58 Modified the GDS read routine to account for use of WIDTH in a text
record without a MAG in the PRESENTATION record to override it.
2019-07-16 16:26:56 -04:00
Tim Edwards 70927709c7 Added the capability to read a value from a WIDTH entry for text.
Still not sure how it is supposed to be used, exactly.  Used it
to set a default text size in case a MAG value is missing.
2019-07-16 11:45:10 -04:00
Tim Edwards feac3d94dd Added missing handling of text in GDS input with PRESENTATION
followed by WIDTH (previously it assumed that PRESENTATION and
WIDTH were mutually exclusive).
2019-07-16 10:32:36 -04:00
Tim Edwards bbf6008363 Enhancements to cifinput and cifoutput in the tech file: Added
option "labels ... cellid" to handle some vendor files where
apparently to get around the 30-character cell name limit, the
actual cellname is encoded on a text layer.  Added new cifop
"boundary" (no arguments) for cases where a cell abutment box
is encoded on a GDS layer;  this now translates the bounding
box to the FIXED_BBOX property, as is done with the LEF bounding
box.  Also corrected the property set function to free existing
property value allocated memory when overwriting a property with
a new value.
2019-06-05 15:03:51 -04:00
Tim Edwards 92bf587a46 Fixed an error in the previous commit handling pin labels in GDS
input, which failed to update the "lastLabel" record of the cell
in the case that the placeholder label being deleted was the last
label, leading to labels being lost during GDS input.
2019-03-20 10:07:25 -04:00
Tim Edwards 1533424590 Corrected scaling of label rectangles in GDS (that is, GDS layer
types that have been specified as being ports or text), since the
labels are in the magic database and at a different scale.  Added
code to cope with the fact that the labels may come after the
definition of the rectangle, so a rectangle identified as a port
or text label will generate an empty placeholder label, and all
new labels are checked against any empty labels in the database to
see if they are bounded by them.  If so, then the empty label is
removed and the label point is replaced by the rectangle.  This is
a ridiculously round-about way to deal with an under-specified
file format. . .
2019-03-19 22:25:25 -04:00
Tim Edwards 78666d57e0 Modified the behavior of label handling in GDS input so that a
label specified as having type "space" automatically overrides
the "no-reconnect-labels" flag.  Modified the behavior of the
label reconnect algorithm so that it searches by plane order so
that material on the highest plane that matches the reconnection
criteria is chosen over similar materials on lower planes.
2019-01-31 10:56:38 -05:00
Tim Edwards b964f9d33a Corrected a number of errors in the last two commits, as well as
additional functionality for ports in GDS format.  This has been
tested with a techfile encoding pin types on a different purpose
than the metal layer drawing purpose.  The label rectangle is
correctly written to the GDS output as geometry on the pin
purpose layer, and the same layer gets read back in from the GDS
file and translated back into the label rectangle.  Port order
is maintained.
2018-08-27 12:23:10 -04:00
Tim Edwards 5c6bc5db34 Extended the code of the previous commit to include attaching
labels to geometry defined using either the "port" or "text"
options of the "label" statement in a cifinput section.
2018-08-27 11:03:05 -04:00
Tim Edwards 925136c652 Attempt at finishing the support of standard practices to define
geometry attached to a label in GDS using specific layer:purpose
pairs.  The additional code maintains the order of ports when
writing out text to GDS, and attempts to attach geometry to labels
when the geometry is defined on the same layer:purpose pair as
the text, and the cifinput style declares the purpose to be a
port label.
2018-08-27 10:57:51 -04:00
Tim Edwards 404629e49f Added new option "port" for the "labels" statement in cifinput.
This allows text appearing on a specific GDS layer:purpose pair
to be interpreted as a port.  This does not quite match the
intended behavior of such layers, since it is implied that any
layer geometry coincident with the text should form the area of
the port, which is not (yet) handled.  Also, it is presumably
implied that the port order matches the order in which text
appears in the GDS stream, but magic does not preserve this
order when re-writing any GDS output.
2018-08-26 22:36:15 -04:00
Tim Edwards efb1f00879 Preliminary method to record polygons and wire paths with property
records when they are read in into their own subcells using the
cif/gds read options.
2017-10-09 11:51:51 -04:00
Tim Edwards 5ba46da6b9 Corrected custom wire extension handling in GDS file reads. 2017-10-06 22:56:34 -04:00
Tim Edwards 6e066ededa Modified the gds command options to separate "gds path subcell"
from "gds polygon subcell".  Previously both polygons and paths
were put into subcells named polygonXXXXX (substitute numbers
for XXXXX).  Now polygons go into cells named polygonXXXXX and
paths go into cells named pathXXXXX.  This makes it easier to
keep track of the original path.  NOTE:  The path centerline
should be kept as a cell property in this case, and the path
options like endcap style can also be held as properties.  The
polygon boundary should be treated similarly.
2017-10-06 22:32:52 -04:00
Tim Edwards e099dde8d2 Fixed calma custom paths (pathtype 4) so that it doesn't generate
an error message (otherwise it was already being handled correctly).
2017-10-06 16:42:41 -04:00
Tim Edwards 088fc759c4 Set of changes updating version 8.2 to the level of 8.1, since 8.2
development had been halted since it was first created back in April.
Version 8.2 is now the official development version, with the first
development push to create a Cairo graphics interface.
2017-08-01 22:14:42 -04:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00