Commit Graph

1974 Commits

Author SHA1 Message Date
Darryl L. Miles 97189f6219 irRoute.c: LayerInTouchingContact() pass by-pointer const TileTypeBitMask* instead of by-value
sizeof(TileTypeBitMask) == 32
2025-02-22 20:58:59 -05:00
Darryl L. Miles 90c03738ce ExtPerim.c: extEnumTilePerim() pass by-pointer const TileTypeBitMask* instead of by-value
sizeof(TileTypeBitMask) == 32
2025-02-22 20:58:59 -05:00
Darryl L. Miles e8d7888300 extract.h/EFVisit.h include database.h for TileTypeBitMask
This has a knock on effect of causing EFvisit.c to require database.h
to be defined BEFORE the EFint.h due to an identical copy of ArrayInfo
type being present in both files.

Maybe there should be database_arrayinfo.h ?  To remove the copy.
2025-02-22 20:58:59 -05:00
Tim Edwards 144c22f579 Added the ability to translate pointer-based "wire" commands from
interactive wiring into coordinate-based commands.  Added new
command extensions for "wire leg", "wire vertical", "wire type",
and "wire horizontal".  Modified the command logging such that
"wire show" (which does not modify layout) does not get logged,
which avoids unnecessary logging of mouse movement.
2025-02-22 17:06:06 -05:00
Tim Edwards c4a2a54cb7 Corrected a syntax error in the old (non-Tcl/Tk) grX11su1.c code
that was introduced with a slew of updates back in October, as
noticed and reported (with solution) by J. Schonberg.
2025-02-15 22:20:50 -05:00
Tim Edwards 09ff52cdc0 One additional fix which allows "gds write" to continue after a
cell is found to be missing, if "gds allow undefined" has been
set.
2025-02-15 13:49:14 -05:00
Tim Edwards 41d77558b7 Fixed an error in which using the command option "gds allow undefined"
will cause a segmentation fault.
2025-02-15 13:43:01 -05:00
Tim Edwards df84a36659 Added code to handle the case where GDS_FILE points to a filename
that has since been compressed and given a ".gz" extension.
Removed code that uses a system call to "gunzip" and "gzip" when
the target file is compressed, since the compression is handled
in the code.
2025-02-12 16:28:43 -05:00
Tim Edwards 38b3d53b5f Modified the behavior of "select area subcell" so that it no longer
requires that subcells be unexpanded in order to select them.  This
seems to be more in line with what one would expect from the
documented description of the "select area" command, and more in
line with common-sense expectations.
2025-02-09 14:51:40 -05:00
Tim Edwards cd80d38d52 Fixed a rather long-standing error, which is that when scaling of
"MASK_HINTS" was implemented, it was put into a routine that
scales all coordinate-related properties, including "FIXED_BBOX",
but the original code that scaled only "FIXED_BBOX" was never
removed, resulting in the bounding box getting incorrectly scaled
twice by any grid scaling.
2025-02-09 12:48:22 -05:00
Tim Edwards 619191c6dd Corrected a crash condition caused by yesterday's commit, if the
new CIF operator is used in a tech file.  Reworked yesterday's
commit to add more related operators, so there are now four new
ones (also renamed them):  interacting, noninteracting, overlapping,
and nonoverlapping.  "interacting" now means overlapping or touching;
so the four cases allow all variations of adjacency between the two
material types.
2025-02-05 14:49:32 -05:00
Tim Edwards a5653c8fca Added a new CIF operator "not-interact" which is complementary to
"interact", because it was trivially easy to implement and saves
processing vs. doing the same thing with two templayers and an
"and-not" operator.
2025-02-04 20:43:30 -05:00
Tim Edwards 21b810b375 Added a new CIF operator "interact" which enumerates disjoint
regions of a given type and retains only those regions which
interact with (overlap) another given type.  Both sets of types
can be either magic database types or CIF temp layers.  This will
allow the implementation of rules that were not previously
possible.
2025-02-04 17:21:26 -05:00
Tim Edwards 72368a3d13 Added a fallback method for "extresist" whenever a device terminal
connection to a net that has been decomposed into a resistor array
cannot be found.  This indicates some fundamental error in the way
extresist works.  However, it should not be producing an invalid
and unsimulatable netlist.  Instead, it makes an arbitrary connection
from the device terminal to the resistor array and adds an entry in
the output netlist (.res.ext file).  This results in a poor
representation of the resistor network to that terminal, but an
otherwise simulatable netlist.  A warning is issued to note that an
arbitrary connection has been made.  This is most typically a
"garbage in, garbage out" situation in which insufficient information
exists in a layout to inform magic on which direction current is
traveling through a net.  However, it should be possible to rewrite
the extresist code so that magic makes somewhat informed decisions
about current paths and produces a halfway decent representation of
the actual net, instead of just giving up on the detailed extraction.
2025-01-15 10:38:10 -05:00
Tim Edwards 4445663cb1 Modified a routine to return a valid string when attempting to
generate a name for an instance that is set to NULL.  It is not
clear to me by an instance would have a NULL name, but apparently
it can happen, and should not crash magic.
2025-01-12 17:36:05 -05:00
Tim Edwards 1cec414618 Added the contents of the "readline" module back. This is
generally unused, as it is incompatible with the Tcl/Tk build of
magic.  However, I had not intended to remove it, only move the
name from "readline-4.3" to "readline".  But "readline/readline"
was in .gitignore, which caused the contents to be removed from
the repository.  This commit restores those files, and also
prevents the readline directory Makefile from making a symbolic
link called "readline" to itself, which was causing compile-time
issues.  The readline code is only kept for backwards compatibility
with ancient versions of magic not using the Tcl/Tk interpreter.
2025-01-10 09:58:57 -05:00
Tim Edwards 82a1dc98b4 Updated the version to go along with the merge of pul request 2025-01-10 09:21:28 -05:00
Mamoru TASAKA cb2a79d6b1 gcc: support -Werror=format-security
Support gcc -Werror=format-security which is used by default on Fedora.

