Commit Graph

2357 Commits

Author SHA1 Message Date
R. Timothy Edwards d3a0228958 Added a new device type "dsubcircuit" which basically behaves like
"csubcircuit" but swaps the first two pins (with the device
identifier layer becoming the 2nd pin and the other terminal the
first), which is needed for n-type diodes modeled as subcircuits
where the subcircuit pin order matches the order of pins for a
SPICE n-type diode component.  Previously "msubcircuit" was used
for this purpose, but will calculate the wrong L and W.  While
use of L and W for diodes is rare, this device type also works for
reversed capacitors (where the bottom or non-identifying layer
terminal is in the first pin position of the subcircuit).
2025-10-07 16:45:22 -04:00
R. Timothy Edwards 656d27b17a Added a new "devresist" type "terminal" to account for resistor
terminal resistance, for cases where the resistor value is
estimated and output along with (or instead of) the physical
length and width or area and perimeter.  Corrected the "area"
and "perimeter" type handling so that they combine in parallel,
not in series (note that "perimeter" resistance is just an area
resistance with the depth of the material factored in).
2025-10-07 12:12:33 -04:00
R. Timothy Edwards 3631892cfa One more minor change to the behavior just implemented: A value
for a resistor or capacitor is optional but is valid SPICE and not
just limited to CDL format, so it is now allowed to add "r=" at
the end of a resistor or capacitor component (not subcircuit) to
generate the optional component value.
2025-10-06 20:37:30 -04:00
R. Timothy Edwards 8c323803b7 Additional modification to write out a resistor or capacitor value
as-is, without a parameter name and before any device model name or
substrate pin, according to CDL syntax, if the parameter has been
specified without a parameter name (e.g., "r=" instead of "r=r").
Corrected an error in the extract code which put the substrate node
name in front of parameters instead of after.  This was previously
unexercised because only in CDL format does a resistor or capacitor
model have parameters listed by name.
2025-10-06 17:42:34 -04:00
R. Timothy Edwards acdfb256a1 Made a change to CDL format output to place the substrate parameter
in front of the device name, which is a very inconsistent way to
make the syntax, but whatever.
2025-10-06 16:40:19 -04:00
R. Timothy Edwards 5e74ecf9fa Added code to avoid a segfault if a resistor or capacitor is
specified without a list of substrate connection types, but
the "s=" parameter is used, resulting in an attempt to access a
substrate node that does not exist.
2025-10-06 14:14:05 -04:00
R. Timothy Edwards d6d8620a7c Added new statements "connect" and "disconnect" to the extract
section of the tech file, which can be used to alter the layer
connectivity tables from the default.  This can be used, for
example, to disconnect substrate and well from taps, to
generate a netlist that checks for soft-connect errors.
2025-10-06 11:50:38 -04:00
R. Timothy Edwards a2390167e6 Updated the version to go along with the merge of pull request #455
from Darryl Miles.
2025-10-04 20:50:51 -04:00
Darryl L. Miles 3cfc24f4b9 AppImage: AppRun use #!/usr/bin/env bash
There are Linux systems without bash installed at /bin/sh or it is
in a non-standard location.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 7e12bec49d txInput.c: comment #endif markers 2025-10-04 20:50:31 -04:00
Darryl L. Miles 5f1f92f30d GHA: update canary-matrix.yml
Removes ubuntu-20.04 config (no longer available on GitHub CI)
added clang-19 and gcc-13
removed no_gc_gu, as all 'gl' (GL) options require 'gu' (GLU)
added build for --enable-readline-bundled
added X11+Cairo
2025-10-04 20:50:31 -04:00
Darryl L. Miles 15faa19346 configure: autoconf regen (2.69) --enable-readline-bundled GR_SRCS 2025-10-04 20:50:31 -04:00
Darryl L. Miles af7b6bf119 graphics: minor change to Makefile and configure
This splits and groups DEPSRCS better so errors are not seen trying to
include files that are not present with no intention to build that
source file.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 8b0616eaf5 readline: add configure --enable-readline-bundled option
Cleanup autoconf handling, should always work as expected.
Use of --enable-readline-bundled when readline is needed will use
copy in subdir.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 2b62123459 SimRsim.c: removal of pre-POSIX.1-2001 select() interface ifdefs
POSIX.1-2001 introduced fd_set for use with select() and all current
systems support POSIX.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 2259ef626d SimRsim.c: EMSCRIPTEN fix for select/fd_set
The compiler has started to error on casting int* to fd_set*
Since WASM build has presense of fd_set then the ifdef have been
switched away from the legacy (pre 2000) method.
2025-10-04 20:50:31 -04:00
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 f4212d8e0e graphics: cleanup various warnings 2025-10-04 20:50:31 -04:00
Darryl L. Miles a16c667290 txInput.c: USE_READLINE constify rl_completion_function
There is a use case of fully .rodata data table of strings but also
a dynamic version built at runtime.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 6e2babd141 txInput.c: constify localvars
non-tktcl build check
2025-10-04 20:50:31 -04:00
Darryl L. Miles b80279c6db grOGL1.c: HashLookOnly() using X11 Window type a key on LLP64 needs cast 2025-10-04 20:50:31 -04:00
Darryl L. Miles 722209b1ae parser.c: ParsSplit() constify (const char **remainder) 2025-10-04 20:50:31 -04:00
Darryl L. Miles 692c0f2339 grX11su3.c: warning for ClientData compare
MAGIC_WRAPPER build option
2025-10-04 20:50:31 -04:00
Darryl L. Miles dbdec3aa17 readline/Makefile: lib target (for no-tktcl build option) 2025-10-04 20:50:31 -04:00
Darryl L. Miles f7d2debb98 txOutput.c: $PAGER handling constify 2025-10-04 20:50:31 -04:00
Darryl L. Miles 0f047b89ce txMain.c: readline needs function shim for prototype difference TxGetChar
USE_READLINE build option
2025-10-04 20:50:31 -04:00
Darryl L. Miles 3b57ae1179 txMain.c: MAGIC_WRAPPER constify fix 2025-10-04 20:50:31 -04:00
Darryl L. Miles dc45242d46 database: DBTypeLongNameTbl() constify data (const char*) 2025-10-04 20:50:31 -04:00
Darryl L. Miles 6d8c3eee1a database: DBTechAddPlane() constify API (const char*) 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 5093182f4a database: DBPlaneShortName() return const char * 2025-10-04 20:50:31 -04:00
Darryl L. Miles 4864a80179 database: DBTypeShortName() return const char * 2025-10-04 20:50:31 -04:00
Darryl L. Miles 70054ccde2 EFread.c: ANSI prototype efReadDef() 2025-10-04 20:50:31 -04:00
Darryl L. Miles c007d8077c EFbuild.c: ANSI prototype efBuildDevNode() 2025-10-04 20:50:31 -04:00
Darryl L. Miles da216195b3 SimSelect.c: fix theoretical potential to write to .rodata string
We make a copy of readonly string on function entry and use that instead.
strrchr() is a bit of an annoying API, takes const char* but returns char*
but it is the same string.  One for static analysis or C++.

