Commit Graph

1647 Commits

Author SHA1 Message Date
Tim Edwards b441d668bd Corrected the "property" command parsing, which had a print statement
without an argument, resulting in random things getting printed to
the output when a property name does not exist.
2024-08-03 12:05:41 -04:00
Tim Edwards 81b5ac2079 Added two checks when loading a file to determine if two cells are
the same:  (1) If the inodes of the filename are the same, then the
cells are the same.  This avoids treating symbolic links as
different paths with different files;  (2) If both layouts are in
git repositories and the git repository commit hashes are the same,
then the cells are considered to be the same.  This allows projects
to be cloned into other projects as dependencies and used in
multiple places without magic treating them as different layouts.
2024-06-13 15:39:27 -04:00
Tim Edwards e9db9ecbc9 Another correction that avoids a crash condition when attempting
to do an instance array resizing on an uneditable cell.
2024-05-25 21:15:01 -04:00
Tim Edwards cf5fd867f4 Corrected another error related to read-only views in which magic crashes when
attempting to place a generated cell in the layout, as pointed out by Mark Martin
in github Issue #309.
2024-05-24 12:43:36 -04:00
Tim Edwards 291ba96285 Corrected a bad statement running Tcl_NewListObj() that fails to
assign the result to anything, causing later uses of variable
"lobj" to have an unitialized value and potentially causing a
crash condition.  Thanks to Risto Bell for pointing out the
error.
2024-05-13 21:51:59 -04:00
Tim Edwards e4c28ef3bf Corrected an issue introduced in version 8.3.471 when trying to fix
some of the "select" command syntax;  the code change caused the
"select top cell" command to behave the same as "select cell".
There was no specific code for handling "top", so now there is.
2024-05-12 15:54:40 -04:00
Tim Edwards f0c3ec33d6 Modified the "lef nocheck" command to take the argument "*", meaning
that no nets will be checked for antenna gate and diffusion area,
and no antenna properties will be output to the LEF file.  This can
greatly speed up LEF output file generation for a large design.
Thank you to Tamas Hubai for the code patch.
2024-05-11 20:48:35 -04:00
Tim Edwards 9dec47c9b2 Corrected a fairly long-standing error in which the MASKHINTS_ values
in the .mag file "properties" list are not handled as being in
database units during .mag file reading and writing (although they
do track internally), making them subject to being scaled incorrectly
and change between a read and a write.  Thanks to Sylvain Munaut for
identifying the problem.
2024-05-10 13:05:06 -04:00
Tim Edwards fd2b1eb9ee Added code that when running "extract unique" always prefers to
change a non-port label name instead of a port name whenever it
finds one of each with the same text on different nets.
2024-05-07 16:20:35 -04:00
Tim Edwards ca99d0b76a Altered the behavior of handling labels when a layer under a label
is erased.  In cases where magic would previously unattach the
label from the material and attach it to "space", now magic will
instead adjust the size of the label to stay entirely on the
material.  That avoids a common error of losing label or port
connections when the material is trimmed back.  Thanks to Philipp
Guhring for suggesting this implementation (github issue #305).
2024-05-04 21:12:55 -04:00
Tim Edwards efccdbf341 Made some changes to the extresist code to handle the case where
a transistor's first tile record is a well or substrate type;
normally this is avoided, but if that's the only device terminal
that connects to the node, it will be used.  Also changed the
code to not report a failure when space is found under the
device, when space is allowed as a substrate type.  Instead it
will print a message that the substrate is not being extracted as
a resistive network.  However, note that the correct solution is
to do what the regular "extract" code does, which is to paint the
substrate type in the cell area first, so that there are valid
tile types to use for extracting the substrate network.
2024-05-04 20:16:55 -04:00
Tim Edwards 3dc5018af4 Changed the automatic search for tech files from the "tech" line in
a .mag file to include the original system path.  This restores the
ability to find the tech file for any cell created using the old
SCMOS technologies.  This method is as problematic as is the way
all SCMOS tech files used the same name "scmos".  But at least it
preserves backwards-compatible behavior (behavior prior to 8.3.471).
This commit corrects github issue #306.
2024-05-03 21:43:27 -04:00
Tim Edwards fe9ca3a4ce Corrected the routine that parses MASKHINTS_* in cell properties to
avoid an infinite loop in the case that the mask hint does not have
a number of values that is a multiple of 4.
2024-05-01 13:45:00 -04:00
Tim Edwards 0ae54b500a Added the ability to track the first CellDef to fail to read and
report it after "Failure to read in entire sub-tree".  This will
not report every failing cell (since it quits reading after the
first failure) but will avoid the existing issue of printing
nothing and leaving the user with no feedback as to which cell
was the problem.
2024-04-29 17:43:37 -04:00
Tim Edwards 41e65b5214 Committing a patch to prevent segfaulting during "extresist" when
non-Manhattan geometry is analyzed for resistance extraction.
This patch merely prevents the crash condition.  It does not
solve the root of the problem, which is that split tiles can
belong to two different nets, but the tile can hold extraction
information for at most one of those nets.
2024-04-16 20:51:52 -04:00
Tim Edwards 3a1f4dc816 Removed an "if" statement that was apparently designed to
reduce the amount of redundant painting done by the connectivity
search algorithm, but which was preventing composed types (such
as FET gates) from getting added to a net if one of the composing
types (such as poly) was drawn over the device in an ancestor
cell.  Removing the "if" statement does not appear to have any
significant performance impact, so this change is being adopted.
2024-04-11 15:18:25 -04:00
Tim Edwards 82d64aa4b1 Corrected an issue with passing a Tcl script as a command-line
argument.  For interactive magic in the Tcl/Tk wrapper, the
"-nowindow" option was appended to the command line.  But for
Tcl scripts on the command line, all arguments following the
script name are considered arguments of the script.  So the
"-nowindow" argument has to be inserted at the beginning of
the command line as the first argument after "magic".
2024-04-10 20:51:05 -04:00
Tim Edwards 60049f3702 Modified the "select" command routine to get rid of the very hack
method of messing with the argument count when using qualifiers
like "less" and "more".  Now it keeps a separate count of the
number of non-qualifier arguments.
2024-04-08 17:59:53 -04:00
Tim Edwards 38d890c407 Made a slight modification to the "lef write -hide" routine;
previously, MASTERSLICE layers would not be added to obstruction
layers made by "-hide".  However, an nwell, for example, that
stuck outside of a prBoundary *would* be recorded, which was
inconsistent.  Resolved this by allowing MASTERSLICE layers
in the OBS block, but only for layers that are not a substrate
type.  NOTE:  It may be better to just insist that a MASTERSLICE
layer define an obstruction type in the "lef" section of the
tech file, and treat it like routing obstructions.  Alternatively,
one may question whether special obstruction types are needed at
all, as one could simply define an obstruction as a type without
a port label.
2024-04-08 14:10:46 -04:00
Tim Edwards 71f4dd2f9f Discovered that the non-Euclidean distance checks had not been
completely implemented for the "cifwidth" and "cifspacing" rules,
resulting in those rules being Manhattan distance checks.  Finished
the implementation (duplicating code from DRCbasic.c, with
appropriate scaling to CIF coordinates).
2024-04-06 16:36:31 -04:00
Tim Edwards 8b3524575f Corrected the failure to copy mask hints to the flattened DRC yank
cell.  Otherwise, DRC errors corrected by mask hints will get
flagged.
2024-04-06 15:03:37 -04:00
Tim Edwards 4e5af57f3c Corrected an issue with "instance celldef" when the instance name
contains brackets which are not indicating a cell array.  Also
fixed a related issue with the PDK toolkit code, in which the
gencell routines fail if an instance name contains brackets which
are not indicating a cell array.
2024-04-05 17:47:44 -04:00
Tim Edwards 9800d98dee Corrects "ext2spice hierarchy off" when subcircuits with ports are
present.  Note, however, this fix breaks the use of "ext2spice
subcircuit descend off" because subcircuits are always descended
into.  It's not clear that "subcircuit descend off" worked at all
before, anyway.  That still needs fixing.
2024-04-02 21:55:57 -04:00
Tim Edwards d0f6dab896 Corrected issue from github issue tracker #297, where "Import SPICE"
fails on instances with names containing brackets.
2024-04-01 16:42:10 -04:00
Tim Edwards bfd938b5e2 Correction to the previous bug fix: The layer was correct and
did not need to be changed, but the line below it that depended
on the layer being a contact type was wrong;  the contact had
to be identified independently of the last layer type, which
might not be the contact cut type.
2024-03-20 22:15:41 -04:00
Tim Edwards fede9d5c4d Fixed an error when reading a DEF file using generated vias in a
non-default rule.  The code was first failing to identify the via
cut type from the generated via record, and then it was failing
to return to the non-default rule width after the route exits the
via.  Both issues have been fixed.  Thanks to Sylvain Munaut for
providing a reproducible test case.
2024-03-20 17:19:45 -04:00
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