Commit Graph

938 Commits

Author SHA1 Message Date
Tim Edwards 999b537f07 Major overhaul of the method for extracting the substrate, with the
intent to handle multiple isolated substrate regions.  A previous
version of this was added to the master branch but that method had
too many issues and is being deprecated.  This version is also very
experimental and is a work in progress.
2021-04-09 19:40:54 -04:00
Tim Edwards 8b9c47c3ef Removed the stupid restriction that "cellname readwrite" won't work
on a non-writeable cell.  While technically valid, that just means
that nobody can make temporary edits on the cell in memory, which is
useful in many applications.  A slight quirk of the "cellname" command
is that if applied to the cell currently in the layout window, it is
not possible to make the cell show as edited and editable until leaving
and re-entering the cell.
2021-04-01 13:09:08 -04:00
Tim Edwards 8f8c3f77f2 Got rid of the annoying behavior of "popstack" to not return to the
original view position;  this was due to not setting units to
internal before re-applying the previous view position.  Also wrapped
most of the "popstack" routine into a suspendall...resumeall block so
that the view is refreshed only once;  this is especially important
when popping back into a full chip view.
2021-04-01 12:31:46 -04:00
Tim Edwards fcdce0553d Corrected an error in the previous commit, and updated the version
number.
2021-03-29 11:54:47 -04:00
Tim Edwards 187c9285e2 Extended the "port" command with option "-quiet" to suppress error
output when using the "port ... index" or "port ... name" to query
values from a specific port by name or index.  The "readspice"
script has been modified to use this option to prevent unnecessary
error output from the script as it searches a layout for possible
name matches to a SPICE netlist subcircuit pin list.
2021-03-29 11:44:39 -04:00
Tim Edwards 9656c86b96 Added a negation capability to the "select intersect" command, so
that the intersection of (A and-not B) can be found.  This and the
(A and B) version give a large amount of capability like the cifoutput
operators available as command-line commands.  Also:  Fixed the new
"drop" command so that it properly redisplays and runs DRC after
executing, and modified the behavior so that the dropped material
is clipped to the area of the selection.
2021-03-25 15:35:37 -04:00
Tim Edwards 2cc557532d Modified the "flatten" command so that ports of the topmost cell
are preserved, which seems like reasonable behavior.
2021-03-25 14:39:29 -04:00
Tim Edwards f3febfae73 Updated VERSION 2021-03-25 11:17:27 -04:00
Tim Edwards 4964b1f789 Created a new command "drop" which can be used to drop a layer
into subcells in a hierarchy.  The intent is to use this in
conjunction with the "select intersect" command option added
yesterday to add deep nwell into the cells containing the devices
that need it.
2021-03-25 11:12:41 -04:00
Tim Edwards 2d1cf8435a Corrected the list produced by "what -listall" to have the intended
nesting.  Corrected the "select visible" command, which got broken
during the modifications.
2021-03-24 20:20:55 -04:00
Tim Edwards f5d8dbc3e5 Corrected an error in the last commit's implementation of the "what"
command.
2021-03-24 19:43:30 -04:00
Tim Edwards e884b5b256 Revised the "select intersect" command from the previous commit so
that the behavior is to pare down any existing selection by removing
any parts of it that do not intersect the layer specified on the
command line.  This is generally more useful than the previous
method, as the intended purpose is to intersect a number of layers
against one (e.g., all transistors intersecting deep nwell).
2021-03-24 16:57:22 -04:00
Tim Edwards dd86ecc454 Extended the "what" command to take the option "-listall" in
addition to "-list", where the list of layers returned is more
like the (recently extended) non-listing method where each type
is followed by a list of cell names in which that type is found
(within the selection area).
2021-03-24 15:30:30 -04:00
Tim Edwards b0f89ea4af Updated VERSION 2021-03-24 14:57:13 -04:00
Tim Edwards 7cb88ffceb Added a new selection command option "select intersect" that selects
the area of intersection between any number of types.
2021-03-24 14:52:17 -04:00
Tim Edwards e152deb97b Corrected typo from the last commit that will cause a crash. . . 2021-03-23 11:14:44 -04:00
Tim Edwards c2aedcebab Applied the same change made yesterday to DBconnect.c to ResConDCS.c
and SimDBstuff.c, which have nearly the same connectivity search
functions.  All three now use the hybrid list + stack method.
2021-03-22 09:49:56 -04:00
Tim Edwards f7820ed960 Corrected an error in the connectivity tables that for contact types
failed to add in any layers from other planes that are marked as
connected in the "connect" section of the techfile but otherwise
unrelated to the contact type and its residues.
2021-03-21 22:26:50 -04:00
Tim Edwards 4ff8d06810 Changed to a hybrid list and stack; the list keeps 65536 entries
at a time, and when it runs out of space, it pushes the stack.
This should speed up the connectivity routine somewhat, as it no
longer has to copy memory when expanding the list size, and it no
longer has limit at the integer boundary for memory allocation.
2021-03-21 20:53:20 -04:00
Tim Edwards fbd1acd60e A few corrections to the network connection selection. The pruning
method does not work and needs debugging, but is otherwise harmless.
2021-03-21 17:21:25 -04:00
Tim Edwards 633f6f558d Modified the connectivity finding search routine so that it does
not crash if too many unprocessed areas get queued up.  Also modified
it to prune entries that match one of the last five entries created
before searching the current tile.  However, it is not clear that
that makes any significant difference to the run time, and it needs
to be analyzed vs. the number of entries to check against.
2021-03-21 15:54:07 -04:00
Tim Edwards 58cdbc5356 Made the "select short" command a bit easier to use (and more in line
with the existing documentation) by not requiring the net containing
the two labels to be selected before running the "select short" command.
The command now first checks if the labels exist in the selection, and
if not, the command effectively executes "goto label1 ; select net" and
then continues as previously implemented.
2021-03-21 12:02:43 -04:00
Tim Edwards b77352849d Corrected the "what" command so that the correct cells are listed
that contain the selected paint.  Previously, all cells inside the
area of the selection box would be printed, which is completely
wrong, and can lead unexpectedly to thousands of cell instance
names being printed out.
2021-03-20 17:04:31 -04:00
Tim Edwards 8384891f3d Removed one diagnostic message after flattening a cell in GDS input
because depending on the GDS file it could be printed millions of
times.
2021-03-18 20:47:59 -04:00
Tim Edwards 08cb75a9b4 Modified the GDS read routine behavior so that if a cell is being
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.
2021-03-18 15:16:37 -04:00
Tim Edwards cde90bb4a7 Corrected a bad typo, "==" instead of "="; can cause a crash
condition when doing ext2spice.
2021-03-18 11:52:56 -04:00
Tim Edwards 2532a696e4 Correction from a recent commit; complicated sets of "equiv"
statement in a .ext file require that all aliases of a node name be
rehashed after a node merge, or else node loops can occur.  Also
prevented statements of the form "equiv A A" from being output in
the .ext file, as they are useless.
2021-03-18 11:37:44 -04:00
Tim Edwards fd4569081e Added a reference count to the node structure in extflat to account
for the "equiv" statement---equivalent nodes names have to be
registered in the def->def_nodes hash table, and if they point to
the same node, then that node can't be free'd until the last
referenced node is seen when iterating through the hash table to
free the node records during EFDone().  This is handled by the
reference count.
2021-03-17 14:54:36 -04:00
Tim Edwards 8a0b180cde Modified the crash backup script to add options "disable" and "resume".
However, this has not been implemented as it has been observed that
the use of itimer() has a restriction of one timer per process, which
interferes with the three or more uses of the timer within magic.  The
timer method will have to be changed to use the POSIX timer_create()
routine, before this will work properly.
2021-03-17 12:45:35 -04:00
Tim Edwards 59bfa6ce86 Found no fewer than three separate places that cause a pop-up prompt
for saving on a cell which is completely unmodified.  One of these
was due to the BPlane implementation, which forces an instance to be
deleted and re-placed on a bounding box recomputation, which should
not, in that case, be considered a modification.  Another always runs
DRC on a subcell upon reading rather than relying on any checkplane
entries in the file itself;  and the last one marking the timestamp
as modified stemming from an attempt to correct an O(N^2) check to
O(N).  All three cases have now been corrected.
2021-03-16 22:46:46 -04:00
Tim Edwards 010c0599bd Encountered a crash condition caused by the "equiv" statement, for
circuits with nets having multiple conflicting labels, depending
on where the "equiv" statement occurs in the .ext file output.
Corrected the error but am still puzzled as to why this has never
shown up before, as it does not appear to be the result of any
recent development work.
2021-03-16 20:31:29 -04:00
Tim Edwards 7757384355 Modified the "label" and "setlabel" commands, giving "setlabel" an
extra option "-default" that allows defaults to be set for any
label property other than text or port-related properties.
Subsequently, the command "label <text>" will apply the given
defaults to the label.  This allows a simpler way to create
rendered labels from the command line without remembering all of
the arguments to the extended "label" command.
2021-03-16 13:37:15 -04:00
Tim Edwards f790ea7589 More enhancements for schematic_to_layout to parse various
non-circuit content in a SPICE netlist (mainly to ignore test-
bench elements and commands).
2021-03-11 13:30:28 -05:00
Tim Edwards 56be41932f Restored the toolkit behavior of spreading out cells that are
read in from a SPICE netlist in a row instead of placing them
on top of each other.
2021-03-11 12:27:14 -05:00
Tim Edwards 3bd9adbaf8 Corrected a set of regexps in the schematic-to-layout script that
prevented normal x=y type parameters from being parsed.
2021-03-11 11:09:37 -05:00
Tim Edwards 5b8a59c4ad Added extensions to the toolkit base to add netlist-to-layout
conversion, largely converted from the python script in open_pdks,
which itself was derived from an efabless script, and none of
which have been particularly well tested.
2021-03-09 22:07:51 -05:00
Tim Edwards feddffcf45 Modified the handling of subcircuit names beginning with non-alphanumeric
characters.  Instead of removing the non-alphanumeric characters, magic
now prepends an "x" to the name.  Since this naming restriction does not
necessarily impact, say, LVS, it would probably be better to let this
behavior be enabled or disabled by a command.
2021-03-06 19:39:34 -05:00
Tim Edwards 324721b514 Added some options to the net selection with respect to labels.
The previous behavior was to generate hierarchical names for all
labels when copying contents of subcells.  This is "safe" for
copying selections without accidentally shorting things through
labeling, but it can make a mess of the selection.  Options are
now "select do labels" for the existing behavior, "select no labels"
to not show any labels, and "select simple labels" to show only the
root name of labels in subcells.
2021-03-04 14:00:31 -05:00
Tim Edwards c99e632744 Modification of readspice.tcl script to work around issue if no ports
are found (i.e., "port first" returns nothing, instead of a number).
2021-03-03 11:39:35 -05:00
Tim Edwards e4bebffeb4 Updated VERSION with the previousl commit to fix problems with the
hierarchical SPICE netlist generation.
2021-03-01 11:28:15 -05:00
Tim Edwards 33927740bf Merge branch 'master' of opencircuitdesign.com:/home/tim/gitsrc/magic/
Pull before push.
2021-03-01 11:12:42 -05:00
Tim Edwards 83808dcf79 Corrected an error that was causing disconnects in the hierarchical
SPICE netlist output that appears to have come from flags created
for writing DEF that inappropriately got set during ext2spice.
A redundant call to efAddNodes() was adding confusion by appearing
to handle most cases but actually missing some.  With the corrected
flag, the redundant call is really redundant and can be removed.
It has not been tested whether DEF output is affected by the change
(DEF output from magic is rarely used, anyway).
2021-03-01 11:08:25 -05:00
Tim Edwards 4cc09afeac Corrected some errors relating to distributed allocation of node
area and perimeter across devices.  The distributed allocation
was missing for hierarchical output, and the function that
accumulates values per resistance class was initializing by
iterating over device classes, not resistance classes, leading
to a segfault if the number of device classes is larger than the
number of resistance classes.
2021-02-25 17:51:12 -05:00
Tim Edwards 114b9a59f7 Implemented more automation for attempting to find a tech file
based on the contents of a .mag file being read in, assuming
compatibility with principles of open_pdks.  The search paths
are not meddled with unless a file is read for which the technology
cannot be found (and a technology has not already been read, or at
least no database file exists in memory using any technology that
has already been read).  If so, then variables PDK_PATH and PDK_ROOT
are searched for in both the shell environment and the local Tcl
environment.  Also, if open_pdks has installed PDKs in the path
/usr/share/pdk/, then that path will be searched.  If a corresponding
technology file is found, it will be loaded.  If the path corresponds
to an open_pdks-style path, then the library paths in libs.ref will
also be added to the search paths for cells.
2021-02-25 13:37:31 -05:00
Tim Edwards 2bb3580f3e Also modified DEF reads to avoid letting instance names contain
either slash or comma.
2021-02-24 14:51:46 -05:00
Tim Edwards f2af326368 Gave up on attempting to separate out slashes in instance names
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.
2021-02-24 14:41:35 -05:00
Tim Edwards a61026588c Revert "Modified the .ext file reading and the .spice file writing so that"
This reverts commit 46baae0ce6.

Reverting the last commit, as it does not work completely the way it
is supposed to, and will most likely have to be done in a different
way.
2021-02-24 12:35:06 -05:00
Tim Edwards 46baae0ce6 Modified the .ext file reading and the .spice file writing so that
array delimiters and hierarchy separators (characters '/', '[', and ']')
that are part of instances or labels passed to magic, are preserved
from input to output, but internally marked (with a backslash escape)
so that they are not misinterpreted my magic when running ext2spice.
2021-02-23 13:46:12 -05:00
Tim Edwards 9a79a1eee2 Fixed a minor error in the plot command that is missing a value
in the print statement on detecting an invalid plot parameter
value name.
2021-02-23 09:58:52 -05:00
Tim Edwards 2e9c554f2c Revised the wrapper script to use the Tk command "font measure"
to get the pixel size of the default font, and scale the window
glyphs and scrollbars to match, so that the display is automatically
adjusted for screen resolution and does not require manual intervention
to correct for high resolution displays.
2021-02-20 13:24:02 -05:00