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.
it is easy to subvert the process by updating GDS without updating
the pointers, it is trivial to end up with bad GDS output. The
sanity checks confirm that the position pointed to is a complete
structure (check begin and end records), and that it has the same
name as the cell (this is not a requirement, as there are reasons
one might want to point to data from a structure of a different
name, but a warning will be printed).
cell is referenced by a GDS "addendum" file but is not in either
the tree of the root def or any other dumped GDS file, then check
the database for those files and output them if they exist. This
allows one way to get around missing cells in the GDS output if a
cell from a GDS addendum is used but no cells from the library
that the file is an addendum of are used.
introduced: The use of substitutions for PDKPATH and home directory
in path names for GDS files referenced in abstract views, and the
"gds addendum" option. Both were interfering with magic's handling
of writing GDS files from abstract layout views.
from 98 (arbitrarily selected) to 61 (apparently commonly used by
other tools). This should help increase compatibility with GDS
files output from other tools.
the last commit, unfortunately. Thanks to Matt Guthaus for alerting me
to this. Also updated parts of the extresist code that remove the
dependence on ResConDCS; this is a minor update and should not affect
the operation of extresist. It is preparatory to doing more work to
support additional device types like capacitors, bipolars, and diodes.
in which if a cell is read from GDS that has the same name as a cell
in memory, then the cell in memory is renamed to keep all cell names
unique in the database.
This can be done now by reading a LEF file, followed by reading
a GDS file with the "noduplicates" option set. In addition,
annotation of either the LEF view or a read-only view follows the
same protocol as cell paths in the .mag file, which is to replace
leading path components matching Tcl variables for PDKPATH or
PDKROOT, and replace the home directory path with a tilde.
worded warning if an abstract cell view is written to GDS.
Corrected the "cellname ... writeable" command to allow an
overrride of the read-only status of a cell. That change had
been made before but apparently got reverted by the recent
rollback.
flattened per "gds flatten" or "gds flatglob", and the "gds readonly"
option is not set, then the instances of the flattened cells are
removed from the layout. They are retained for the "readonly" option
because when writing GDS of such a cell, the full hierarchy needs to
be walked.
from slashes in hierarchical names. Magic does not allow slashes
in names when using "identify", so the simplest solution is just
to prohibit them in names being read from GDS files, and replace
them with underscores to make them magic-compatible. Changing
GDS names always has repercussions on things like back-annotating
delays, so it should probably be revisited in the future.
it as a single value "flags" (unsigned char) with meaningful flag
names. Added new option "-fail" to the load command to allow
magic to fail on loading a cell that does not have a corresponding
file rather than the default action of creating a new cell. Added
a flag for the "-quiet" option so that behavior on "-fail" can be
done quietly.
cell def that is marked for a "full dump" from a referenced GDS
file. This change was supposed to have been done a few commits
ago but did not work as advertised.
magic database derived layout of a cell that declares GDS_FILE
but for which the GDS file referenced cannot be found or read.
This will produce an incomplete GDS file instead of an apparently
good and complete GDS file that actually contains bad data. Also:
Added new command "random" that allows a random seed to be set,
for use with the GDS output when writing a full dump of a GDS
file. Otherwise, the output prefixes are always the same, which
defeats the purpose of adding the random prefix.
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).
"gds write" command, since "Writing cell" is easily confused with
writing a .mag database file. "Generating output" seems clearer
to me. Maybe it's just me.
of input cells on a per-cellname basis, using glob-style pattern
matching. This is probably the best way to deal with 3rd-party vendor
GDS with unfortunate practices like dividing devices up among cells in
a hierarchy, even though it comes across as a bit of a hack solution.
true, this will force the "gds write" command to write out creation
date stamps as zero. This is very useful for avoiding changing the
contents of an otherwise-unchanged layout, especially if it is in
a git repository where it will force the entire file to be replaced.
routine attempts to rescale the contents of the top-level cell after
moving forward in the GDS to find a cell that was used before it was
defined, if reading that cell caused the scale to change. However,
the numerator and denominator were reversed, causing the scaling to
be the inverse of what it should have been.
to allow a "gds read" command to ignore cells in the GDS which already
exist in memory. This allows magic to be "pre-seeded" with specific
views of cells in the GDS. Default is false, which is backwards-
compatble behavior. (2) Changed the behavior of the the way the use
path is written to and read from a .mag file, checking the path prefix
against Tcl variables PDK_PATH, PDKPATH, PDK_ROOT, and PDKROOT, and
replacing any such leading path component with the variable name.
On reading a .mag file, any variable name at the start of the path
that matches a Tcl variable will be substituted.
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.
hierarchical processing from CIFGenSubcells() and CIFGenArrays(), and to
avoid certain operators that are useless and harmful when applied
hierarchically; namely squares, slots, bbox, boundary, and net.
templayers. This permits some useful interactions like growing to
the size of a bounding box, or abutment box, as well as many other
possibilities. Also: Corrected the use of "cif see" for the boundary
(abutment box) layer, which was not working because the "cif see"
command uses a flattened CellDef that does not have the boundary
property of the cell it was flattened from.
"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).
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.
GDS of abstract views, such that if the cellname being dumped is the
same as the library name, then no prefix is added to subcells. This
behavior may be changed in the future.
substrate more than once for the same subcell, since the substrate
extraction method scans the entire plane area; this was making
large standard cell layouts extract very slowly, as every component
cell was causing the substrate search to be repeated.
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.
limit of the Calma definition, and probably has not done so for ages.
Nobody informed me of this. The restriction has been lifted from
GDS input and output in Magic. It can be reinstated if necessary by
setting a flag in the cifoutput section of the techfile, but it is
likely that this will not be necessary unless there are other tools
that enforce the limit and will not read a GDS file that exceeds it.
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.
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.
the forward-referenced GDS cell problem) in which when writing cells
from 3rd-party GDS, the structure names are written to GDS with the
indicator flag in front, making the structure names and the referenced
names different, so that the GDS file is no longer valid. This has
been fixed.
files that have forward references (cells that are instanced before
they are defined), resulting in those cells being given an undefined
string for a prefix, which will result in corrupted GDS output.
Also added a method to prevent forward-referenced cells from triggering
a "redundantly defined" error message when the structure is output.
item that was never properly validated. Corrected the root of the
problem, which was an attempt to deallocate memory that had never
been allocated in the first place.
the compiler. Some are obscure functions (plot verstatec hasn't
been used in years) but others (like SPICE distributed junctions)
are potentially significant sources of unexpected crashes on
systems that don't zero uninitialized memory.
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.
lengths exceeding the maximum GDS name length (32 characters),
truncate by removing all but the last 32 characters, instead of
the previous behavior which was to remove all but the first 32
characters. The last 32 characters are far more likely to be
unique than the first 32, given that the usual reason for extra-
long names is the concatentation of hierarchical names.
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.
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. . .
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.
the output to have an obstruction area over the entire cell except
for a keep-out area around each pin. Instead of marking every
part of the pin geometry, only the "chunk" (largest immediate
rectangle) surrounding the port label is output as part of port
LEF geometry. This avoids making unnecessarily complicated
abstract views, and makes it easier for other tools to read and
manage the same abstract views.
to prefix all library components read from GDS files pointed to by
an abstract view (other than the cell itself) with a prefix. But
this does not account for the fact that the same library may be read
by other cells. The solution is for every cell in the library, check
if there is a cell in magic with the same name which is also an abstract
view that points to the same GDS library. Those cells do not get
prefixes. At the same time, however, it was discovered that the GDS
cellname character limit is set at 32, and so prefixes must be kept
short. To keep the prefixes unique, the prefix was changed to a 4
character random alphanumeric sequence, and a warning is issued if
any GDS cell exceeds the 32 character limit.
"port" and "noport" in the cifoutput section to distinguish
between layer:purpose pairs for port text vs. other kinds of
text. This allows a closer correspondence between GDS read and
write. Note that the port writing is currently only in the GDS
write routine, not in the CIF routine.
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.
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.
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.
an error message when reading uses from a .mag file. Also modified
the GDS write routine to provide an error message when an abstract
view points to a GDS file but the GDS file cannot be found.
both an abstract view (i.e., comes from a LEF file or otherwise
has been marked with the LEFview property) and a GDS_FILE
property expects to insert the contents of GDS_FILE into the GDS
output stream minus header and trailer, and with all internal
cells renamed by prefixing them with the top-level cell name to
avoid naming conflicts.
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.
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.