"extresist" command continues to work as before. However, the
method now reads from .ext files instead of .sim files, so
generating ".sim" and ".nodes" files is no longer necessary.
In addition, the core code of "extresist" was put directly into
ExtCell.c so that full R-C extraction can be run using
"extract do resistance" followed by "extract all", without
needing to run "extresist" at all other than to set parameters
(e.g., "extresist tolerance 10").
(Ctrl key + left mouse button) will start a wire at the current
cursor position with the wire values set by "wire type" and
reported by "wire values". So "wire type metal1 0.28um" will
always start a 0.28um wide wire of metal1 regardless of what is
present at the cursor location.
parser that allows simple expressions to be entered for dimensions,
such as "2um + 2um" or even mixtures of units like "3um + 200i".
This feature is currently experimental.
and area) so that they are consistent across commands. The default
behavior remains the same, for backwards compatibility. However, a
new "units" command has been added, so that "units microns" results
in measurements always being displayed in microns, with choice of
that or "internal", "lambda", or "grid". The units themselves may
be printed (for interactive use) or not (for scripted use). The
use of "units" is independent of "snap", after overriding the
default behavior, so that units parsed on the command line are
interpreted according to "units", not to "snap".
(1) Fixed an error that was introduced in version 8.3.590 with
a patch that should have been applied only for the case of
BJT devices, and not for MOSFETs. The patch will cause
devices generated by "device mosfet" or "device asymmetric"
to be read incorrectly from a .ext file during "ext2spice".
(2) Fixed an error in the tech file reading, where using CDL
parameters on a capacitor device would cause the tech file
loader to print an error message. The parsing was correct
and only the message should not have been printed.
(3) Added a new feature with the new command option "extract
do unique". This replaces the "extract unique" command by
running the same code within the extraction, but has the
additional effect of reverting the label changes afterward.
This prevents the user from inadvertently writing the
altered labels back to the database file.
separate branch. This completes the work preventing magic from
altering tile record contents during a basic search, but also
corrects W and L calculations for non-Manhattan geometry, and
a number of other corrections detailed in the branch's commit
messages.
device extraction working, and also resolved an unrelated error
in "getnode" and another unrelated error reading "resist" values
from the tech file "extract" section.
involving searches on split tile areas, including one very
important check for interaction between split tiles during
hierarchical extraction. There is still something wrong in
the hierarchical extraction, but it could be the last remaining
issue.
the extraction, especially for routines like ExtFindNeighbors where
it was previously not handled at all. A new method was introduced
in which split tiles with neither side TT_SPACE will get an extra
allocated structure that contains pointers to two regions representing
the nodes on the tile's left and right sides, independently. The fix
(as yet not fully tested) should resolve problems with extracting the
sky130 I/O cells, which contain a FET with 45 degree angles on the
gate, where a split tile is divided between the gate and the source or
drain, and therefore represents two different nodes. Also, there were
extraction errors related to incorrect handling of split tiles having
only one node, where a split tile became connected to the wrong node.
especially around the extraction code. Extraction is now
more or less working, although the original known issues
around areas where split tiles contain two regions has not
yet been addressed.
and forcing it to be passed as an argument to all the callback
functions for the search routines that require it. Magic now
compiles and runs with the new code, but there are a number of
known issues that need to be fixed up. Committing now so that
I can rebase on the last update to the master branch.
had one error and one missing method. The error was an incorrect
argument count for regular (not subcircuit) FETs and BJTs. The
missing method was to handle parameters w0, w1, w2, etc., like
l0, l1, l2, . . . Those had been defined for output in ExtBasic.c
but were not being handled on input from the .ext file. This fix
corresponds more or less to PR #480 on github, although that PR
incorrectly addressed the argument numbering problem, so I have
redone the code changes by hand.
improperly messed with during a commit back in August. At the
time I was unsure of what to do with those lines, but now I'm
quite sure they were correct to have been commented out. I
have now removed them so that they should not cause trouble in
the future. Quick explanation: After a non-Manhattan tile
4-way split, merging should be done to the left conditionally
on the merge flags (the latter part of that being the August
1 fix), but merging should never be done to the right because
the right side is still fractured and has yet to be visited.
The merging will eventually get handled. Whether the merge
flag has been set or not does not matter.
not previously been tracked down. Behavior was that GDS additions
to correct hierarchical interactions would miss areas, especially
on large chip designs. This was found to be caused by a nested
use of DBSrCellPlaneArea(); the inner use was changing the outer
use's search area and causing it to exit early. Corrected by
removing the nested use of the subroutines. Also, created a
proper client data structure to pass information to and from the
subroutine, eliminating the ugly global variables that had been
used for that purpose.
parameter types "l1", "l2", etc., for terminal lengths. There
was a string comparison against an unterminated character array
which was causing intermittant errors. This problem was masking
the incorrect handling of "l1", "l2", etc., parameters. The
parameter types had been introduced to cover a specific type of
drain-unsalicided FET in GF180MCU, which is used as an ESD
device in the foundry I/O cells, so the impact had been
relatively limited, although typically showed up as unexpected
property errors on the ESD devices when running LVS on a chip
top level. Both discovered errors have been fixed.
way. The code as previously written was undermining other code
written to avoid long run-times on ext2spice, and didn't solve at
least one issue with unnecessary resistor shorts being added to the
netlist output. The current solution fixes one underlying problem
where a wrongly-placed parenthesis caused the "preferred net name"
routine EFHNBest() not to be run, which prevented original node
names from being preferred over their suffixed versions created by
"extract unique". However, I also added code to EFbuild.c to
merge unique nodes when the nodes are not really unique. The
problem is caused by "extract unique" operating only on one level
of hierarchy and being unable to see where nets may connect through
subcircuits. That can be determined from the "merge" statements
in the .ext file, and now the EFbuild routines will merge these
"false unique" names back into the original net.
475, 476, and 477 (first ones for mac OS and arch Linux support
on github; the last to modify recent code changes to work with
the last code merge for eliminating the one-off freeMagic().
These additional uses of freeMagic() also require defer-by-one using stack
storage (not global storage idiom, recently introduced).
Not sure if they were missed original or new/modified code in the past
12 months. Some areas/line-of-code are not usually compiled, maybe that
is why they were originally missed.
Appears the 'listtop' is a sentinal/entryexit value to a circular list
My recent patch does not copy original behaviour in freeing this list
entry (as well as the reset of the list).
Originally the use of a weak symbol was to provide a fallback for
non-inline supporting compilers. However all compilers (we care about)
support inline keyword (which was not known at the original time of the
work). Furthermore GCC have already worked through the solution and make
it easy to implement.
The use of __GNUC_STDC_INLINE__ pattern in this way manages the fallback
and emits a hard symbol this can be tested with:
CFLAGS="-g" ./configure; make; nm */lib*.o | grep freeMagic1
CFLAGS="-O3" ./configure; make; nm */lib*.o | grep freeMagic1
A hard 'T' symbol is emitted (to provide fallback) with all builds, but
in the -O3 all usage is inlined. So an individual file can decide to
inline or not at the occasion (compile time options) allows.
./configure
# If you are brave, enable with your favourite editor after ./configure
sed -e 's/^#FEATURE_FLAGS /FEATURE_FLAGS /' -i defs.mak
make
make install
This supports three build modes:
No additional -D options, default legacy mode
-DSUPPORT_DIRECT_MALLOC, magic will use direct calls to libc malloc/free
and will leave in place the symbols now renamed as mallocMagicLegacy()
freeMagicLegacy() and callocMagicLegacy().
-DSUPPORT_DIRECT_MALLOC -DSUPPORT_REMOVE_MALLOC_LEGACY as above but will
remove the three legacy functions from the binary to provide assurance
they can not be used.
The system malloc is thread-safe the legacy magic malloc has a global
deferred free pointer and the mmap() allocate has a free-list that is
not thread-safe making use of free not thread-safe.
This could of course be improved with the use of
atomic_compare_and_exchange operations but for what gain ?
Then there is the additional function call overhead (of the indirection)
and a few tests/branches inserted into a commonly used code paths around
memory allocation, it hides the call site of the malloc/free usage from
the compiler which maybe have special optimization cases.
The existing malloc/free makes static code analysis around memory
allocation more problematic, also use of runtime analysers will operate
better with a fail-fast to bad memory usage.
generate compressed .mag files itself, it is often very useful to
compress a massive layout file to save disk space or to hit a github
size target. The code change looks for files with either ".mag" (default)
or ".mag.gz" extensions. No check is made to see if both files might
exist at the same time and have incompatible content; it is up to the
end user to manage the file compression.
"noninteracting", "overlapping", and "nonoverlapping") which
were incorrectly ignoring tiles outside the search area.
Otherwise they will miss areas that pass outside of the the
search area and return back inside somewhere else.