Commit Graph

102 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 2d79e0e0ce Corrected variables that set the PaintPlane routine, which had been
changed from returning void to returning int without changing the
type of the variable, thus causing a compiler warning.
2021-02-18 15:47:40 -05:00
Tim Edwards 5b2042d078 Corrected the "property put" command to handle changes in the
GDS_FILE property in the same way that it handles changes to the
FIXED_BBOX property, by setting or clearing the associated flag
bit in the cell.  Otherwise, it becomes impossible to make a
cell writeable, as it always has some belief that it is still
attached to a specific GDS file.  Corrected an error in the
"gds" ("calma") command parsing that switched the callbacks for
the "noduplicates" and "nodatestamp" options.
2021-02-18 15:36:29 -05:00
Tim Edwards 59b021af73 Corrected an error in which the "select" command returns the name
of an instance with double-escaped brackets if the instance name
contains brackets.  This then undermines the use of the backslash
escape and causes the interpreter to raise an error instead of
printing the name.
2021-02-18 13:05:29 -05:00
Tim Edwards d1f7e43dcc Revised DBWloadWindow (again) so that boolean flags are passed to
it as a single value "flags" (unsigned char) with meaningful flag
names.  Added new option "-fail" to the load command to allow
magic to fail on loading a cell that does not have a corresponding
file rather than the default action of creating a new cell.  Added
a flag for the "-quiet" option so that behavior on "-fail" can be
done quietly.
2021-02-10 13:05:38 -05:00
Tim Edwards 2a1494e4d1 Added "cellname timestamp" option to the "cellname" command to
print or set cell timestamps.  This is intended to be used with a
PDK installer like open_pdks.
2021-02-03 15:53:12 -05:00
Tim Edwards e7e01a635f Modified the behavior of "gds write" to refuse to write out the
magic database derived layout of a cell that declares GDS_FILE
but for which the GDS file referenced cannot be found or read.
This will produce an incomplete GDS file instead of an apparently
good and complete GDS file that actually contains bad data.  Also:
Added new command "random" that allows a random seed to be set,
for use with the GDS output when writing a full dump of a GDS
file.  Otherwise, the output prefixes are always the same, which
defeats the purpose of adding the random prefix.
2021-01-15 12:40:20 -05:00
Tim Edwards 7dfe407787 Implemented a return value for the cell read-in checks with an option
to stop the search whenever a cell is not found.  Used this to implement
a new option for GDS writes, "gds undefined allow|disallow" (default
"disallow") controls whether or not GDS with undefined references will
be allowed to be written.  Similarly affects CIF and LEF writes, extraction,
and DRC (when running "drc check" from the top).
2021-01-14 15:21:39 -05:00
Tim Edwards 71fbcaca6e Added the ability to handle command option "cif list cover ..." to
provide a single decimal value back to the interpreter, without the
additional diagnostic output.
2021-01-12 13:15:29 -05:00
Tim Edwards feeeccecda Corrected error caused by empty string labels in GDS input; when
a cell is flattened, these were getting the hierarchy prepended
and therefore became non-NULL and tending to screw up things
generally.
2021-01-07 21:47:16 -05:00
Tim Edwards 67d0d8c3f0 Corrected the use of the global substrate node name; this has been
restricted to its original intent, which is to replace the long name
formed from the plane short name and the "minfinity" coordinate.
This avoids issues with conflicting substrate names derived from a
real layer such as pwell.  Also, the global substrate node name now
returns the variable name without the "$" in front if the variable
has not been set to anything.  This avoids potential syntax errors
in the netlist.
2021-01-07 15:19:36 -05:00
Tim Edwards 3b137a6d14 Added a "-quiet" option to "load" so that scripts that use "load"
to create a new cell that is not expected to exist on disk will
not generate annoying error messages.
2020-12-30 09:43:24 -05:00
Tim Edwards 1426f5921f Added an option "-dobox" to the "flatten" command, which flattens
just the area inside the cursor box.  This is important for certain
methods like stepped fill pattern generation.
2020-12-29 11:51:15 -05:00
Tim Edwards bcc7b3d06d Added an option "gds flatglob [<string>|none]" that allows flattening
of input cells on a per-cellname basis, using glob-style pattern
matching.  This is probably the best way to deal with 3rd-party vendor
GDS with unfortunate practices like dividing devices up among cells in
a hierarchy, even though it comes across as a bit of a hack solution.
2020-12-22 14:44:30 -05:00
Tim Edwards ba77257afa Several changes and updates: (1) Added a new keyword "required" to the
tech file format "version" section.  This can be used to specify the
version of magic that must be used to be compatible with the tech file.
This effectively supercedes the technology version number.  (2) Changed
the behavior of "make" to set the version and revision numbers on doing
"make" instead of "configure".  This allows the version to update
correctly after doing a "git pull" followed by "make" without doing
"configure" in between.  (3) Fixed a couple of issues that were flagged
as compile-time warnings.
2020-12-16 11:49:24 -05:00
Tim Edwards 5755e0bcfd Added "gds" command option "gds nodatestamp [true|false]". Set to
true, this will force the "gds write" command to write out creation
date stamps as zero.  This is very useful for avoiding changing the
contents of an otherwise-unchanged layout, especially if it is in
a git repository where it will force the entire file to be replaced.
2020-12-15 14:52:30 -05:00
Tim Edwards 2b513eb3bb Added command options "flush -dereference" and also "cellname dereference"
to allow a cell to be flushed with dereferencing (i.e., discard any file
path attached to the cell, and use the search paths to find the cell when
it is reloaded).
2020-12-10 12:13:48 -05:00
Tim Edwards 6952e814f6 Added a command option "cellname dereference" to force a dereferencing
flush of a cell, by name.
2020-12-10 11:49:53 -05:00
Tim Edwards 1c82265244 Several enhancements: (1) Added command option "gds no_duplicates"
to allow a "gds read" command to ignore cells in the GDS which already
exist in memory.  This allows magic to be "pre-seeded" with specific
views of cells in the GDS.  Default is false, which is backwards-
compatble behavior.  (2) Changed the behavior of the the way the use
path is written to and read from a .mag file, checking the path prefix
against Tcl variables PDK_PATH, PDKPATH, PDK_ROOT, and PDKROOT, and
replacing any such leading path component with the variable name.
On reading a .mag file, any variable name at the start of the path
that matches a Tcl variable will be substituted.
2020-12-04 16:56:51 -05:00
Tim Edwards f343863ce3 Corrected two annoying errors: (1) SPICE netlist output subcircuits
could have multiple ports of the same name.  This problem had been
worked over before, but there was an indpendent mechanism producing
the same result for a completely different reason, caused by subcells
being much larger than the cookie-cutter extraction method's extraction
regions.  Solved by tracking port names in a hash table and preventing
re-use.  (2) ext2spice was producing "no such node" errors;  like (1)
this had been previously worked on, and like (1) this mechanism was
independent.  Problem came from not passing -1 to extHierSubstrate for
the non-arrayed dimension of a 1-dimensional array.  Also:  Removed
the word "fatal" from extraction error reporting, as nearly all
extraction errors are entirely benign.  This should clear up confusion
among alarmed end-users.
2020-11-24 15:30:49 -05:00
Tim Edwards b9f9f73c9b "Partly" corrected an issue in GDS read: The cd_client record is
used both for counting cells during GDS write and for saving
geometry data from the "copyup" operator during GDS read.  The write
routine does not clear the client record, and the read routine was
checking if the cd_client value was default.  Corrected the resulting
crash condition by resetting cd_client before GDS reads.  However, the
underlying problem is that the GDS read is reading data into a cell
that already exists in the database, and is not handling it robustly
by renaming the existing cell.  So this should be revisited.
2020-11-20 19:56:41 -05:00
Tim Edwards 0608784a18 Added an option to "findlabel", a 3rd argument which is the
occurrence of the label to place the box on.  This can be used with
"findlabel -glob <name>" to get a list of labels and determine the
length of the list, and then iterate through each occurrance of the
label in the edit cell.
2020-11-20 10:10:32 -05:00
Tim Edwards 9931244e1e Corrected what appears to be a long-standing error in the "extract
unique" code.  It was using DBEraseLabelsByContent() which would
erase all matching labels, and could potentially erase labels that
were still remaining on the list being processed, causing a segfault.
Also corrected minor errors identified by valgrind during debugging
the above-referenced problem.
2020-11-03 12:17:16 -05:00
Tim Edwards 06ab6b3a8a Made a change to the way that the parameterized cells are handled.
Instead of a 6-character suffix generated randomly, the 6-character
suffix is generated by a hash algorithm from the device parameters.
If the cell parameters are changed, then the cell itself changes.
If the instance name was default (derived from the cell name) then
the instance name changes accordingly.  The result is that there
cannot be two (auto-)generated cells with the same parameters but
with different cell names.
2020-10-30 11:20:19 -04:00
Tim Edwards c0015efbe0 Added experimental "calma addendum" option to output only references
to readonly cells but not the readonly cells themselves when writing
a GDS library.
2020-10-13 09:47:54 -04:00
Tim Edwards 581ad6041b Added new command option "box remove" that removes the cursor box
from the layout window.  The main reason for this is to keep the
box out of the image when doing "plot svg".  The "plot" command was
also modified to always do a plot of the entire cell in the active
layout window if the box is not present.
2020-10-08 13:50:14 -04:00
Tim Edwards c86d3ebb60 Another update that properly deals with the "port" command for
limiting search to non-port labels or to port labels only, depending
on the command option (which was previously not implemented properly).
2020-10-07 16:07:36 -04:00
Tim Edwards 076ee09e2e Added two new command options: "select bbox", which returns the
bounding box of the selection (somewhat unuseful, especially as the
result gets absorbed by the tag callback), and "box select", which
sets the cursor box to the bounding box of the selection (much more
useful).  Also corrected the "port" command so that the command
"port make" will search only for non-port labels.
2020-10-07 15:37:31 -04:00
Tim Edwards aac2c06dfd Corrected a problem with both the "port" command and the "lef read"
command when annotating an existing layout from a LEF database, if
there is a port in the layout that is shadowed by a label with the
same name that is not a port.
2020-09-25 22:39:50 -04:00
Tim Edwards f4b1518825 Changed the "port renumber" command option to sort ports by case-
insensitive alphabetical order instead of case-sensitive.
2020-09-02 09:20:09 -04:00
Tim Edwards 9c1c365a5e Added new command options "port first" and "port next" to make it
easier to scan through a cell's ports.  Used that capability in the
"readspice" script to handle case sensitivity problems, and to find
labels that are not ports and force them to be ports to match the
reference netlist.
2020-09-01 17:16:22 -04:00
Tim Edwards 917d7590d3 Implemented a string truncation with ellipsis for the output to the
caption line in the GUI window, which was causing problems with
long filenames overrunning the string array dedicated to the caption
line.  Thanks to Sylvain Munaut for the patch.
2020-07-27 12:10:08 -04:00
Tim Edwards 807c33139d Extended the "port" command with the option "renumber", which
forces all ports in a cell to be reordered in alphabetical order,
which ensures that the output of "extract" is always the same
(apart from coupling capacitance, which still ends up in randomized
order due to the use of hashing based on memory address followed
by iterating through the hash table).
2020-07-26 16:25:25 -04:00
Tim Edwards 838c9b840d Added a "calma library" command option, to generate a GDS library
from the subcircuits of a top-level layout without also writing the
top level.
2020-07-16 08:55:46 -04:00
Tim Edwards fc9ecd2c9b Corrected a problem with an uninitialized entry in ExtCurStyle that
could cause serious errors on systems that do not auto-zero allocated
memory.  Also:  Fixed an error introduced by a recent commit to allocate
character memory for efReadLine() which frees the memory before reading
a .res.ext file, causing a crash when using "ext2spice" with the
"extresist on" option.
2020-06-05 12:46:46 -04:00
Tim Edwards 15f1c82bc9 Added two new features: (1) Default substrate name: Added an
optional name field to the "substrate" line in the extract section
of the techfile.  This is the default name of the substrate if not
connected to anything labeled.  It may use a Tcl variable (preferred).
(2) Added command option "instance orientation [-def]" that returns
the orientation of the named or selected instance.  The -def option
returns the orientation using DEF naming convention;  otherwise, the
naming used with "getcell" is generated.
2020-06-01 16:49:59 -04:00
Tim Edwards 336a7aa209 Added missing close-bracket in the readspice script, and corrected
a diagnostic error output in the port command.
2020-05-29 17:13:38 -04:00