Commit Graph

34 Commits

Author SHA1 Message Date
Darryl L. Miles 2f7f76bf9c K&R: cif/*.c bulk function implementation conversion
Beware of the MISMATCH with the prototype found in original
source, with the type declaration below.

External call sites checked to confirm argument order is
correct with the argument name order.

// nedges <> dir
bool
cifOrient(edges, nedges, dir)
    CIFPath *edges[],          /* Array of edges to be categorized. */
    int dir[],                 /* Array to hold directions. */
    int nedges)                        /* Size of arrays. */

// spacing <> border
int
CIFGetContactSize(type, edge, spacing, border)
    TileType type,
    int *edge,
    int *border,
    int *spacing)

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 13:05:14 -05:00
Darryl L. Miles bf45f9ea31 K&R: cif/*.c bulk forward reference function prototype conversion
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 13:05:14 -05:00
Tim Edwards 48abe30ea4 Implemented a new CIF/GDS generation operator option for
"bloat-all" which is "bloat-all types1 types2 distance" where the
"distance" value is a maximum amount to grow.  It is not (that I
know of) particularly useful for generating output GDS, but it is
very useful for generating temporary layers for DRC checks,
especially things like determining tap distance for latch-up
rules.  The alternative (used in the sky130 tech file) is a
tedious step-by-step "grow" followed by "and-not".  This rule
option is much cleaner to implement and computes faster (although
it is still a boolean operator and is much slower than an edge
rule).
2024-12-25 20:46:25 -05:00
Tim Edwards f06f3b47db Added an experimental option for the cifoutput tech file section to
force magic to scale down the internal grid to the minimum
manufacturing grid size specified in the cifoutput section, upon
reading the techfile.
2023-01-13 17:21:37 -05:00
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 05056d2f1f Left in the new code supporting the "calma contact true" option
for the squares-grid operator and for GDS compression.  But I
reverted the "calma contact" option to be false by default, because
the method does not exactly match the output when not using cell
instance arrays, and so may produce unexpected results.  Will
need a different implementation that uses the same code to generate
the same (effective) layout.
2022-11-10 14:46:26 -05:00
Tim Edwards e37a4f418a Based on output from a large contact array for a pad, modified the
default behavior of magic to make use of the "gds contacts true"
option to output contacts as arrays of subcells instead of
individual boundary entries, as the former is much more efficient
than the latter.  Set the option to be true by default, and set
the "gds flatglob" option to have one entry "$$*$$" corresponding
to the contact subcells created by the "gds contacts" option, so
that GDS reads and writes as it did previously (but using a
different method).  Expanded the method to include "squares-grid"
and "slots" operators (the latter should produce much more
efficient fill pattern arrays).  Implemented for both compressed
and uncompressed GDS.  Tested in all variations.
2022-11-10 14:08:58 -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 db6128232f Added a new cif/calma layer type "labellayer" that can be used to
tag geometry with a specific label which is the name of the layer.
2021-11-16 10:58:18 -05:00
Tim Edwards ea301b53f8 Corrected a case of a missing variable initialization in the case of
reading a bad "bloat-all" statement in a techfile.  This prevents
magic from eventually segfaulting when exercising the recipe in which
the bad statement occurs.
2021-11-05 12:15:57 -04:00
Tim Edwards dfba4601f1 Substantially revised the equations for computing bridges for the
"bridge" GDS output operator;  the previous equations were, under
some situations, failing to meet the width requirement.  Also:
corrected the "cif style" check so that it does not claim that a
style name with an exact match is ambiguous.  Also:  Corrected the
use of "grid limit", so that the limit correctly scales with the
output expander value.
2021-01-24 13:29:20 -05:00
Tim Edwards 69bd2fe57b Changed the cif output style option "see-vendor" to "see-no-vendor"
and made the default behavior equivalent to "see-vendor".  While it is
true that running "cif see" on a readonly cell shows layers that are
not necessarily representative of what is in the file, the opposite
behavior manifests itself in ways that are confusing.
2020-12-14 16:55:29 -05:00
Tim Edwards ea9d8cc3e5 Implemented first part of "mask hints", a method to allow mask
layers that are normally automatically generated to be supplemented
with additional geometry in the form of properties.  The first
commit implements a CIF operator "mask-hints" that tells CIFGenLayer
that additional geometry may be specified with a property named
"MASKHINTS_" plus the name passed to the operator as its only
argument.  A more extensive commit to be done will allow this
operator to be used on cifinput to use mask hints to retain the
exact geometry of mask layers used in the input file.
2020-12-14 16:16:37 -05:00
Tim Edwards 75a18053f8 Modified the CIFGenLayer() routine to be aware of when it is called during
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.
2020-11-12 10:34:27 -05:00
fabian-l-c c872db78b3 Added new cif operator bridge-lim
The new CIF operator BRIDGE-LIM is similar to the BRIDGE operator with the difference that the material created to meet the minimum spacing/width rules do not overlap the limiting layers. Syntax of the new operator is:

bridge-lim spacing width layers

where "layers" are the limiting layers.
2020-10-17 12:23:16 -04:00
Tim Edwards 5fb41a68c8 Modified the routine that determines contact size from the CIF rules
to accomodate a method used for processes that require additional
spacing between contacts for large via arrays;  this requires
distinguishing between large and small areas to output vias, and
so requires use of "and" and "and-not" before "squares".  This
highlights the arbitrary nature of this routine, which probably
works better getting data from cifinput, or not at all (i.e., it is
used when reading LEF, but it is known that the LEF read routines
would be better implemented by running input through CIFGen().  If
that were done, then this problem would not come up).
2020-07-31 14:11:24 -04:00
Tim Edwards b39a45a700 Further refined the layers used in hierarchical GDS generation to
exclude layers created using the "boundary" or "bbox" operators,
since they only exist in specific levels of the hierarchy.  Pretty
much by definition they should not be used in a way that requires
additional geometry to be added to the parent cell.  This greatly
reduces parent-vs.-child disagreements (and the corresponding error
messages), but does not entirely eliminate them.
2020-06-17 12:14:41 -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 56250c907d Added a "bridge" operator to the set of operators used for CIF layer
generation in the "cifoutput" section of the techfile.  This operator
solves the problems with the catecorner position of geometry when
attempting to automatically close up gaps between islands of a layer.
2020-06-11 16:40:01 -04:00
Tim Edwards 626a6355ae Added a Tcl scripted command "readspice" that can be used to read
SPICE subcircuit definitions from a netlist file and apply the port
order in the netlist to the port labels in the corresponding cell
or cells in the magic database.  Also:  Corrected an error in the
bloat-all code introduced in a recent commit that can cause a
segfault.
2020-05-28 11:46:57 -04:00
Tim Edwards 3203eec28c Modified the "bloat-all" cifoutput operator to allow operations on
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.
2020-05-26 14:29:36 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards aa738bb350 Corrected an obscure error in GDS generation caused by an
uninitialized variable, with the result that writing GDS would
claim that it cannot scale down enough and that the output units
are either wrong or the output style must have "units angstroms".
Using angstrom units would solve the problem but did not treat
the root of the problem.
2020-03-09 20:44:03 -04:00
Tim Edwards 67866c7991 Apparently GDS format does not enforce the original string character
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.
2019-12-19 17:28:06 -05:00
Tim Edwards 31612b593f Added new CIF generation op "grow-min" that ensures a minimum width
for a layer.
2019-12-02 10:18:37 -05:00
Tim Edwards 1fe128a405 Implemented new CIF operator "close", in the syntax "close <area>",
which takes the existing generated CIF plane, finds all enclosed
areas that have an area less than <area>, and fills them in.  This
satisfies a minimum hole area rule in a way that is not possible
with any of the existing CIF operators.
2019-11-25 15:14:41 -05:00
Tim Edwards be8ba09373 Created an additional argument "start" to the "slots" operator,
which adds an offset value of "start" to both X and Y from the
lower left corner of the fill area.  This allows the use of the
"offset" (from the previous git commit) to be declared on different
layers without creating an exact overlap, as is often required by
foundries for fill patterns.
2019-11-20 13:36:03 -05:00
Tim Edwards b493334c73 Preliminary changes to support extraction devices other than the original
simple FET device in extresist.  Also:  Extended the bloat-all CIF operator
again, allowing the trigger layer for the bloat operation to include both
CIF layers and magic layers (previously only magic layers were supported).
This extension is possible due to the previous extension allowing the
trigger layer and bloating layers to be on separate planes.  This operator
extension is useful for tagging geometry that is in the proximity of, but
not overlapping, geometry on another plane.
2019-10-17 16:21:56 -04:00
Tim Edwards 3d7a56ac3a Finally got around to undoing an annoyance caused by the wholesale
reduction of memory and startup time, which was to maintain only
one CIF style in memory.  The new method is just to read in and
keep the DRC CIF style separately from the output CIF style.
Because the CIF sections of the techfile are read before the DRC
sections, and the CIF DRC style is declared in the DRC section,
the CIF DRC style is read in on the fly during the first DRC
checking.
2019-10-15 16:24:49 -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 704f1dc69f Corrected an error that has been in the magic code forever, in which
if a GDS (CIF) layer is dependent on, and only on, a templayer or
layers that get hierarchically processed, it will not get added to
the list of layers needing hierarchical processing, and therefore
end up not being generated in the output.
2019-05-16 17:41:42 -04:00
Tim Edwards 66603cdb53 Corrected invalid logic in the interpetation of (cif/gds) label
options "text", "port", and "noport" in the techfile.  The
incorrect interpretation was preventing backwards compatibility,
such that ports would not be output on GDS layers if the "port"
option was not used.
2018-11-12 13:25:05 -05:00
Tim Edwards 9eb406ffba Implemented an idea from Staf Verhaegen to have "labels" options
"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.
2018-09-09 15:09:15 -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