Commit Graph

257 Commits

Author SHA1 Message Date
mrg 278194ae96 Fix bugs in port first, next commands.
Previous commits changed the port IDs to an integer rather than a
bitfield. However, the first and next commands were utilizing that
a -1 became a large positive integer when masked. This resulted in
the min port operations failing. Added a default comparison with -1
to fix the problem.
2022-06-13 13:05:57 -07:00
Tim Edwards c001de3d9d (1) Corrected an error in generating GDS_FILE properties when
reading GDS files, caused by an unneeded change to pass both
the "original" filename and the actual filename when handling
compressed files---The original filename is unneeded.
(2) Implemented several new methods for parasitic extraction.  The
first is an option offset value to apply to sidewall calculations.
This handles issues where actual wire separation is different
from drawn wire separation, which can be significant for the
1/d calculation of sidewall coupling.  The second method is to
use the recently-added fringe halo to compute the coupling of the
fringe capacitance to nearby wires.  Prior to this change, all
fringe capacitance was applied to surfaces directly under a wire
edge as if the fringe capacitance did not extend outward from the
edge.  Now the capacitance is properly pro-rated for the position
of any overlapped shape inside the fringing field.  Finally, the
third method added is a new search algorithm for finding the
nearest shapes along the length of a boundary.  This is used for
sidewall coupling and fringe shielding, where the nearest shape
dominates the coupling, and any shapes behind are shielded and
may (to first order) be ignored.  Previously, the entire halo
was searched without regard to shapes shielding other shapes
behind, and a recent correction added an ad-hoc search for
blocking shapes that was inefficient and not always correct.
The new method is both efficient and accurate.
2022-05-28 10:33:21 -04:00
Tim Edwards 371018ae4b Implemented native gzip compression/decompression using zlib routines.
Compression levels of the output can be controlled with the "gds
compress [<value>]" command, where <value> 0 (default) is uncompressed
output, 6 is "normal" gzip compression, and 9 is maximum compression.
2022-05-10 09:19:39 -04:00
Tim Edwards 6e0768ebd4 Removed the "-k" option from "gunzip", which is not only redundant
with "-c" but is unsupported on some OS versions of gunzip.
2022-05-09 15:27:51 -04:00
Tim Edwards da49a50d8e Extended the code from the previous commit to handle automatically
pointing GDS_FILE to a compressed filename when using "gds readonly
true" on a compressed file.  The start and end pointers still point
to data bounds in the uncompressed file.
2022-05-05 18:04:41 -04:00
Tim Edwards 85d8ad6622 Added the capability to handle compressed GDS files through the use
of systems calls to "gzip" and "gunzip".  A compressed GDS file can
be made simply by doing "gds write <name>.gds.gz", and can be read
simply by doing "gds read <name>.gds.gz".  Names of compressed files
can be put in the GDS_FILE property of a cell.
2022-05-05 17:40:56 -04:00
Tim Edwards 99384a63c7 Still recovering from unintended consequences of setting EditCellUse
to NULL for a read-only view. . .  Changed the command "what" so that
it will not fail on a non-edit cell.  There are likely a few other
commands that should not fail on non-edit cells because they do not
alter anything.
2022-05-03 18:03:27 -04:00
Tim Edwards 4000dd758f Made a correction to the command option "contact erase" which was
not properly handling stacked contacts, failing to erase a contact
out of the middle of a stack.
2022-05-02 14:38:46 -04:00
Tim Edwards fe2eb6d390 Modified the file locking behavior so that the command "locking" is
recognized as a valid command when file locking has been disabled as
a compile-time option.  The command then generates an error on
"locking enable" but simply ignores the command "locking disable".
2022-04-25 13:23:29 -04:00
Tim Edwards 9402b0dcdd Added a new command option "contact erase". This provides a way to
remove contact cuts from a layout without affecting the surrounding
metals, which is something that the "erase" command does not do.
2022-04-07 11:10:24 -04:00
Tim Edwards 44df4fc125 Corrected another instance where running a command on a non-
writeable cell causes magic to crash.
2022-04-06 08:38:25 -04:00
Tim Edwards a09fa78d2c Found another issue with the substrate extraction, caused by the
fact that "extract all" does not enumerate cells from bottom up
as I had assumed---The order is roughly bottom-to-top, but cells
re-used in different places in the hierarchy could end up called
before one or more of their own subcells is extracted.  Since
this conflicted with the preparation of the substrate in each
extracted subcircuit, I changed the method to enumerate cells so
that it is properly bottom-to-top.  Also, methods were added to
"extract" (incremental), "extract cell", and "extract parents"
to ensure that the substrate is prepared on all subcells before
extraction.
2022-04-05 21:33:15 -04:00
Tim Edwards cfb81101ec Added command option "-annotate" for "def read" that allows nets
to be annotated from a DEF file.  This is particularly useful if
"def read" has been used without the "-labels" option, and the
labels are needed at some point.
2022-03-30 13:02:12 -04:00
Tim Edwards 0c584f9e77 Modified the configure scripts and makefile per Proppy's comments
in github issue #149.  This causes magic to no longer write log files
for "make" and "make install" but will properly exit with a non-zero
return code on any error during compile.

