Commit Graph

44 Commits

Author SHA1 Message Date
Darryl L. Miles 3c9987f460 CmdFI.c: CmdGoto() correct printf output
non-tktcl build check
2025-10-04 20:50:31 -04:00
Darryl L. Miles c8fe30398b database: DBTechInitPlane() consumer (DBPlaneLongNameTbl constify) 2025-10-04 20:50:31 -04:00
Darryl L. Miles df7b9079bd CmdFindLabel: fix off-by-one error with: findlabel -glob name
Thanks @d-m-bailey Mitch Bailey for reporting
2025-10-04 20:50:31 -04:00
Darryl L. Miles b694827bcb feat: flush [-noprompt], option support 2025-01-07 13:58:45 -05:00
Darryl L. Miles cfdd50aa63 Revert "commands/CmdFI.c: added CmdFlush_NoConfirm option to disable flush prompt"
This reverts commit 772bfe2f71.

See #341
2025-01-07 13:58:45 -05:00
Darryl L. Miles 0376430702 command: use 'const' with readonly data
This then required a cascade of function APIs to also now receive
const arguments.

This reduces the .data segment use of this module.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 5c410e9dcb command: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles b8dae95515 Lookup() constify call-site
extflat/EFantenna.c: Lookup() constify call-site
drc/DRCtech.c: Lookup() constify call-site
dbwind/DBWelement.c: Lookup() constify call-site
database/DBtpaint.c: Lookup() constify call-site
commands/CmdTZ.c: Lookup() constify call-site
commands/CmdRS.c: Lookup() constify call-site
commands/CmdLQ.c: Lookup() constify call-site
commands/CmdFI.c: Lookup() constify call-site
commands/CmdE.c: Lookup() constify call-site
commands/CmdCD.c: Lookup() constify call-site
commands/CmdAB.c: Lookup() constify call-site
cmwind/CMWcmmnds.c: Lookup() constify call-site
2024-12-26 15:20:58 -05:00
Darryl L. Miles 56139b48eb K&R commands/*.c: bulk forward reference function prototype conversion
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 13:13:13 -05:00
Darryl L. Miles b3d4ab7980 K&R commands/*.c: bulk function implementation conversion
Argument order and type declaration mismatches:

Label *
portFindLabel(editDef, port, unique, nonEdit)
    CellDef *editDef;
    bool unique;
    bool port;         // If TRUE, only look for labels that are ports
    bool *nonEdit;     // TRUE if label is not in the edit cell

This warrants inspection at call site CmdLQ.c:1712 as both types are bool
is it not so straightforward to check.

It looks like when PORT_MAKE is the option 'port make [index] [dir...]'
  port=FALSE is this the correct intention ?  This looks ok in that
 we're searching for labels to make (upgrade) into ports.
Where as all other 'port ....' commands are operating on items that are
 already ports, and ignoring labels.
So the K&R argument name order is also how the call-sites are using it.

void
cmdStatsHier(parent, nuses, child)
    CellDef *parent, *child;
    int nuses;

This was checked and found ok as callback to ../database/DBcount.c
DBTreeCountPaint(... hiercount, ...)

Due to this not-obvious K&R style also being used in the documentation
this was changed as well (in another commit0.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 13:13:13 -05:00
Carsten Wulff 772bfe2f71 commands/CmdFI.c: added CmdFlush_NoConfirm option to disable flush prompt 2024-12-26 12:49:33 -05:00
Darryl L. Miles 6cdb9ad167 36 x warning: suggest parentheses around assignment used as truth value
bpMain.c:265:11: warning: suggest parentheses around assignment used as truth value
CmdSubrs.c:413:12: warning: suggest parentheses around assignment used as truth value
CmdSubrs.c:759:13: warning: suggest parentheses around assignment used as truth value
CmdFI.c:1600:12: warning: suggest parentheses around assignment used as truth value
DBcell.c:109:12: warning: suggest parentheses around assignment used as truth value
DBcellname.c:2512:9: warning: suggest parentheses around assignment used as truth value
DBcellsrch.c:95:12: warning: suggest parentheses around assignment used as truth value
DBio.c:3998:9: warning: suggest parentheses around assignment used as truth value
DBlabel2.c:228:9: warning: suggest parentheses around assignment used as truth value
DBWelement.c:195:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:197:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:295:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:297:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:637:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:639:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:679:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:681:13: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1219:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1368:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1471:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1543:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1676:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1772:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1919:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2099:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2324:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2713:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2830:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2944:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3097:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3144:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3181:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3215:9: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3227:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3261:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3459:17: warning: suggest parentheses around assignment used as truth value

GCC14 -Wall cleanup series [-Wparentheses]
2024-10-09 21:12:55 -04:00
Tim Edwards 6b5bd149fc Corrected an issue with "flatten -doinplace" with no cell name
argument, which is supposed to flatten all selected instances.
After flattening, instead of deleting the instance from the
cell, it deleted the instance from the selection, leaving the
one in the cell.
2023-07-28 15:25:42 -04:00
Tim Edwards 8ab5d465e9 Removed an unused variable declaration. 2023-03-25 15:53:32 -04:00
Tim Edwards 7b9809e567 Fixed the "flatten" command so that "-dotoplabels" works as advertised,
and doesn't crash magic.
2023-03-25 15:06:25 -04:00
Tim Edwards 6cefbd13f1 Expanded the method for "flatten in place" to include the more
natural flattening from a selection.  That is, instead of
specifying "flatten -doinplace <cell>", you can select some
number of instances and just do "flatten -doinplace".
2022-12-22 14:53:24 -05:00
Tim Edwards 83e17706fe Added handling of mask-hints properties to the flatten-in-place
method to ensure that mask hint geometry is retained when a
cell instance is flattened into the parent cell.
2022-12-22 11:27:37 -05:00
Tim Edwards be40825e9a Corrected the "flatten in place" command to force a redraw after
flattening, since the appearance of the layout will change even
though there are no physical changes.  Finally got around to
debugging and correcting the input mask-hints, which can
preserve vendor GDS by marking areas where the vendor GDS differs
from magic's automatically generated output (the method was
almost correct and only needed an input scale factor change).
2022-12-19 16:05:38 -05:00
Tim Edwards a0f502501e Corrected the method of "flatten in place" from the previous
commit to prevent port labels from being copied up from the
flattened cell into the parent, and prefixing the instance
name to text in the instance top level so that there will be
no port or label collisions in the parent cell after flattening
the child cell in place.  Also:  Changed "extract dolabelcheck"
to be the default setting.
2022-12-16 12:03:38 -05:00
Tim Edwards e5813f51fa Added a new option "-doinplace" for the "flatten" command. This
should have been done a long time ago!  Allows an instance to be
flattened in place inside a cell def, which otherwise requires
a complicated set of commands to do.  Also:  Modified the polygon
handling routine from the previous commit so that it correctly
removes the polygon cell defs after flattening them into the
parent cell.
2022-12-14 12:44:30 -05:00
Alessandro De Laurenzis b306a39560 Compatibility with C99 standard
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
2022-10-29 06:07:46 +02:00
Tim Edwards eecdc3c642 Added a "flatten -doproperty" command option that allows selective
flattening based on cells which have a property "flatten".  Also:
Modified the DEF read and write to convert DIEAREA into a
FIXED_BBOX property.  This solves issues with placing of components
from DEF, when those components may not have have come from place &
route and may not have P&R bounding boxes.  Also:  Fixed the
documentation for the "dump" command, which was missing the optional
orientation in the description.
2022-10-15 11:33:59 -04:00
Tim Edwards 1178db42c6 Modified the "flatten" command so that flattened labels use an
alternative separator "." instead of "/".  This prevents other
routines that expect "/" to indicate a true hierarchy from treating
the label as hierarchical instead of flat, which should be the
correct handling for a flattened cell.
2022-09-08 18:05:44 -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 9635f10c5a Removed a badly implemented double-loop from the timestamp mismatch
code.
2019-08-02 14:50:32 -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 088fc759c4 Set of changes updating version 8.2 to the level of 8.1, since 8.2
development had been halted since it was first created back in April.
Version 8.2 is now the official development version, with the first
development push to create a Cairo graphics interface.
2017-08-01 22:14:42 -04:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00