SimSelectArea() argument unused.
2025-10-04 20:50:31 -04:00
Darryl L. Miles 5fe586100b extflat: ANSI prototype efBuildDevice() and constify (const Rect*) 2025-10-04 20:50:31 -04:00
Darryl L. Miles c7ef7d743a CmdRS.c: SimGetNodeCommand() returns (const char *) now 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 cfd1d567bd commands: Various fixes for TxPrintf() with !MAGIC_WRAPPER
!MAGIC_WRAPPER build for WASM exposes
2025-10-04 20:50:31 -04:00
Darryl L. Miles b1424bfaf3 plow: add ANSI prototypes plowMergeBottom() plowMergeTop()
This exposes the incorrect call sites, that are also fixed here.
2025-10-04 20:50:31 -04:00
Darryl L. Miles aef23fd5f3 plotRutils.c: use #include <math.h> 2025-10-04 20:50:31 -04:00
Darryl L. Miles 1dfe1ed645 SimSelect.c: constify (const char*) TLE.tl_nodeName TLE.tl_simLabel 2025-10-04 20:50:31 -04:00
Darryl L. Miles 9c5cf1a567 magic.h: DLONG_PREFIX add other Linux 64bit ifdefs 2025-10-04 20:50:31 -04:00
Darryl L. Miles 55931e8811 GHA: .github/workflows/main-aarch64.yml 2025-10-04 20:50:31 -04:00
R. Timothy Edwards bb131f14d0 One additional modification to output the message about duplicate
cells as a "note" if "gds noduplicates" has been set, and a
"warning" otherwise.  This makes error handling of magic's
output a bit easier.
2025-10-01 15:38:41 -04:00
R. Timothy Edwards 78f7d22796 A number of changes:
1) Corrected spurious error messages about cells already existing
   in GDS when using "flatten" or "flatglob".
2) Fixed handling of resistance as a subcircuit parameter
3) Added area and perimeter resistance for a device;  this is done
   through the "devresist" statement in the tech file, which is an
   extension of the original "fetresist" statement.  Where "fetresist"
   only supported type "linear", "devresist" supports types "area"
   and "perimeter".
4) Support for CDL syntax, including generating subcircuit-like
   parameters for components starting with SPICE-standard prefixes
   like M, R, C, etc., adding "/" between pins and subcircuit name,
   and saving the file as ".cdl" instead of ".spice".
5) Estimated L and W for devices whose geometry is complex and do not
   reduce to a simple rectangle.  L and W are estimated as the square
   root of the area.
6) Changed the method of extracting L and W for diodes to use the same
   method as capacitors.  Note that diodes are not usually specified
   by L and W, but if they are, this will produce the right result.
7) Corrected the reported filename and line number when printing error
   messages related to errors inside a technology file, when the
   technology file uses "include" to combine multiple files.
2025-10-01 15:17:49 -04:00
R. Timothy Edwards b1c7b52ed2 Modified "gds flatglob" to have the value "*_CDNS_*" by default,
since this is a common artifact of foundry cells and almost
always incompatible with magic.  Modified the "port" command to
allow "port make <index>" on a label where other labels of the
same text already have the same index.  Removed deprecated
documentation and added some missing documentation, such as an
explanation of the "ext2spice subcircuit auto" option.
2025-09-26 09:18:43 -04:00
R. Timothy Edwards 5de118b762 Corrected the greatest common factor routine that is run when
doing "save", which was missing checks on properties representing
coordinates (e.g., FIXED_BBOX) resulting in those values
potentially getting truncated by scaling the output to an
incompatible common factor.  Thanks to Sylvain Munaut for finding
the issue!
2025-09-17 12:20:13 -04:00
R. Timothy Edwards 00e3bbd12a Corrected the tech loader, which was failing to set the file
prefix when doing a reentrant load, causing include files to not
be found.  Fixed a divide-by-zero issue that occurs when some
tech file sections are not loaded to the abovementioned error.
2025-09-11 10:51:14 -04:00
R. Timothy Edwards 0022c502c8 Correction to dbReComputeBboxFunc() to fix a potential issue with
an uninitialized bounding box value.
2025-09-10 16:54:25 -04:00