Also:  Corrected the command "tech drc surround <type1> <type2>" so
that it now returns the correct value when <type1> and <type2> are in
the same plane.  Added new command "tech drc directional <type1> <type2>"
which works the same way as "tech drc surround" except for directional
surround rules.  Used this to generate vias from "def write" with the
correct metal surround amounts included in the via definiton.  The
route analysis then ignores tile slivers that make up the surrounding
material around contacts.  Also implemented a method that handles
routes that are made of multiple thin tiles due to the maximum horizontal
stripes rule.  Now magic handles "def write" well except for not dealing
with non-minimum-width routes unless they're specifically called out as
"special" nets.
2022-03-29 16:52:01 -04:00
Tim Edwards f8390b78f8 Tackling a section of code with poor performance in extraction.
The extSubtree() routine cuts a layout into squares and extracts
each separately, checking for subcell interactions.  In each
square it parses all labels looking for unconnected ones.  This
section of code not only parses all labels M x N times, but it
then marks interaction areas where there may be none, forcing
additional unnecessary processing.  This commit makes the first
quick optimization, which is to change the return value of
DRCFindInteractions() from boolean to integer, allowing it to
return a value indicating that there are no subcells in the
area.  This prevents the loop through labels from happening in
cases where there can never be interactions.  More to come.
2022-02-20 17:36:49 -05:00
Park-Hyung-Joo 31639f61fc fix error in transform part in cmdDumpParseArgs 2022-02-16 13:26:40 -05:00
Johan Euphrosine 4677aae8d6 commands/CmdLQ: fix typo 2022-02-15 14:09:56 -05:00
Tim Edwards 6ecd077ab4 Restored compiling of the non-Tcl/Tk version of magic. This has
traditionally been kept for backwards compatibility.  However, the
operation of "ext2spice" and "ext2sim" as separate programs has
become extremely difficult to maintain, and so it has been dropped
in favor of folding both into the program as commands, as was done
a long time ago in the Tcl/Tk version.
2022-02-08 16:12:07 -05:00
Tim Edwards 62c8af719c Modified the "box" command to run a check on the specified box values
and raise an error if the values are outside the range (MINFINITY,
INFINITY) used by magic's layout planes.
2022-01-27 16:57:23 -05:00
Tim Edwards e1aedc6f41 Decided that a different approach needed to be taken for having
timestamps that are fixed, since the timestamp update routine is
called from too many places, too many times.  Instead created a
new cell definition flag indicating a fixed timestamp, which can
be set by "cellname timestamp" for an individual cell, or with
"gds datestamp" for cells read from a GDS file.
2022-01-22 11:18:32 -05:00
Tim Edwards 3065d4cc4b After much pain and suffering, finally tracked down all the places that
the timestamp is updated after reading in CIF or GDS, and managed to
get the timestamp dirty flag to remain clear after reading when
"gds datestamp" is used.  This includes a modification of the timestamp
update routine that only updates timestamps on a single file if only a
single file is being written.
2022-01-21 22:17:54 -05:00
Tim Edwards 5dd0c97dce Modified the "writeall" command to (1) raise an error message when
"writeall force <cell>" is used but <cell> doesn't exist, and (2)
to add options "writeall modified" and "writeall noupdate" (which
may or may not be useful).
2022-01-21 17:43:04 -05:00
Tim Edwards 93c4503fa8 Refined the new "gds maskhints" command option for GDS input from
yesterday's commit to allow the syntax "gds maskhints <types>", in
which mask hints can be restricted to a specific list of layers
rather than all layers which define mask hints in the cifoutput
rule.
2022-01-21 14:48:59 -05:00
Tim Edwards 09577b5636 Updated all of the documentation by copying back from the website.
The website documentation now points to these contents in a clone
of the repository on opencircuitdesign.com, so all future edits of
the command-line documentation will be made directly to the git
repository.  Also:  Changed the precision of box values printed in
microns from 2 to 3 digits after the decimal place, so that 5 nanometer
grids do not get values clipped in the output.
2022-01-21 10:44:13 -05:00
Tim Edwards 5629c2a6cd Changed the "gds nodatestamp" option to "gds datestamp" and added
"gds datestamp <value>" as an option to force a specific datestamp
on the GDS output.  This is a third option beyond the previous two
which were either to use the current time or to write zero.  The
new option allows an entire library to get a common timestamp, for
example, related to a PDK version number.  The "gds nodatestamp"
option has been retained for backwards compatibility.
2022-01-21 10:26:29 -05:00
Tim Edwards c2755a061f First cut at a method to automatically generate mask hint properties
in a cell to account for the difference between what's in an input
GDS file and what magic would write out itself from the processed
data.  This potentially allows library cells to be read in that
will generate the equivalent mask data as output without resorting
to using GDS file references as properties.  The method is activated
with the new command option "gds maskhints on" and the default is
off.
2022-01-20 21:50:13 -05:00
Tim Edwards 453d276f20 Cleaned up a bit of confusing diagnostic output when reading GDS.
If cells are instanced before being defined, causing the GDS parser
to rewind the cell from the top, then the "already defined" error
messages will be suppressed, since it is to be expected that cells
will be seen twice (and ignored the 2nd time).  When rewinding, an
output message is issued so that it is clear that the file contains
instances that are used before they are defined, and recommends the
"gds ordering on" setting.  Also:  Fixed the "gds ordering" command
code so that the command with no third argument returns the state
of the "gds ordering" setting instead of generating a parser error.
2022-01-14 11:07:08 -05:00
Tim Edwards b68744a944 Made a change to basic extraction to avoid generating an extra
node representing the global substrate on cells that are abstract
views.  Corrected a typecasting issue in ext2spice.c that throws
a compiler warning.  Added another check for a cell being editable
when painting, which is a case that was not covered by the
previous code change to address the same issue.
2022-01-13 12:56:20 -05:00
Anton Blanchard 73fee3e5fd Add missing types in function prototypes
It would be nice to convert the codebase from K&R to ANSI function
prototypes, but for now just clean up the warnings.
2022-01-10 14:04:37 -05:00
Tim Edwards 1fceef6acd Corrected the last commit's problem with file locking, which is that
there was no distinction between a locked file and a new cell
(initial state) before writing to disk.  This prevents any new cell
from being saved!  Also:  Revised the behavior of the "select short"
search, but this still has issues with long run-times on complex
layouts, so this is an ongoing effort.
2022-01-03 16:00:31 -05:00
Tim Edwards 1bb4cb92ea Played around with the file locking and discovered to my chagrin that
whenever a process writes a cell to disk, it immediately releases the
file lock it had on that cell, which is clearly not the intent of file
locking.  Fixed this issue.  On a related topic, revised the "cellname
writeable" command so that it can make a cell editable even if the cell
has an advisory lock and cannot be made writeable.  Perhaps there should
be a clearer distinction here between "writeable" and "editable".  Also:
Reconsidered the previous commit, which removed the "--disable-locking"
from the configuration options.  Because some operating systems may not
implement fnctl()-based file locking (Cygwin, for one, apparently doesn't),
it is still useful to be able to completely remove the function, in case
the operating system will fail to recognize the fnctl() values in the
code.  Now, file locking behavior can be permanently removed through the
configuration option, or temporarily disabled from the command line.
2022-01-01 16:53:46 -05:00
Tim Edwards e4d1c29112 Reworked the file locking option as a command instead of as a
compile-time option.  The behavior can now be controlled from
within the program with "locking disable" or "locking enable".
2022-01-01 14:28:59 -05:00
Brad Smith 10fa302bba Correct & has lower precedence than parentheses warnings.
CmdRS.c:1269:22: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses]
DRCtech.c:2573:16: warning: & has lower precedence than !=; != will be evaluated first [-Wparentheses]
2021-12-30 04:35:03 -05:00
Tim Edwards 43bb499bcf Corrected an issue with the limited bitfield dedicated to port numbers;
this limited ports to 16384, which seemed reasonable at the time.
However, the sky130_sram_macro layouts connect power and ground in a
way that when coupled with "extract unique" can generate tens of
thousands of ports and overrun the bit field, showing that automation
can do the unexpected.  The solution was to split out the port number
from the label record as its own 32-bit value.
2021-12-12 22:09:31 -05:00
Tim Edwards 552d6de0f7 Modification to prevent crashing on an attempt to do an area erase on
a read-only layout.
2021-12-07 14:25:50 -05:00
Tim Edwards bfdf1227a7 Modified the "extract unique" behavior so that it treats "soft"
connections through the substrate as the same node, and so will
not force different nodes names on the soft connection to be
unique.  This should probably be selectable behavior.  However, as
written, the "extract" command will always merge soft connections,
so giving them unique names just causes problems with "extract".
2021-12-04 15:04:01 -05:00
Tim Edwards 8957d4b947 Slightly modified various use cases of "cellname" so that they
behave as one would expect;  e.g., "cellname self" returns the name
of the currently edited cell if nothing is selected;  "cellname
rename <name>" renames the currently edited cell to <name>.
Modified the "extract" command so that it will not extract a cell
named "(UNNAMED)" but will insist that the cell must be given a
proper name, much like the "writeall" command does.
2021-11-25 12:40:51 -05:00
Tim Edwards e670dd9720 Corrected the error in which "splitpaint" and "spliterase" are
incorrectly applied to locked layers, as reported by Mark Martin
in issue #95 on github.
2021-11-24 12:01:45 -05:00
Tim Edwards 6b72a51b17 Fixed a segfault condition if doing "splitpaint" on a zero-area
rectangle.  Likewise, this also fixes an unexpected result when
doing "spliterase" on a zero-area rectangle (which does not cause
a segfault, but is not what one would want magic to do).
2021-11-24 10:00:15 -05:00
Tim Edwards bee0039e43 More updates to prevent magic from crashing when commands are run
on non-edit cells (this time, "erase").
2021-11-12 13:57:26 -05:00
Tim Edwards 2f7813094b Implemented glob-style matching for label selection. Introduces
an optional extra argument to the "select" command that can be used
to select labels by glob-style matching;  e.g., "select area labels
VSS*" or "select less area labels *_1".  This will help in managing
labels after flattening a standard cell design;  e.g., by using
"select less area labels */VDD".
2021-10-09 13:44:04 -04:00
Tim Edwards 537b1f057d Modified the generation of "equiv" statements in "extract" some more,
to eliminate all redundant names resulting from redundant labels.
Changed the behavior of "goto" so that it will find local names with
slashes, which are the result of using "flatten".  A hierarchical
search is done first, as before, but on failure to find a subcell
component, the local cell is searched for the verbatim name.
2021-10-08 10:58:10 -04:00
Tim Edwards 4fae7a1a2b One more correction to limit, by default, the generation of "equiv"
statements in the .ext file output to those that mark a port as
equivalent to the node name used elsewhere in the file.  This
limits unnecessary output of "equiv" statements that can bog down
ext2spice and other commands that use the .ext file contents.
2021-10-07 21:36:10 -04:00
Tim Edwards 96b7c20c17 Added option "notopports" to "extract unique". The option
behaves like "extract unique all" on all cells below the topmost
level of hierarchy, and "extract unique noports" on the top
level.
2021-09-09 15:47:48 -04:00
Tim Edwards e50dab7e52 Modified the way that ToolGetEditBox() works so that it does not
require that an edit cell be defined.  This stops a lot of commands
from failing on non-writeable cells.  There really should not be a
concept of "non-editable" cells at all, just non-writeable ones.
2021-08-04 12:05:21 -04:00
Tim Edwards 07e366ad8a Extended the "cellname rename" command to add an option "-force"
that can be used to force renaming of a read-only cell.  The
action revokes the read-only status of the cell and removes any
GDS filename and pointers from the cell's properties.  This can be
used to swap out a library cell in a layout for a custom version,
by first forcing a rename of the cell, and then resetting the
filepath of the cell and flushing.
2021-07-29 17:34:39 -04:00
Tim Edwards b0ed7f09a9 Modified the "flatten" command so that when used with "-dobox", it
is not necessary that the target cell not exist.  That allows a
layout to be flattened into a destination in pieces.  Also found
that the "flatten" command never frees memory for the CellUse it
creates for the copy, so fixed that as well.
2021-06-23 17:41:32 -04:00
Tim Edwards 8d8fe2fe55 One correction to the last commit, otherwise segfaults are
essentially guaranteed. . .
2021-05-23 21:26:02 -04:00
Tim Edwards 82fada3af6 Corrected two somewhat related errors. When "getcell" finds a
name conflict and renames a cell, the name was not pointing to
the new name and immediately caused a crash condition.  However,
it got to that point by believing that cell "path/x" and "path/x.mag"
were different files.  The name was stripped of the extension but
the full file path was not, causing the confusion.
2021-05-23 20:59:00 -04:00
Tim Edwards e6f17735b8 Modified the "cmdDumpParseArgs()" routine (used, for instance, by
the "getcell" command) so that the "parent" and "child" arguments
will accept the standard syntax for coordinates used by most other
commands (will accept SI units or trailing suffix i/l for internal
or lambda units).
2021-05-23 14:09:50 -04:00
Tim Edwards be19fda504 Added a "gds unique" option that behaves like the default CIF behavior,
in which if a cell is read from GDS that has the same name as a cell
in memory, then the cell in memory is renamed to keep all cell names
unique in the database.
2021-04-27 13:07:27 -04:00
Tim Edwards 538d7201e1 Modified the behavior of "extract" so that it does not try to check
for sticky labels making connections through the hierarchy.  This
is only needed for some annoying layouts that put point-size labels
with no connecting geometry in cells, and causes magic to spent
excessive amounts of time searching through labels for any layout
that has lots of labels.
2021-04-26 12:19:33 -04:00
Tim Edwards 56c0620417 Properly handled the yes/no argument to "cellname writeable" so that
like other commands, it accepts the usual assortment of true/false,
yes/no, 1/0.
2021-04-22 15:39:32 -04:00
Tim Edwards 521baa91d9 Modified the "gds write" command so that it issues a strongly-
worded warning if an abstract cell view is written to GDS.
Corrected the "cellname ... writeable" command to allow an
overrride of the read-only status of a cell.  That change had
been made before but apparently got reverted by the recent
rollback.
2021-04-19 12:53:32 -04:00
Tim Edwards a9fc99174a Revert "Removed the stupid restriction that "cellname readwrite" won't work"
This reverts commit 8b9c47c3ef.

