new port labels are created for an existing port, then they must
take the existing port number. The code was previously causing
collisions between port numbers on different pins.
without SelectRootDef being set, which causes SelectClear() to
return without doing anything. However---question is why
SelectClear() needs SelectRootDef to be non-NULL since it is
clearing the selection, not the selection source. For now, just
patching the failing case, not trying to mess with the whole
selection mechanism.
lefLayer's "via" record even when the layer might not be a via,
causing potential issues with uninitialized variables. Not sure
if this is related to the bug that started this investigation,
but it was the only thing that looked relevant.
used in a re-entrant manner. Applied to an existing layout,
it will no longer keep generating new instances and ports over
top existing ones. Could use improvement by attempting to
retain the location of a device when the instance changes
device type (such as when a device parameter was changed in
the netlist). However, the current set of changes should
help, whether the re-entrant use is purposeful or accidental.
fails in the bplane code for subcell binning. It is still not
clear why this example causes a failure when the bplane code
has been working for so long. However, simply checking for the
BT_ARRAY bit at one additional point in the code prevents the
crash condition and appears not to have caused any issue with
the database.
a method that failed to work on devices with complex shapes on the
device recognition layer, such as snake-geometry resistors. (2)
The use of contact type "xpc" in the sky130 tech file as its own
contact residue caused the contact tracing in extresist to fail.
I opted to keep the unorthodox contact description in the tech
file and wrote an extension to a routine in extresist to handle
the case.
from Ryan Schmidt, changing regular expression strings in the python
preprocessor to raw string types so that they don't produce warnings
in python 3.12.
behavior when a child coordinate is not specified; otherwise,
the original code's setting of the child reference point to the
bounding box lower left causes the lower left point to be
used always, which is not how the getcell command is supposed to
function.
to place a cell in a meaningless position for any rotation and flip
combination other than zero. The issue was that the reference point
was not rotated along with the cell.
name. The instance search routine was not rejecting internal cells,
and so would choose, e.g., a selection cell and reject it because it
was not the edit cell.
fixed for "cifwidth" and "cifspacing", in which the rule distance
is incorrectly multiplied by the expander (in the case of area,
multiplied by the expander squared).
The fractional part of the rule distance (modulus after scaling)
does not fit in the unsigned char variable unless it is first
divided by the scalefactor (also requires multiplying up by the same
amount when scaling the other direction). The truncation of the
unsigned char value was causing the minimum area value to be off by
a small amount, causing false negatives (no DRC violation is shown
when metal area is slightly smaller than the minimum allowed).
that resolves issues of excessive tile fracturing during read-in
of GDS (or CIF) polygons and paths that have non-manhattan geometry.
This was particularly noticeable when reading the GF180MCU corner
I/O cell, which ended up being something close to a worst-case
scenario.
`magic/database/DBio.c::DBOpenOnly` calls `dbReadOpen(CellDef *, bool, bool, int)` with a pointer for the second argument. While technically valid C, newer compilers (Clang 16) have recently frowned upon implicit pointer-to-int conversion, requiring the flag `-Wno-int-conversion` or else an error is raised.
Given that there is one such instance in the codebase, I think fixing it would be the simplest solution.
missing from a netlist generated by ext2spice with the "extresist"
option enabled. The first had to do with some parts of nets being
given alias names for a net, and the second was caused during
"extresist" and would also result in error messages about devices
missing terminals.
"gds readonly true" mode and when writing a GDS file in full-dump
mode. Reading or writing a file with an incompatible DBU is now
prohibited. This is not a great solution, as it forces the
original file to be rewritten with a different DBU. Preferably
there should be code to scale the units during a dump, but that
needs to be coded.
correctly handle subcircuits that are used before they are
defined, and will determine whether the imported spice does or
does not contain a top level, and either return to the top level
or any top level cell found in the netlist.
client data value as the exit status value (this was not at
all clear from the documentation and required a bit of
experimentation). The fix allows Tcl scripts to exit magic
with a non-zero status by invoking "exit" in Tcl.
of SI values, this time to put the precision and the value in the
order that is generally more accepted. The gcc compiler, at
least, doesn't seem to care which order they are given in.
depending on the order of extraction devices. Specifically, the
case of a source-drain tied FET was breaking out of a loop when
it should have been breaking out of a double loop.
can provide a delta offset such as "l+0.06", indicating that
the extraction model has a length larger than the drawn device.
Previously the value was assumed to be in microns but did not
scale between the .ext file and the SPICE netlist. Corrected
so that it scales like the other parameter values, being
converted to internal units and tracking the internal grid
scale.
cell being generated. This statement does not disambiguate the
case where a cell is being ripped verbatim from GDS instead of
being generated from the magic database. This print statement
has been split into two cases, and where a cell is being ripped
verbatim, the name of the file is indicated. This provides better
information to the user.
a filename causes an error instead of generating a trash filename
or crashing, while (2) "plot pnm" with a filename that has the ".pnm"
extension does not add another ".pnm" extension to the end of it.
no way to implement boolean operators on labels, so any "label"
statement in the section can apply only to one magic layer. This
is regularly violated in most (all?) techfiles (due mainly to lack
of explanation and guidance). The addition of the "no-reconnect-
labels" option for cifinput made it worse, as it can cause a label
to be attached to the wrong layer and be stuck that way. Even
without the option, an attachment to a non-connecting type is a
problem; DIFF cannot simultaneously have a connection to both
ndiff and pdiff, so it will be one or the other, and the one not
connected can easily get labels moved to other nets. To avoid
this: (1) removed the "no-reconnect-labels" option, and (2) made
the automatic label reconnection smarter, as well as splitting it
into two different behaviors based on whether a label is being
created or manipulated from the command line (more or less the
original behavior) vs. being read from GDS or LEF. The new rules
assume that labels attached to a GDS type will all map to the
same plane in magic. To avoid excessive error messages from
existing tech files, a warning is issued only if "labels" changes
the plane of the target layer (a realistic solution rather than
the preferred one). Also: Fixed an error that causes a crash on
the "wizard" command "*watch" if the cell being observed is
read-only (see github issue #271).
"unexpected asymmetric device" is printed prematurely, as it
is inside a loop checking over all device entries compatible
with a device type. Also: Flagged an issue with the "label"
keyword in the "cifinput" section of a tech file. The "label"
keyword cannot be used in conjunction with boolean operators.
It can only connect labels on a specific GDS type to one magic
type. Unfortunately, because this was not flagged before as
an error or warning, the incorrect usage has crept into a lot
of tech files. This uncovers an underlying issue that labels
must be allowed to automatically reconnect types, which is
undermined by the "no-reconnect-labels" cifinput option. That
issue will be addressed in an upcoming commit.
better supports re-entrant use, especially for the use case where
the import was abandoned before saving, or the generated cells
were not saved (which is easy to do, because the top level cell
is always written out to disk, but the rest of the cells will only
be written when "writeall" is executed). The new code detects
input cells that did not have any layout file (has flag "not-found"
after loading) and deletes them and their instances so that they
can be regenerated from scratch.
to pick up properties from an existing cell and prints an error
message instead. This will likely cause non-default properties
of an instance to be lost if the SPICE import is used in a
re-entrant manner (not exactly a common use-case).
different way. Added a routine to remove all layers of a contact
from all planes except the contact's base plane before finding
and processing contacts. This causes ExtFindRegions() to find
and process only one tile on one plane per contact, so there are
no redundant contact entries. Also, any overlapping stacked
contacts are resolved, which avoids the very common error of
contacts not being processed at the correct size because they
are being processed per tile for chopped-up areas.
was made to limit the ExtFindRegions() search to one plane per
contact. Fixed this simply by doubling the resistance per via
so that the final result is correct.
bounds should be called whenever an entry is changed and either
the entry window loses focus or the <Enter> key is pressed.
This had ended up disabled when the scrollbar was added to the
dialog window, causing the window hierarchy to change, which
invalidated the regexp used to identify the entry and checkbox
widgets.
routine that marks resistors in loops to prevent infinite
recursion, but later incorrectly eliminates those resistors.
Also: Changed the "tolerance" command to affect only the R-C
time constant tolerance. Added a "threshold" command option
that limits output of small resistors. This can help reduce
large networks that are otherwise not reducible by the three
methods of reduction (serial, parallel, and delta-wye), but
does affect output values (slightly). This will probably need
to be revisited at some point.
cuts per contact area during parasitic resistance extraction.
Previously, the result was divided by the via pitch twice,
resulting in most contact areas being reported as a single
cut.
in DEF read and write. The NONDEFAULT LAYER WIREEXT was assumed
to refer to the default wire extension at segments, when instead
it refers to the wire extension only at vias. The wire
extension at segments is presumably defined by the nondefault
segment (and wire extension at vias remains unimplemented, which
is probably not a big issue because everyone puts the wire
extensions into the via definitions anyway).