Commit Graph

23 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 b4912fd550 Updated the version to go along with the merge of pull request
version 8.3.521 that, due to an argument size mismatch, causes
device parameters in netlist output to be printed as zero.
Also added a small extension to the list of extraction types
to include "device veriloga", which has the same syntax as
"device subcircuit" but generates a component type "N"
(Verilog-A component) in the netlist output.
2025-08-07 11:54:49 -04:00
Darryl L. Miles d55a2b74ac header file #ifndef guard namespace consistency (global change)
This add an effective namespace prefix to the guard ifndef
2025-07-29 10:50:32 -04: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
Darryl L. Miles 6851f27284 extract/ExtBasic.c: Lookup() constify call-site 2024-12-26 15:20:58 -05:00
Tim Edwards 482d7534a2 Reimplemented the "extract do local" option as "extract path <name>"
with "extract do local" now being equivalent to "extract path .".
This allows extraction files to be put in a subdirectory and not
clog up the current working directory.  Also:  Fixed some behavior
around the use of "ext2spice -p <path>" so that it (1) works, and
(2) is compatible with the new "extract path".  Since the ext2spice
and ext2sim commands are effectively independent of the primary
extraction, the "-p" option is needed to correspond to the use of
"extract path".  Hopefully this is seen as only a minor inconvenience.
2023-06-14 13:55:59 -04:00
Alessandro De Laurenzis 68cecd5382 C99 code compat when configured with no TCL support 2022-10-29 06:07:46 +02: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 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 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 505155497e Resolved an issue with magic crashing during "antennacheck" due to
a routine that should have been called with a NULL argument, but
instead was called with no argument, making the behavior system-
dependent.  Revised the parsing of the "defaultareacap" and
"defaultperimeter" statements in the tech file, such that the short
version of both statements gets automatic handling of the substrate
and isolated substrate areas;  this goes back to the recent change
in extraction behavior to redefine the "substrate type" (e.g., pwell)
during extraction as defining isolated substrate areas, and not the
default substrate.  The earlier code change dealt with problems
related to extracting nodes and regions, but did not consider how
parasitic capacitance was affected.  This commit resolves that issue.
2022-02-23 15:02:40 -05: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 6136d3ff0f Implemented a command option "ext2spice short voltage|resistor|none" that
implements a method for handling ports in a subcircuit that have different
port names and indexes but are shorted together.  "none" is the default
and backwards-compatible behavior that merges ports together, which will
often cause one of the ports to be optimized out of the netlist.  "resistor"
will separate the port names with a 0-ohm ideal resistor.  "voltage" will
separate the port names with a 0-volt voltage source.  This should work
well for simulation and potentially for LVS, although its impact on LVS
has not been fully investigated.
2021-07-10 21:13:24 -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 f84de3676a Moved the substrate plane/restore further out so that planes are
not restored until after all cells have been processed through
extraction.  Otherwise, top-down connections can end up with
different generated names for the same node, resulting in a
disconnect in the netlist.
2021-04-05 16:03:54 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 6adb5dbacf Enhanced the "lef write" routine: (1) Calculates gate and diff
areas and writes ANTENNAGATEAREA and ANTENNADIFFAREA values.
(2) Determines "USE POWER" or "USE GROUND" from label names
matching Tcl variables $VDD and $GND, if the USE has not been
registered as a cell property (knowning the use allows magic
to avoid writing an ANTENNADIFFAREA for power rails, although
doing so should not be an issue).
2020-05-21 16:26:24 -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 77e8ff437b Finished first cut at an implementation of antenna rule violation
checks.  Added new command "antennacheck" and a routine that
adds feedback entries where violations are found.  Extended the
syntax of the extraction section of the techfile to support the
antenna ratios and antenna calculation methods.
2019-10-20 22:12:02 -04:00
Tim Edwards 7dc15a7d28 Added extraction device type "csubcircuit", which should have been
added a long time ago, since capacitors use a different method for
calculating width and length than either transistors or resistors,
so subcircuits need a special class designator or else the extraction
may calculate the wrong dimensions for device width by totalling the
perimeter between the device and terminal types, as it would for a
MOSFET.
2018-10-30 16:19:20 -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