Reverting back to the state before messing with the substrate extraction
code.  All of the substrate extraction code is now in a separate branch.
2021-04-12 13:32:16 -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 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
Tim Edwards 483f15360a Added support for "PORT SHAPE" in LEF files. 2020-05-28 22:06:22 -04:00
Tim Edwards 28d8808c65 Corrected several improper uses of StrDup() that used the first
argument as a pointer but also set the same variable to the
return value.  This is ambiguous, because the behavior depends on
whether the value being set upon return is the original value or
the reallocated value.  The result is system-dependent behavior.
2020-05-28 17:09:03 -04:00
Tim Edwards 8165519a3c Additional correction to make the "port" command options "use", "class",
and "index" operate on all ports with the same name.
2020-05-28 12:30:28 -04:00
Tim Edwards 626a6355ae Added a Tcl scripted command "readspice" that can be used to read
SPICE subcircuit definitions from a netlist file and apply the port
order in the netlist to the port labels in the corresponding cell
or cells in the magic database.  Also:  Corrected an error in the
bloat-all code introduced in a recent commit that can cause a
segfault.
2020-05-28 11:46:57 -04:00
Tim Edwards 9382cc622c Changed the "feedback count" command to return the feedback count
as a Tcl int object instead of printing out a text message, per
the suggestion from Dan Moore.
2020-05-23 17:26:32 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 028612b70a Added extension to "gds flatten" command option to change the limit
of geometry primitives that triggers flattening (default 10).
2020-05-14 15:59:39 -04:00
Tim Edwards bcb8e9a081 Corrected typo in CmdCD.c for "count_total" when compiled without Tcl/Tk. 2020-04-18 15:49:23 -04:00
Tim Edwards ff0ba7f89d Merge branch 'master' into bplane
Conflicts:
	VERSION

