Convert the old-style (K&R) function definitions in debug/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Corrects the HistCreate / HistAdd declarations in debug.h to use bool
for the ptrKeys parameter, matching their definitions.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in netmenu/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in resis/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in plot/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in plow/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in lisp/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in irouter/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates irInternal.h with prototypes for the affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in garouter/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates garouter.h. Callbacks passed to generic function-pointer
parameters (RtrStemProcessAll, the split-paint-plane hook) are cast to the
expected pointer type at the call sites.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in mzrouter/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in grouter/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates grouter.h with prototypes for the affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in router/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates the router headers (router.h, routerInt.h) and adds forward
typedefs for the netlist types (NLTermLoc, NLTerm, NLNet) named by the new
prototypes.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in gcr/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates gcr.h with prototypes for the affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in select/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates select.h with prototypes for the affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in extract/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates the extract headers (extract.h, extractInt.h). Where the
generically-typed node-name callback field is assigned the now-prototyped
extArrayTileToNode / extSubtreeTileToNode, the assignment is cast to the
field's function-pointer type.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in extflat/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates the extflat headers (extflat.h, EFint.h) to prototype the
affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in drc/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates drc.h with prototypes for the affected declarations.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in tcltk/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in textio/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in dbwind/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates dbwind.h, including a prototype for the combined DBWloadWindow
declaration.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in graphics/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Adds a forward typedef for TileType in graphics.h so the GrClipTriangle
prototype can name it without creating a circular include with the
database layer.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in database/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates the database prototypes through the database.h.in template
(database.h is generated) and adds a forward typedef for FontChar so
those prototypes need not pull in database/fonts.h. Also fixes a latent
bug exposed by the now-checked prototype: dbStampFunc was defined with two
parameters but called recursively with one.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the old-style (K&R) function definitions in utils/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.
Updates the utils headers (netlist.h, stack.h, undo.h, macros.h) to
prototype the affected declarations. TechAddClient keeps a generic
(unprototyped) declaration because its per-section callbacks have
intentionally varying signatures; its "opt" parameter is typed int (not
bool) so the empty-parameter-list declaration stays compatible with the
prototyped definition under C23.
Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GCC 16 defaults to C23, where "()" in a function declaration means
"(void)" rather than "unspecified arguments". That breaks the many
legacy K&R-style "()" declarations still present throughout the tree,
independently of the K&R-to-ANSI conversion that follows in subsequent
per-directory commits.
Add -std=gnu17 (single dash; clang silently ignores the "--std=" long
form some CI scripts pass) in the gcc SHLIB_CFLAGS block and the
emscripten target to restore C17 semantics, and drop the now-unnecessary
-Wno-implicit-int suppression from the emscripten target.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
a warning appropriate for duplicate points and not a path
reversal warning. Modified the output for path reversal or
duplicate point errors so that the coordinate is in GDS units
and not path units (which are multiplied by 2).
This uses environment variable PDK_ROOT to search for available
technologies, and loads them by sourcing the .magicrc file instead
of using "tech load". However, there are currently some caveats:
(1) The device generators do not immediately appear in the window
menu; a new window must be created for the extra menu buttons to
be added; (2) Once a PDK sets up the menus, they cannot be
revised. Switching to another technology causes the extra menu
items to not appear at all. Both issues need to be addressed.
Corrected an error that was caused by moving the handling of the
"Short"-type device from "extract" to "ext2spice". When running
with "ext2spice extresist on", the "Short" device is read twice.
Since it's being treated like an "equiv" statement, it's very
important to do the node merge only for the device as it appears
in the ".res.ext" file, and ignore the entry in ".ext", or the
wrong nodes may get merged. This appears to be the last major
error lurking in the "extresist" code, as I am now able to run
full R-C extraction on an entire chip, in reasonable time.
ambiguity in the tech file and therefore also in the .ext file.
This is easy to resolve and it was only necessary to change the
type after finding the tile belonging to the device. There are
pathological cases where this might still go wrong, like defining
a "short" device name for metal resistors on any plane; then,
if a "short" device overlaps something on another plane, it might
be given the wrong type. Avoiding all ambiguity would require
adding an extra item to "device" lines in the .ext file output;
the short plane name would be most efficient.
and not being used. Corrected one other obscure error in which
reading the .ext file picks up the wrong device type because it
is possible to have multiple types map to the same device name.
This is easy to detect and fix in place.
that the check for the "starting device" was not checking if a
terminal was substrate, and so was treating it as a terminal,
which would cause the extraction starting point to be set on the
wrong plane, along with probably other unwanted behavior.
Ignoring substrate terminals when checking for current drivers
solved the problem. Also: Removed some code that had been
reworked but was still sitting in an "#ifdef 0" block.
time-consuming (note the commit message "There are still likely much
better ways to do this"). Worked out a method of hashing the location
of terminals on other planes so that they can be looked up from the
address of the tile. This requires only one pass through the devices
to locate and record the terminals, and no loops through devices when
processing tiles. Also corrected the positioning of the substrate
terminal to be the center position of the device tile, not the substrate
tile. This not only better represents the substrate connections, but
it also eliminates the condition in which many thousands of resistors
converge on the same point, which causes stack overflow. With the
current scheme, stack overflow is unlikely to occur.
several more questionable methods and allows extresist to find
devices above nets that are part of substrate planes or terminals
that exist on planes other than the device (like diodes, often).
There are still likely much better ways to do this.
checking device terminals in "extresist", leading to incorrect
assignments for devices with only 3 terminals, or for asymmetric
FETs. Corrected "select area label" which had stopped working from
a handful of commits back when the "select" command was corrected for
visible/invisible labels and cells. Corrected the "extresist mindelay"
command option parsing, which was not allowing mindelay to be set to 0.
"tagged <text>" without any additional arguments, to indicate
that the operator should look for text that overlaps the
current layer. That allows handling the case were a text tag
is sitting over space inside a cell, which otherwise would not
be able to be searched. Also corrected a likely issue in which
point labels could not be used as tags because they have no
area to search under.
the output if they reference a killed node. This will result in an
invalid netlist, but at least now all devices are represented in the
output, and a warning is issued about the error. There are still
multiple problems that need to be tracked down and fixed. Most
problems are stemming from the unusual "Short" device handling.
long-standing problem, in which the resistance extraction attempts
to determine the device type of each device. Which is stupid,
because the original extraction process has already done this, and
the information is readily available in the .ext file. This update
allows "extresist" to get all the device information from the .ext
file, so there is no guesswork and no extra time spent trying.
Unfortunately, it does not solve the problem I expected it to solve,
which is the disappearance of _dss and moscap devices from gf180mcu
netlists. More work to do. . .
"lasttop" after a new heap has been allocated and "top" is reset.
This is a minor issue, as even random data at the top of the
newly allocated heap is vanishingly unlikely to make a match,
but valgrind caught it as a use of unallocated memory, and it
should be fixed.
one place as ohms and another as milliohms. Changed it to be
milliohms always, except when written as output to the lumped
resistance file or as diagnostic output. The result makes more
sense, but now has the issue that the maximum resistance is always
an over-estimate and may need to account for resistances in
parallel.
determining what does and doesn't get into the R-C extraction
output. Added option "debug" and moved all excess diagnostic
information to be gated by this flag. Corrected an issue in
the standard extraction in which the substrate is always output
with zero lumped resistance, preventing it from being checked
by "extresist" for inclusion or exclusion in the .res.ext output.
Reinstated the computation of minimum resistance transistor but
excluded other devices. Added more sane handling of exceptional
conditions like loops. The result is a more consistent check of
nets in the design. However, I still need to recheck the
"rg_maxres" calculation because it appears to be too low.
(1) An incorrect use of ExtResetTiles() was found in "extresist"
which impacts performance, especially for small nets.
(2) Corrected units for resistance tolerance in extresist, and
handled output printing in fs when delay values get below ps
size.
(3) Added command option "extract do unique notopports" to be the
extraction option equivalent of the standalone command
"extract unique notopports".
(4) Changed the "extresist" default for "mindelay" to 1ps from 0,
in response to the observation that lumped resistance from
"extract" can be an extreme overestimate, and the extracted
time delay from "extesist" calculations should be used as a
better determination of whether a net should be output as a
resistor network or not.
(5) Added documentation for both "extract do unique notopports"
and the change to the "extresist" default values.
was checking for device terminals that were pointing to the
deallocated node and updating them. However, it failed to check
for whether or not the substrate terminal was pointing to the
deallocated node, potentially causing a crash condition. That has
now been fixed.
that "extresist" selects or rejects networks for resistance
extraction. The "tolerance" value, which nobody (including
myself) seems to understand, is now deprecated, replaced by
a handful of more meaningful options: "threshold" to set a
lumped resistance estimate threshold to determined whether or
not to extract a network; "minres" to specify when to prune
small resistors from the resulting tree network, and "mindelay"
to gate the selection and output on the estimated signal
propagation delay. With these settings, I am much better able
to control the size and complexity of the resulting output.
overhaul was to introduce the concept of a "connection point"
between two cells to the ".ext" file format so that it becomes
possible to do proper hierarchical R-C extraction. Previously
this information was not kept in the .ext file, making it
impossible for "extresist" to know what sub-net of a net connects
up or down the hierarchy. However, additional changes were made
to the extresist code (in the resis/ directory) to add the
handling of connections up and down the hierarchy, and to make
the code a lot clearer and fix ambiguous variable and subroutine
names.
The original version of extresist only worked with 4-terminal FET
devices, and handling of devices with fewer terminals was ignored,
and never properly dealt with. This commit fixes the issues with
devices such as diodes that have fewer terminals.
with respect to visible/invisible labels and cells. The change
inadvertently made the "select area" command option stop selecting
labels on the same type as the layers being selected. This has
been fixed.
"getnode", as there is no limit on the length of a hierarchical
node name, and no check on the string length when copying back into
a fixed-length character array.
The previous code would iterate over `proplen` chunks of strings
but would not initialize `proplen` for plane properties.
Technically for plane properties you don't need to "pre-count"
the string chunks but given how the code is currently written
it's easier to do the counting in all cases.
Also makes sure proprec is init to NULL so that if argument is
empty, property is set to NULL and not random value on the stack.
Fixes#520
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
in "extresist", which when missing causes the plane to be searched
repeatedly from the same point instead of from the last place searched.
Can knock down the "extresist" time by up to 50%.