Commit Graph

1770 Commits

Author SHA1 Message Date
Darryl L. Miles cd63fa3c14 K&R calma: remove system header time() K&R style prototype
time.h has existed since C89 so is a standard header expected
to always be available.

sys/time.h was an optional header that historically only some
platforms provided.

If there is a conflict on specific platforms it is better to
'#if !defined()' that specific niche platform with the problem
if both headers are included in the same compile unit.  But I
don't think this is a problem in modern times.

So this results in a resolution that removes #ifdef around
time.h and the detection by configure for the availabiltiy
of sys/time.h.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 3f4eb4120e K&R calma: prototype for non-existent function: calmaMergeBoundaries()
Remove forward declaration prototype to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles f0b6231017 K&R calma: prototype for non-existent function: calmaWriteMarkFunc()
Remove forward declaration prototype to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 1fdd8bc185 K&R calmaInt.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 40b317979d K&R calma.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 5ee3b180d3 K&R calma: missing prototype: calmaWriteContacts()
Rename existing prototype method name to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Tim Edwards 48abe30ea4 Implemented a new CIF/GDS generation operator option for
"bloat-all" which is "bloat-all types1 types2 distance" where the
"distance" value is a maximum amount to grow.  It is not (that I
know of) particularly useful for generating output GDS, but it is
very useful for generating temporary layers for DRC checks,
especially things like determining tap distance for latch-up
rules.  The alternative (used in the sky130 tech file) is a
tedious step-by-step "grow" followed by "and-not".  This rule
option is much cleaner to implement and computes faster (although
it is still a boolean operator and is much slower than an edge
rule).
2024-12-25 20:46:25 -05:00
Tim Edwards 89b6f4f92b Corrected an error with the bloat-all CIF operator in which
bloat-all would fail to operate from the top layer of a contact
type due to the use of DBplane(type) instead of counting all
planes of the contact.
2024-12-16 21:52:11 -05:00
Tim Edwards 5ebbed4c12 Corrected the run-length wide-spacing rule so that it correctly
identifies areas which meet the proper definition of run-length
(both edges are parallel for the run-length distance or more).
Previously, errors were getting triggered for geometry where
only one edge exceeded the run-length distance.
2024-12-12 14:10:03 -05:00
Tim Edwards 37dfe07edf Extended the "cifmaxwidth" function to include the option "both",
which has the same meaning as the "maxwidth" function ("both"
checks either tile dimension to see if it exceeds the maximum).
This is a simple per-tile check and assumes that violations do
not occur across multiple tiles.  This should be sufficient for
most checks.
2024-12-08 12:14:38 -05:00
Tim Edwards dc87a8c693 Corrected two errors with the wiring tool: (1) Ignore
"angles"-type width rules when calculating the default metal
width DRC rule (this width when present will always be
larger than the minimum metal width), and (2) If an exiting
wire is larger than the contact size, then set the contact
size such that the contact PLUS the surrounding metal is the
width of the exiting wire.  The existing code sets the
contact size itself to the width of the exiting wire, such
that when surrounding material is added, the contact is
larger than it needs to be.  The fix to (1) will also fix
other places where the default DRC width rule is computed,
which includes LEF and DEF handling and computing rendered
text sizes when reading GDS.
2024-12-06 21:45:02 -05:00
Tim Edwards e0c95d6d78 Additional coding to handle discovery of terminal types on
different planes of a device that are connected to a multi-tile
device.  This is a more general solution than previously coded,
in which only the first tile of a device would be searched for
terminals on other planes, which was only guaranteed to work
if the device was represented by a single tile.
2024-12-06 20:51:59 -05:00
Tim Edwards 0a67151292 Extended the device parameters to allow a terminal width that is
different from the device (i.e., gate) width, for devices that do
not define a MOS-like gate spanning the width of the device.  This
is restricted to the assumption that the terminal is rectangular
and therefore a simple width and length can be derived from the
area and perimeter.  Also, length is defined as the smaller
dimension and width as the larger dimension.  For additional
restrictions, see the updated documentation.  This was added to
allow correct width and length extraction of a bipolar emitter
window, but may be more generally useful.
2024-12-06 16:42:43 -05:00
Tim Edwards 9184ccd395 Corrected an error in which DRC rules for width of material drawn
at a 45 degree angle will shadow the DRC rule for the material
drawn orthogonally (that is, the DRC rule for the distance between
orthogonal shapes will be eliminated from the rule deck).
2024-12-02 10:00:20 -05:00
Tim Edwards 8b34aa78a9 Corrected a long-standing crash condition that happens when a
generated cell is modified multiple times.  If the original cell
is orphaned (no longer used anywhere in the design), it is deleted.
However, an instance of the cell may exist in the secondary
select buffer if the cell was previously moved or copied, and
an attempt to do another move or copy will clear the secondary
select buffer, encounter the deleted cell, and crash the program.
2024-11-26 13:43:27 -05:00
Tim Edwards ea29aa3306 Modified behavior of the "property device" value. It was
previously ignoring the parameters of the entire cell including
the device being overridden by the property, causing the output
to be wrong.  The parameters should always be written out to the
.ext file, including the device whose output is being overridden.
2024-11-19 16:16:48 -05:00
Tim Edwards 1fdca3a57a Tracked down an obscure error that was causing a property
mismatch in the SkyWater sky130_fd_io__top_pwrdetv2 circuit
because a resistor with ends shorted together was being assigned
an incorrect length and width.  This was due to the similarity
in characteristics of the boundary vector between a shorted
resistor and an annular resistor.  The terminals need to be
checked for shorted ends to disambiguate the two cases.
2024-11-14 22:22:27 -05:00
Tim Edwards 22c22228b3 Coded around an issue where the antenna violation checker comes up
with zero gate error (and was reporting an infinite antenna ratio).
For now, just ignoring the zero-area case.  However, since the
procedure is supposed to be looping through nets connected to
specific devices in the .ext file, then every entry is supposed to
have non-zero area, so there is some underlying problem here that
needs to be fixed.
2024-11-07 11:59:07 -05:00
Tim Edwards a35993a81b Corrected a long-standing but rare error in which diagonal tiles
surrounding a device tile may cause the device to be extracted
with the wrong node (picking up the node from the wrong side of
the diagonal tile).  Added extra handling to capture the case
where two ports on two different nets are merged when using
"ext2spice short" (previously it was handling only ports on the
same net).  Also:  Removed the redundant readline-4.3 from the
readline/ directory;  only readline/readline is left, which is
version 4.3.
2024-11-02 11:00:05 -04:00
Tim Edwards b7942cffe6 Revised the previous commit after discussion with Darryl Miles on
the possible ways that other textio routines could affect the
string contents.
2024-10-10 17:48:59 -04:00
Tim Edwards 0864f8b728 Corrected an error introduced in yesterday's commits by a combination
of a syntax cleanup and an incorrect declaration.  See github issue
2024-10-10 15:27:52 -04:00
Tim Edwards d0eb5349a5 Updated the version to go along with a bunch of pull request
merges from syntax and error cleanup work done by Darryl Miles
(thanks, Darryl!).
2024-10-09 21:38:03 -04:00
Darryl L. Miles 95d3e9f85d CalmaRead.c: warning: variable 'libnameptr' is used uninitialized
The local variable 'libnameptr' is used from the 'goto done;' label cleanup
but it may not be initiailzied at the time of the first use of the label.