ext2spice/ext2spice.c: format not a string literal and no format arguments
extflat/EFargs.c: likewise
windows/windCmdNR.c: likewise
2025-01-10 14:19:52 +09:00
Tim Edwards 2afa222414 Updated the version number to go along with the merge of several
pull requests from Darryl Miles.
2025-01-07 14:02:58 -05:00
Darryl L. Miles f010d4d20b resis.h: create RESTRUE to replace use of TRUE macro ((bool)1)
Looks to be used as integer bitmask which is flagged by compiler warning
as dubious, when using compiler provided type 'bool' from stdbool.h
in C99 instead of unsigned char type.

C29 bool type compatibility
2025-01-07 14:02:07 -05:00
Darryl L. Miles 4887f71ca3 CIFread.h: fix struct cifrstyle.crs_layers type bool -> enum (unsigned char)
The type is actually an enum (assumed to be int by default) but relies
on the magic typedef to (unsigned char) so we make this explicit and
better document what the real type is.

I guess in the past it was really a bool with only 2 states NONE|TEXT.

C29 bool type compatibility
2025-01-07 14:02:07 -05:00
Darryl L. Miles b1a9e10be7 feat: quit [exit_status], option support
Affecting process exit status.
2025-01-07 13:58:45 -05:00
Darryl L. Miles faadb774b4 docs: quit -noprompt
Was looking to implement this feature and found it was already
implemented but is a secret feature.

Updated documentation and modified implementation so it is possible
a user can discover the feature via usage such as "quit -help -invalid"
like other commands.
2025-01-07 13:58:45 -05: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 3fc1c7e452 gcc11 -Wall -Wpedantic document for the next person 2025-01-06 16:33:22 +00:00
Darryl L. Miles 065f31f689 gcc11 -Wall -Wpedantic cleanup (post __attribute__ DLONG_PREFIX) 2025-01-06 16:27:10 +00:00
Darryl L. Miles 6afadf9809 gcc11 -Wall -Wpedantic cleanup (post __attribute__) 2025-01-06 16:25:38 +00:00
Darryl L. Miles 48c99a7b1d gcc11 -Wall -Wpedantic cleanup (post TCL9) FUN2CD() CD2FUN()
FUN2CD() on a function pointer still raises -Wpedantic warning due to the
officially undefined behaviour as defined by C standards.

