Commit Graph

86 Commits

Author SHA1 Message Date
Tim Edwards 1c0dbc907a Recast all uses of resist-class and device class in routines using
code from extflat from type unsigned long to type TileTypeBitMask.
This increases the number of types of each to 256 and tracks the
number of types, so it should be difficult to exceed this amount.
2021-05-27 16:13:06 -04:00
Tim Edwards 33927740bf Merge branch 'master' of opencircuitdesign.com:/home/tim/gitsrc/magic/
Pull before push.
2021-03-01 11:12:42 -05:00
Tim Edwards 83808dcf79 Corrected an error that was causing disconnects in the hierarchical
SPICE netlist output that appears to have come from flags created
for writing DEF that inappropriately got set during ext2spice.
A redundant call to efAddNodes() was adding confusion by appearing
to handle most cases but actually missing some.  With the corrected
flag, the redundant call is really redundant and can be removed.
It has not been tested whether DEF output is affected by the change
(DEF output from magic is rarely used, anyway).
2021-03-01 11:08:25 -05:00
Tim Edwards 4cc09afeac Corrected some errors relating to distributed allocation of node
area and perimeter across devices.  The distributed allocation
was missing for hierarchical output, and the function that
accumulates values per resistance class was initializing by
iterating over device classes, not resistance classes, leading
to a segfault if the number of device classes is larger than the
number of resistance classes.
2021-02-25 17:51:12 -05:00
Tim Edwards 15fe4d2d29 Merged pull request #35 from Jan Belohoubek 2021-02-17 21:08:10 -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 44325f81e6 Corrected two errors: (1) Do not write subcircuit calls to subcircuits
that have been removed by flattening into the parent cell due to lack
of devices.  Previously the checks on writing the subcircuit and writing
the call were slightly different, leading to instances in which the
subcircuit call would be written to the netlist output without the
subcircuit being defined.  (2) Corrected an error in the "bridge" CIF/GDS
output operator.  In certain (somewhat rare) geometries, the tile behind
(instead of in front of) the corner being checked may be incorrectly
flagged as a DRC spacing error.  The fix is to ignore tiles that are
behind the corner being checked.
2020-12-28 16:54:20 -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 32ec962535 Separated drain and source records for the esFetInfo array, to
support asymmetric FETs and other devices like bipolars that have
three distinct terminals.  This does not go as far as it should to
make the array independent of the number of declared terminals of
the device.  However, it suffices to make, e.g., parameter "a2=area"
work for a bipolar device, and to generate the right drain and source
areas and perimeters for asymmetric (e.g., extended-drain) devices.
2020-09-11 17:29:12 -04:00
Tim Edwards 18131e26b3 Pulled merge request from Jan Belohoubek, but corrected the problem
of needing to revert parameter definitions after swapping them
during a device source/drain swap.
2020-08-09 13:11:38 -04:00
Jan Belohoubek 6c508c25b9 swapDrainSource moved into a function to encapsulate swap-related tasks; area parameters swapped according to the D/S attributes; SPICE attribute comment printf moved to the end of export function as it allows to add more device types 2020-08-09 17:34:24 +02:00
Dan Moore 99a0575501 Changed the end-of-line comment character from ';' to '$' when
formatting a SPICE netlist for NGSPICE.  This is the documented
character as described in the NGSPICE User Manual, section 2.2.4
End-of-line comments
2020-06-27 19:50:12 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards ad13e48a07 Corrected ext2spice for the case where a port has been given more
than one name, because in that case one of the port records ends
up with a null pointer to a node, and causes a crash condition.
This can happen inadvertently, as when a connected node is not
specifically designated a port, but is forced to be a port
because of the connection.
2020-03-20 14:50:56 -04:00
Tim Edwards d0f3aaeb59 Corrected ext2hier.c so that resistance output from extresist takes
the right argument type (float, not int).  Otherwise all resistances
from extresist come out zero when doing "ext2spice extresist on"
and "ext2spice hierarchy on".  Also changed the format of the resistance
in the SPICE output to type float, since values are in standard units of
ohms, and rounding to the nearest ohm seems excessively coarse-grained.
2019-12-16 09:55:11 -05:00
Tim Edwards fc86f44bb1 Again revisited the problem of duplicate nodes. This time, I think
I understand the problem, which is that nodes are ordered according
to precedence of EFHNBest() within a circuit, but there is no
concept of ordering between circuits.  So ports end up listing nodes
in arbitrary order, and the only way to resolve the order is to use
EFHNBest() as is done within a subcircuit.  Appears to work for
different edge cases tested.
2019-10-29 13:55:28 -04:00
Tim Edwards c342178458 Made some changes to the way that ext2spice generates subcircuit
ports, to avoid creating ports for node names that are redundant.
It would probably be better to avoid creating the redundant node
names in the first place;  however, I am less certain why these
are generated.  The incorrect additional ports all have hierarchical
names in the cell, which is a sign that they are incorrect, as the
cell itself should not have any parents.  The level of certainty
about this fix is definitely not 100%, but it was tested on a
hierarchical analog design, and setting levels of parasitic caps
caused new nodes to appear in subcircuits and in no cases did
information appear to be lost.
2019-10-29 09:44:28 -04:00
Tim Edwards a4ea827d1e More corrections to extresist, which now appears to work if used
with ext2spice without the hierarchy option.  More work needed to
produce correct hierarchical output and to support extraction
devices other than the old "fet" record.
2019-10-28 13:10:16 -04:00
Tim Edwards d9ccd711d9 Realizing that the "no such node" messages were directly related to
the below-threshold coupling caps being removed from the hierarchy,
added code to suppress the error message when it is clearly related
to a below-threshold cap that has been removed.
2019-10-23 11:59:59 -04:00
Tim Edwards 7a42b5b6ad Fixed a long-standing error in which "ext2spice merge" fails when
used with "ext2spice hierarchy on" because the device index is not
reset between calls to output cells in the hierarchy, leading to
a mismatch of the index for all cells after the first one output.
2019-10-23 09:33:37 -04:00
Tim Edwards b8c34cb10b Fixed an additional call to HashFind() that should have been
HashLookOnly() and can potentially cause a crash.
2019-10-18 14:25:28 -04:00
Tim Edwards 39ab59e7ec Corrected error causing a crash when parasitic extraction is
invoked on a layout with an array of instances.  Also, continued
implementation of antenna violation checking (not done yet).
2019-10-18 14:12:52 -04:00
Tim Edwards 000dab40e3 Made a correction to the last commit as the wrong hash search
function was used (HashFind, which never returns NULL, vs.
HashLookOnly, which does) resulting in a failure to solve the
problem which was being patched, which was ext2spice crashing
when cell arrays are present, which itself was due to allowing
brackets in base cell use names.
2019-10-02 12:59:10 -04:00
Tim Edwards 798e87deaf Corrected method relating to use of array notation in the base
use name (not part of an array in magic).  This was failing in
ext2spice due to code in extflat dealing incorrectly with the
array delimiters.  The correction fixes the problem but leaves
the possibility that there could be a conflict between a use
name that is an array and a use name that has the array index
as part of the name.
2019-10-01 19:32:52 -04:00
Tim Edwards 982bb8aa63 Changed a recent commit which removed brackets from instance names
while reading DEF.  To preserve names as much as possible, such
names are now kept.  To avoid problems, EFbuild.c and ext2hier
behavior has been changed to only parse entries in a .ext file as
instance arrays if the array notation follows the specific syntax
of [ax:bx:cx][ay:by:cy], letting all other uses of brackets pass
through unaffected.
2019-07-25 10:20:24 -04:00
Tim Edwards e296246c92 One last correction, as I accidentally dropped two calls to
getCurDevMult() inside spcHierWriteParams(), where it was being
passed as an argument, therefore making a redundant call and
wasting compute cycles.
2019-06-07 21:39:37 -04:00
Tim Edwards 6d5d370e8c Corrected a few additional uninitialized variable situations that
had been shadowed by the previous set of fixes.
2019-06-07 15:00:39 -04:00
Tim Edwards 547f0448d9 Cleanup of a number of uninitialized variable issues flagged by
the compiler.  Some are obscure functions (plot verstatec hasn't
been used in years) but others (like SPICE distributed junctions)
are potentially significant sources of unexpected crashes on
systems that don't zero uninitialized memory.
2019-06-07 14:13:50 -04:00
Tim Edwards 9f5936c7cb Found an additional scaling-up problem in ext2spice (previously handled
a scaling issue in extract) which was caused by the addition of
hierarchical netlist generation.  Finding hierarchical connections
requires finding instances by name, so it is vastly better to create a
hash table of instances instead of a linked list.
2019-02-07 10:54:07 -05:00
Tim Edwards f3a95c74fe Corrected hierarchical SPICE extraction to reset the subcircuit
name-to-number mapping used for the HSPICE format between
subcircuits.  Otherwise, subcircuits with the same instance ID
remain in the table and may cause nodes to be output with a name
that collides with other names in the same subcircuit.  This only
affects output in HSPICE format.
2018-12-12 17:23:35 -05:00
Tim Edwards 395fb1a8d6 Corrected node merging, which failed to copy the EF_TOP_PORT flag
bit into the merged node.  Corrected reference to efNodeHashTable
to the more proper call to EFHNLook().
2018-11-15 15:55:41 -05:00
Tim Edwards fa17436fef Corrected a few errors in the implementation of "csubcircuit",
now fully tested and verified.
2018-10-30 21:56:05 -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 ba2db7bbd3 Option "ext2spice subcircuit top" was implemented wrong and would
cause a crash.  Corrected the implementation as well as implemented
an option for "subcircuit top auto" that generates a subcircuit
header or not depending on the presence or absense of ports in the
top level cell.
2018-03-28 12:09:19 -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