When evaluating this I also notice the global 'calmaErrorFile' when closed
does not have the handle invalidated.

CalmaRead.c:233:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true
CalmaRead.c:231:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true
CalmaRead.c:225:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles d5ef80acda gaStem.c: warning: variable '...' is used uninitialized
An error return indication was added, as there as no other way to abort
execution but indicate to caller the data was not filled in.

No call sites have been modified to check the error return as the
assertion is still in place and expects to catch this unexpected scenario.

gaStem.c:914:2: warning: variable 'start' is used uninitialized whenever switch default is taken
gaStem.c:914:2: warning: variable 'min' is used uninitialized whenever switch default is taken
gaStem.c:914:2: warning: variable 'max' is used uninitialized whenever switch default is taken

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 38c14a0ad9 gaMain.c: warning: variable 'errs' is used uninitialized
gaMain.c:287:9: warning: variable 'errs' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 7fd116c828 tclmagic.c: warning: variable 'arg0' is used uninitialized
tclmagic.c:448:9: warning: variable 'arg0' is used uninitialized whenever 'if' condition is false

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 35604400ed irRoute.c: warning: variable '...' is used uninitialized
"shouldn't happen" but if it did.

irRoute.c:594:2: warning: variable 'startPt' is used uninitialized whenever switch default is taken
irRoute.c:719:2: warning: variable 'destRect' is used uninitialized whenever switch default is taken

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 1bb6a7f6c5 plotPNM.c: warning: variable 'strip' is used uninitialized
The compiler warning concerns the use of 'goto done;' has cleanup
that accesses 'strip' before initialization.