Merged recent changes from master back into bplane, as the efficiency of
bplane for doing extraction on large layouts is unquestionably better.
Fixed the implementation of DBMoveCell() for bplane.  Corrected an error
in the bplane version of dbScaleCell() that enumerates cell uses but
does not free the list.
2020-03-22 14:07:25 -04:00
Tim Edwards c2bf9a8fb4 Added new command option "extract do local" to force all .ext files
to be written to the local directory instead of the directory where
the .mag file is located.
2020-03-21 20:57:11 -04:00
Tim Edwards 276bf1d78a Corrected a bad error from a few commits ago, probably 198, which
can deallocate the cell name and causes all sorts of unexpected and
unwanted behavior.
2020-03-21 12:40:35 -04:00
Tim Edwards 4a0ad45627 Added a "move" command option "move origin" which will move the
coordinate system origin to the specified (current) location.
This is a much more efficient method than selecting everything in
a layout and moving it, especially for very large layouts where
selection and moving becomes prohibitive.
2020-03-20 13:40:16 -04:00
Tim Edwards 1e4c020b1e Corrected an error in which the "save" command attempts to overwrite
an allocated Tcl argument, and can cause a crash for a filename of
sufficient length.
2020-03-19 09:20:50 -04:00
Tim Edwards be1c0d1368 Merge branch 'master' into bplane
Conflicts:
	VERSION
	calma/Depend
	cif/Depend
	cmwind/Depend
	commands/Depend
	database/Depend
	dbwind/Depend
	debug/Depend
	drc/Depend
	ext2sim/Depend
	ext2spice/Depend
	extflat/Depend
	extract/Depend
	garouter/Depend
	gcr/Depend
	graphics/Depend
	grouter/Depend
	irouter/Depend
	lef/Depend
	lisp/Depend
	mzrouter/Depend
	netmenu/Depend
	plot/Depend
	plow/Depend
	resis/Depend
	router/Depend
	select/Depend
	sim/Depend
	tcltk/Depend
	textio/Depend
	tiles/Depend
	utils/Depend
	windows/Depend
	wiring/Depend