So added FUN2CD() and CD2FUN() to at least mark the call-sites to help
with identification and ignoring -Wpedantic based on the source file
context given in the compiler output.
2025-01-06 16:25:15 +00:00
Darryl L. Miles c21e182b2c gcc11 -Wall -Wpedantic cleanup (post TCL9) 2025-01-06 16:24:57 +00:00
Darryl L. Miles aa5ddbaa58 database/database.h.in: const PaintResultType *resultTbl
Probably forgot to edit database.h.in template file (and edited
database.h) when working locally.
2025-01-06 16:24:02 +00:00
Darryl L. Miles 7e9d4cc15e ihash.c: cleanup warning use of void* with pointer arithmetic
Use of (void*) with pointer arithmetic warning removal.

But more so as it is in a macro (all be it local to file) which will
take on the form of the type passed as argument when the 'offset' looks
to be always be specified in bytes.
2025-01-06 16:21:22 +00:00
Darryl L. Miles 60c64db33a extflat: K&R various converted to ANSI (mainly due to bool use) 2025-01-06 16:18:41 +00:00
Darryl L. Miles ff9487de1f hash.c: K&R conversion to ANSI and constify arguments / callback
cb_heap_kill_t callback typedef created

Invoked from HeapKill()

No active callback implementation in the codebase.

callback interface (from hash.h):
  marked @invoke call-site
2025-01-06 16:15:58 +00:00
Darryl L. Miles d9cfd64d60 utils/*.c: K&R conversion to ANSI 2025-01-06 16:14:34 +00:00
Darryl L. Miles 07f9bbe1fb gcc11 -Wall -Wpedantic cleanup 2025-01-06 16:12:11 +00:00
Tim Edwards 3df2aaaa16 Modified the code in ext2spice.c that prints parameter values;
the former code attempted to determine the precision and generate
an output without unnecessary trailing zeros.  Unfortunately there
were counterexamples that fail to be formatted correctly, as found
by Mark Martin, and which generate output that has roundoff error.
Reimplemented the method using code found on StackOverflow, which
appears to solve the problem more robustly.
2025-01-06 11:49:29 -05:00
Tim Edwards 32138ccbc7 Modified some lines in tkcon.tcl that make it compatible with both
Tcl 8.6 and Tcl 9.0, fixing some features that got broken with an
attempt to update the script for version 9.0.
2025-01-04 14:09:58 -05:00
Tim Edwards e334fb919f Updating the revision number to go along with the merging of a
series of pull requests from Darryl Miles.
2025-01-04 11:45:11 -05:00
Darryl L. Miles af5b7f10cf lef/defWrite.c: reworked kareefardi_fix-def-write 2025-01-04 11:42:07 -05:00
Kareem Farid a6aac9c309 fix infinite def write
Signed-off-by: Kareem Farid <kareefardi@users.noreply.github.com>
2025-01-04 11:42:07 -05:00
Darryl L. Miles efcf36f348 Remove superfluous parenthesis around regular type declarations 2025-01-04 11:31:17 -05:00
Darryl L. Miles 1241e95dab debug/debug.c: constify and add prototype 2025-01-04 11:31:17 -05:00
Darryl L. Miles 195dda1e06 debug/hist.c: constify and add prototype 2025-01-04 11:31:17 -05:00
Darryl L. Miles eb89ab181c debug: use 'const' with 'rcsid' 2025-01-04 11:31:17 -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 6b4d409d74 cmwind: 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 34038ee687 cmwind: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles ac56dd71a9 cif: use 'const' with readonly data (also consumer DBpaint)
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