While evaluating this I also notice the other 2 variables 'rtile'
and 'lkstep' are globals, but their pointers are not invalidated
at the time of free.

plotPNM.c:821:6: warning: variable 'strip' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 60e78f4ab4 CalmaWriteZ.c: warning: variable 'rtype' is used uninitialized
CalmaWriteZ.c:418:5: warning: variable 'rtype' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles fca0c2945d CalmaWrite.c: warning: variable 'rtype' is used uninitialized
CalmaWrite.c:442:5: warning: variable 'rtype' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles fece689c43 CalmaRdpt.c: warning: variable 'rtype' is used uninitialized
CalmaRdpt.c:525:5: warning: variable 'rtype' is used uninitialized whenever 'if' condition is true
CalmaRdpt.c:792:5: warning: variable 'rtype' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 2b06c8cee5 CalmaRdcl.c: warning: variable 'rtype' is used uninitialized
FEOF condition of PEEKRH causes variable to possibly not get
initialized before use.

CalmaRdcl.c:372:5: warning: variable 'rtype' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 2f22ec6293 set.c: warning: variable 'result' is used uninitialized
set.c:124:9: warning: variable 'result' is used uninitialized whenever 'if' condition is false

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles ea41b21f67 macros.c: warning: variable 'kc' is used uninitialized
macros.c:557:12: warning: variable 'kc' is used uninitialized whenever 'if' condition is false

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 817efbbccc txCommands.c: warning: variable ... is used uninitialized whenever
Maybe ASSERT are not always active, so defensive coding solution.

txCommands.c:883:6: warning: variable 'but' is used uninitialized whenever switch default is taken
txCommands.c:888:6: warning: variable 'act' is used uninitialized whenever switch default is taken

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles fa3a01c486 selOps.c: warning: variable 'type' is used uninitialized
selOps.c:1942:11: warning: variable 'type' is used uninitialized whenever 'if' condition is false

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 3919cc5b63 PlowRandom.c: warning: variable 'f2' is used uninitialized
PlowRandom.c:301:9: warning: variable 'f2' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 4206ed2436 grTOGL3.c: warning: variable 'font' is used uninitialized
grTOGL3.c:230:5: warning: variable 'font' is used uninitialized whenever switch default is taken

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 4520112a55 grTk3.c: warning: variable 'font' is used uninitialized
grTk3.c:203:5: warning: variable 'font' is used uninitialized whenever switch default is taken

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 7feb298f7a ExtBasic.c: warning: variable ... is used uninitialized whenever
ExtBasic.c:408:7: warning: variable 'urx' is used uninitialized whenever '||' condition is true
ExtBasic.c:417:7: warning: variable 'ury' is used uninitialized whenever '||' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 4380310e5b EFvisit.c: warning: misleading indentation;
I think the warning is bringing to attention the hidden fall-thru
case situation.

EFvisit.c:897:50: warning: misleading indentation; statement is not part of the previous 'if'

