Commit Graph

1521 Commits

Author SHA1 Message Date
Tim Edwards 54773957c9 Corrected an issue with annotating a layout from a LEF file; if
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.
2024-03-18 16:25:49 -04:00
Tim Edwards cb73ebfab0 Corrected an error in lefWrite where SelectClear() is called
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.
2024-03-08 12:28:29 -05:00
Tim Edwards eeeaf49ec7 Corrected an error in defGetType() that incorrectly looks at a
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.
2024-03-08 09:33:13 -05:00
Tim Edwards 191bff6c47 Modified the schematic-to-layout script to be better at being
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.
2024-02-27 15:41:17 -05:00
Tim Edwards 3691b53dde Was given a use case by Carsten Wulff (github issue #289) that
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.
2024-02-19 12:54:51 -05:00
Tim Edwards 814fb6f18d Corrected two separate issues with R-C extraction: (1) There was
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.
2024-02-18 14:04:21 -05:00
Tim Edwards 038f02d2b2 Updated the version to go along with the merge of pull request #288
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.
2024-01-23 15:34:05 -05:00
Ryan Carsten Schmidt 8a93d6136b
Use raw strings in preproc.py
Avoids "SyntaxWarning: invalid escape sequence" with Python 3.12.
2024-01-23 09:38:23 -06:00
Tim Edwards b08c785c1d One correction to the previous commit to restore the original
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.
2024-01-21 16:29:02 -05:00
Tim Edwards 7f5571768f Corrected a long-standing error, which caused "getcell child <point>"
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.
2024-01-21 15:54:49 -05:00
Tim Edwards 5f6ba3be69 Corrected an error when using the "instance" command with an instance
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.
2024-01-21 11:00:19 -05:00
Tim Edwards 63109229f4 Corrected an error in the "cifarea" rule that had previously been
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).
2024-01-14 17:35:39 -05:00
Tim Edwards 6b8239e258 Corrected a recently-discovered error in the "minimum area" DRC rule.
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).
2024-01-14 15:19:39 -05:00
Tim Edwards a816da60f9 Updated the HTML command reference files to refer to magic version 8.3,
since all of the title images still had 8.2, and the title text still
said 7.3 or 7.4, having not been updated for a long time.
2024-01-09 16:37:00 -05:00
Tim Edwards 006c07082b Inadvertently introduced a segfault on exit on the last commit,
while trying to get rid of a compiler warning.  Fixed by this
update.
2024-01-01 15:36:05 -05:00
Tim Edwards 8f9c328150 Got rid of two compiler warnings; one recently introduced, the
other from some time ago.
2023-12-30 15:00:18 -05:00
Tim Edwards 68e537b968 Added a tile unfracture routine at the end of CIFMakeManhattanPath
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.
2023-12-30 14:10:09 -05:00
Tim Edwards 0cd4a10036 Updated version to go along with the merge of pull request #283
from Vasil Yordanov, which changes the toolbar icon into a
scrollable list with layer names, much better than the former
minimalist array of icons.
2023-12-15 15:58:20 -05:00
Vasil Yordanov affd68aad9 EDIT: wrapper maketoolbar method refactored into a separate script, with changes to the toolbar. Reorder layers functionality added as well 2023-12-15 15:54:05 -05:00
Tim Edwards 943e0d4d8d Updated version to go along with the merge of pull request #282 from
Donn (corrects a pointer incorrectly passed to dbReadOpen() that
should have been a boolean).
2023-12-04 10:33:05 -05:00
Mohamed Gaber 9e6d1d789e More explicit pointer truthiness check
`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.
2023-12-04 17:10:11 +02:00
Tim Edwards 83ed73ac52 One more change to the "extresist" code which prevents extresist
from substituting a regular label for a port during a node merge,
which can cause ports to become orphaned.
2023-11-27 16:18:43 -05:00
Tim Edwards 84af801608 Fixed two independent errors, both of which can cause devices to be
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.
2023-11-24 16:51:26 -05:00
Tim Edwards 21336607e0 Added checks for GDS scalefactor (DBU) both when reading GDS in
"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.
2023-11-21 09:44:16 -05:00
Tim Edwards 5352a23577 Updated the SPICE import routine in the toolkit so that it will
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.
2023-11-15 11:46:22 -05:00
Tim Edwards d09b0e8c51 Corrected an error that can prevent capacitances to substrate from
being output if the substrate node is declared as a port.
2023-11-14 20:10:57 -05:00
Tim Edwards 11080465ad Corrected the Tcl exit hook routine so that it passes on the
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.
2023-11-11 13:09:59 -05:00
Tim Edwards 7db77d47f1 Yet another fix to the ext2spice code handling output formatting
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.
2023-11-10 12:52:55 -05:00
Tim Edwards 1131085d0f Added "u" as a recognized suffix to dimensions, meaning the same
thing as "micron" or "um", since it is regularly used that way.
2023-11-10 09:45:32 -05:00
Tim Edwards 67d68717ca Corrected a typo in the ext2spice code as pointed out (with
corretion) user cgurleyuk on github.
2023-11-10 08:01:51 -05:00
Tim Edwards 8445f3eb5d Corrected ext2spice to avoid incorrect precision when writing out
values.  The "%.3g" format was changed to "%.*g" with a variable
precision that accounts for the actual precision required by the
manufacturing grid.
2023-11-05 11:00:30 -05:00
Tim Edwards 0894248e0a Updated version to go along with the merge of pull request #278
from user pinu-73 (updates to the MacOS install instructions
with additional information and explanation).
2023-11-02 10:11:10 -04:00
Dikshant 40e6a28ff6 appended macOS install file for XQuartz Display issue. 2023-11-02 18:08:03 +05:30
Tim Edwards df6333bb7b Modified the "makedbh.in" script ("makedbh", after running
configure) so that it does not use python-3.6-style f-strings,
and so is backwardly compatible with any python-3 revision.
2023-10-28 12:14:26 -04:00
Tim Edwards 22ea7a924f Corrected an extraction error that can cause an infinite loop
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.
2023-10-27 14:32:44 -04:00
Tim Edwards 7a9445ec30 Corrected the extraction offset, in which a parameter like "l"
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.
2023-10-24 20:29:04 -04:00
Tim Edwards 610c86a234 When writing a GDS file, there is a statement printed about each
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.
2023-10-24 10:36:57 -04:00
Tim Edwards 98f3b39dc2 Two small tweaks on plot filename behavior: (1) "plot svg" without
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.
2023-10-17 20:01:39 -04:00
Tim Edwards fdcc178bcd After a discussion about "cifinput" rules, realized that there is
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).
2023-10-17 15:54:38 -04:00
Tim Edwards 5b29870fce Corrected an extraction issue in which an error message about
"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.
2023-10-16 17:29:05 -04:00
Tim Edwards 8798a3256c Corrected an error in which DRCStatus is set outside of an #ifdef
for MAGIC_WRAPPER, which is required.
2023-10-12 15:14:13 -04:00
Tim Edwards eda5f506f3 Made another change to the netlist-to-layout procedure so that it
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.
2023-10-06 19:38:53 -04:00
Tim Edwards 9e7c104d29 Corrected a small error in the device generator toolkit that fails
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).
2023-10-06 17:51:40 -04:00
Tim Edwards ce6f7840db Backed up the version by one minor revision because I accidentally
upped it twice in one day.
2023-09-29 17:47:03 -04:00
Tim Edwards 2aa7380cb6 Changed the fix from the last commit by solving the problem in a
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.
2023-09-29 12:41:54 -04:00
Tim Edwards dacbfc4e1f Found that "extresist" double-counts contacts because no attempt
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.
2023-09-29 10:48:05 -04:00
Tim Edwards b156e79b2c Corrected a toolkit error where the callback to check parameter
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.
2023-09-29 09:38:48 -04:00
Tim Edwards 088bb828ac Corrected an error in the original resistor network simplifying
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.
2023-09-28 17:15:27 -04:00
Tim Edwards 656b5dbabe Corrected an error in the calculation of the number of contact
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.
2023-09-28 12:38:08 -04:00
Tim Edwards 7aa846443a Corrected an issue with the implementation of nondefault rules
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).
2023-09-26 21:26:31 -04:00