Merged recent changes from master branch into bplane branch.  Testing the
bplane implementation which has about a 5x improvement in extraction times
for large layouts, which is significant enough to move ahead with the bplane
implementation;  however, the bplane implementation has not been thoroughly
vetted yet, so it will remain a branch until such time that it has been
validated.
2020-03-15 13:23:24 -04:00
Tim Edwards 80fa495103 Removed the Depend files, which were being tracked with .gitignore
pointing to Depend instead of */Depend.
2020-03-13 15:39:08 -04:00
Tim Edwards cd87b08b21 Merge branch 'master' into bplane
Conflicts:
	VERSION
	database/DBcellsrch.c
	database/DBconnect.c
	extract/ExtInter.c
	lef/Depend
	utils/Depend

Updated bplane branch with all changes to master since the bplane branch
was last modified.
2020-03-12 08:29:33 -04:00
Tim Edwards 7413d89da1 Corrected the "lef writeall" command to add the "-hide" option, as
is available for "lef write".  This was inadvertently omitted.
2020-03-05 13:14:47 -05:00
Tim Edwards b62efea43d Corrected the last commit for fixing the "drc count" command option,
which had been changed a few months back to remove the individual
cell count and only list the top level cell.  The behavior has been
changed a bit so that "list" returns values for the top level cell
only, but "listall" returns a complete list.  "drc list count total"
gives the DRC count for the top cell, but "drc listall count total"
gives the DRC count for everything (probably not very useful).
Also:  Implemented a behavior by request to automatically removed
the (UNNAMED) cell whenever a new cell is loaded and the (UNNAMED)
cell has not been modified.
2020-02-25 09:52:06 -05:00
Tim Edwards fba66b7dff Reverted the "drc count" command to the way it was. There is more
to be investigated here.  I am no longer sure why I removed the
cell search from DRC count, but it appears that the cell search is
non-functional, and it should be determined why.  There is no
particular reason not to have a DRC count search.  It could be
implemented such that "list" vs. "listall" counts the top cell vs.
all cells.  First it must be determined why there are no subcell
counts.
2020-02-24 21:47:44 -05:00
Tim Edwards 897a8064ba Restored the behavior of selecting and displaying labels that are
down in the hierarchy when selecting a region or net, but with a
(hopefully very useful) twist:  To avoid the problem of ambiguous
labels in subcells, the subcell name hierarchy is generated in
the same way as is done when flattening a cell, with the instance
name prepended.  For example, when selecting a net in a standard
cell design, a terminal would highlight the name "OR2X1_1/B"
instead of just "B".
2020-02-14 08:48:47 -05:00
Tim Edwards 82e33248f2 Corrected dereferencing of cell dependencies, which was being applied
only at the time of running the command "load".  But cells are generally
loaded only on an as-needed basis, so the dereferencing option must be
saved as a flag in the cell and honored whenever its subcells are expanded
or otherwise read at a later time.
2020-01-02 10:13:04 -05:00
Tim Edwards e1783a42a9 Added a "DRC manager" window option. This allows DRC errors to be
categorized by error type and scrolled through conveniently.  However,
it needs work dealing with finding the actual error bounds.  The
"DRC count" counts tiles, which is tile-plane-geometry-specific, and
"DRC listall why" fractures errors both over tiles and over the square
areas that the interactive DRC splits the layout into, for performance.
The DRC error plane needs to be changed to hold different types for
each error class, so that errors can be scanned by boundary instead of
by tile (work to be done).
2019-11-15 10:26:04 -05:00
Tim Edwards 0eb3b1fe1c Corrected an error in ext2spice related to the recent modification to get
rid of redundant port entries in subcircuits.  There is still an outstanding
issue as to whether nodes and connections need to be recursively iterated
to the hierarchy bottom.  The current fix corrected the test case.  Also,
added a "-dereference" option to the "load" command to revert to the
original behavior of using only search paths from "addpath" when searching
for files to load.
2019-11-14 15:18:26 -05:00
Tim Edwards 71108a88b4 Corrected an error that prevented the "load" command from working
with the simultaneous use of "scaled" and one of the options
"-force" or "-nowindow", due to the use of a wrong index value.
2019-10-23 10:18:54 -04:00
Tim Edwards b493334c73 Preliminary changes to support extraction devices other than the original
simple FET device in extresist.  Also:  Extended the bloat-all CIF operator
again, allowing the trigger layer for the bloat operation to include both
CIF layers and magic layers (previously only magic layers were supported).
This extension is possible due to the previous extension allowing the
trigger layer and bloating layers to be on separate planes.  This operator
extension is useful for tagging geometry that is in the proximity of, but
not overlapping, geometry on another plane.
2019-10-17 16:21:56 -04:00
Tim Edwards 9635f10c5a Removed a badly implemented double-loop from the timestamp mismatch
code.
2019-08-02 14:50:32 -04:00
Tim Edwards 197c3f3448 Merge branch 'master' into bplane
Conflicts:
	commands/CmdCD.c
	database/DBcellsrch.c
	database/DBconnect.c
	database/DBio.c
	lef/lefRead.c
	select/selDisplay.c