clang18 -Wall warning cleanup  [-Wmisleading-indentation]
2024-10-09 21:34:12 -04:00
Darryl L. Miles cbf97f77ee DRCcif.c: 'thislayer' is used uninitialized
DRCcif.c:1193:17: warning: variable 'thislayer' is used uninitialized whenever 'for' loop exits because its condition is false
DRCcif.c:1255:17: warning: variable 'thislayer' is used uninitialized whenever 'for' loop exits because its condition is false

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles 489de7fdb4 CmdCD.c: 'option' is used uninitialized
CmdCD.c:3693:14: warning: variable 'option' is used uninitialized whenever 'if' condition is false
CmdCD.c:3691:9: warning: variable 'option' is used uninitialized whenever 'if' condition is true

clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
2024-10-09 21:34:12 -04:00
Darryl L. Miles fc49b40c52 netlist.c: etext symbol for __clang__
clang does this differently, this method mirrors the linux man page.

clang18 default warning cleanup (strict)
2024-10-09 21:22:37 -04:00
Darryl L. Miles 9ca8697659 strings.h: add #include required when strict
Due to use of strcasecmp() or similar C API.

Maybe HAVE_STRINGS_H is needed ?  If so which platforms needs this ?

clang18 default warning cleanup (strict)
2024-10-09 21:22:37 -04:00
Darryl L. Miles 8f2acb83f9 plotHP.c: warning: incompatible pointer types passing 'int *' to ...
Perform pointer arithmatic with (int *) first then cast just for calling function.

plotHP.c:335:25: warning: incompatible pointer types passing 'int *' to parameter of type 'unsigned char *'
plotHP.c:339:25: warning: incompatible pointer types passing 'int *' to parameter of type 'unsigned char *'
plotHP.c:343:25: warning: incompatible pointer types passing 'int *' to parameter of type 'unsigned char *'

clang18 default warning cleanup [-Wincompatible-pointer-types]
2024-10-09 21:22:37 -04:00
Darryl L. Miles 165f1b35b4 ExtBasic.c: warning: incompatible pointer types passing 'NodeRegion *' ...
The NodeRegion is an extended form of LabRegion (which is smaller) and
has the same layout.  So we cast into the smaller type.

ExtBasic.c:1025:31: warning: incompatible pointer types passing 'NodeRegion *' (aka 'struct nreg *') to parameter of type 'LabRegion *' (aka 'struct lreg *')
ExtBasic.c:2291:29: warning: incompatible pointer types passing 'NodeRegion *' (aka 'struct nreg *') to parameter of type 'LabRegion *' (aka 'struct lreg *')
ExtBasic.c:2335:46: warning: incompatible pointer types passing 'NodeRegion *' (aka 'struct nreg *') to parameter of type 'LabRegion *' (aka 'struct lreg *')
ExtBasic.c:2339:47: warning: incompatible pointer types passing 'NodeRegion *' (aka 'struct nreg *') to parameter of type 'LabRegion *' (aka 'struct lreg *')

clang18 default warning cleanup [-Wincompatible-pointer-types]
2024-10-09 21:22:37 -04:00
Darryl L. Miles ade50dfc88 irRoute.c: warning: expression which evaluates to zero treated as a null pointer ...
Use of FALSE instead of NULL on a pointer type.

irRoute.c:1101:19: warning: expression which evaluates to zero treated
  as a null pointer constant of type 'RouteContact *'
  (aka 'struct routecontact *')

clang18 default warning cleanup [-Wnon-literal-null-conversion]
2024-10-09 21:22:37 -04:00
Darryl L. Miles 4460c5f1f5 DBio.c: warning: 'sscanf' may overflow; destination buffer in argument ...
DBio.c:2358:21: warning: 'sscanf' may overflow; destination buffer in
  argument 4 has size 2048, but the corresponding specifier may require
  size 2049

clang18 default warning cleanup [-Wfortify-source]
2024-10-09 21:22:37 -04:00
Darryl L. Miles ef48e40f39 lefRead.c:1334:63: warning: too few arguments in call to 'LefPaintPolygon'
When keep!=FALSE a malloc list is returned, so this looks like a memory leak.

clang18 default warning cleanup
2024-10-09 21:17:28 -04:00