Updated the bplane implementation with all recent updates (merged master).
2019-07-24 20:36:55 -04:00
Tim Edwards d08593997a Cleaned up an inconsistency with GDS read-in that generates
informational output that references a (non-existing) CIF file.
2019-07-23 08:45:42 -04:00
Tim Edwards c31b305848 Corrected the dependency list in the Makefile for "modules", which
should depend on database/database.h;  otherwise running distributed
make can start compiling modules before the database.h file is
created.
2019-07-14 12:07:38 -04:00
Tim Edwards 8f7db3942c Fixed the "writeall force" command, which was behaving exactly the
same as "writeall", meaning that "force" was not being honored and
only cells that were modified were being written, in either case.
2019-06-04 16:17:17 -04:00
Tim Edwards 8170dbe01f Additional corrections to the wiring for some code changes that
were made where contacts are placed when shifting up on metal
layer but not made for the reverse case.  Also corrected one
inconsistency with non-minimum width wires.
2019-06-04 12:13:47 -04:00
Tim Edwards e2dd5f5157 Corrected the wiring command (adjustment to recent change for
centering wires on grid lines when using a snap grid) so that
the wire width is maintained when switching from one layer to
another, when the wire width is larger than the minimum for the
route layer.
2019-05-16 09:52:59 -04:00
Tim Edwards 770a6f4a17 Updated the handling of fixed bounding boxes for abstract views
(once corrected in an experimental branch but never merged).  This
avoids changing the actual bounding box of the cell to match the
LEF bounding box, but defines a property instead and uses that
property for certain functions such as displaying the bounding box
outline or selecting the cell.  This avoids certain related errors
such as the failure to extract connections to areas outside of the
fixed bounding box.
2019-05-06 16:30:29 -04:00
Tim Edwards fc7249b04c Extended the "port" command to operate on labels in non-edit cells
as long as the command is not attempting to modify the port.
Attempts to modify ports in non-edit cells result in an error
message that is more helpful than the previous "Exactly one label
must be present..." text.
2019-05-03 10:13:06 -04:00
Tim Edwards b8bfaa5066 Corrected command option "select [more|less] cell <cellname>", which
was not recognizing the more|less option and therefore failing to
search for the instance <cellname>, rendering the command non-functional.
2019-05-03 09:14:25 -04:00
Tim Edwards 1d04f20f5d Moved new work on magic-8.4 (experimental merging of micromagic bplane structure
into magic-8.2) into the newly-reorganized git repo as branch "bplane".
2019-03-22 19:58:47 -04:00
Tim Edwards ded7dcb93f Corrected an error that causes run-time issues with compiling the
non-Tcl/Tk version, as the routine DRCBreak() is called but never
defined.
2018-12-28 10:29:18 -05:00
Tim Edwards 2914286921 Resolved a tricky issue with the crosshair drawing. The crosshair
routine was erasing and redrawing in one step, which ignored the
possibility of having to erase from one window and redraw in
another if the cursor moved focus from one window to another.
This led to crosshairs being improperly drawn and erased when
multiple windows were present, if the windows had different cells
loaded.
2018-10-17 10:30:55 -04:00
Tim Edwards f8b79133fb Corrected the "port makeall" command so that it actually works, and
since the edit box was undefined in the code, potentially this
fixes any number of random problems that might be seen with the
"port" command.  Also:  Modified the cell bounding box recalculation
so that it does not continually update a parent cell on every
addition of a child cell but only once for each child cell found.
This greatly reduces the time for GDS file input in the case of
large arrays of cells.
2018-09-13 21:09:38 -04:00
Tim Edwards e073394430 Applied another patch by Iain McNally that restores the obscure
function that was available in versions 7.1 and earlier that
allows the use of the command "erase errors" to remove DRC error
paint (only when the DRC checker is off, of course).
2018-08-20 22:43:34 -04:00
Tim Edwards 83da1988e6 Corrected CIF import for reading CIF area labels correctly when
the label causes a scale change.  Thanks to Iain McNally for the
patch.  Same correction as made to magic-8.1.
2018-08-20 22:13:16 -04:00
Tim Edwards 4fd3089cfc Corrected an error in which the selection definition may contain
invalid pointers to a cell that was deleted while it was selected.
Solution is to clear selections before deleting a cell.
2018-04-19 16:14:17 -04:00
Tim Edwards 3f7ab36416 Correction to cell versioning handling for the "getcell" command.
This correction allows a full path to be passed for the cellname
and will (correctly) break the path into cell name and path
components (previously was naming the cell with the full path).
To avoid name conflicts, the cell name gets modified if the path
cannot be resolved against an existing cell of the same name.
2018-04-04 10:35:18 -04:00
Tim Edwards 42ec70d4dc Re-implemented plow setup for the first time since about 2006,
enabling the "plow" command.  At this time, however, not all
rules are being implemented correctly given the numerous changes
to the DRC handling since the last time "plow" was working.  Fixes
are ongoing.
2018-04-01 14:40:10 -04:00
Tim Edwards aebabc0447 Corrected an error in writing out .mag files with property values
that are longer than the formerly-fixed array size 256.  This
conflicted with the recent addition of holding path data in
properties, where the path coordinates can be significantly
longer than the fixed array size.  Same change as made to magic
version 8.1.
2018-01-08 21:45:19 -05:00