Fix code scanning alert no. 34: Multiplication result converted to larger type (#54)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
completely implemented for the "cifwidth" and "cifspacing" rules,
resulting in those rules being Manhattan distance checks. Finished
the implementation (duplicating code from DRCbasic.c, with
appropriate scaling to CIF coordinates).
fixed for "cifwidth" and "cifspacing", in which the rule distance
is incorrectly multiplied by the expander (in the case of area,
multiplied by the expander squared).
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.
geometry (which had gone unnoticed due to the lack of use of
"cifspacing" in any rule decks). The rule was not checking for
all synthetic edges, because the tile type was expected to match
the rule type when the function is called, but with a non-Manhattan
tile, that may or may not be true and needs to be checked.
hierarchical processing from CIFGenSubcells() and CIFGenArrays(), and to
avoid certain operators that are useless and harmful when applied
hierarchically; namely squares, slots, bbox, boundary, and net.
are interpreted in the dimensions used in the cifoutput section rather
than always in centimicrons (otherwise, rules at, say, 5nm cannot be
represented in the DRC section).
the rule is a normal database rule or a CIF-DRC rule. For the latter,
the flag is used when substituting for escape strings in the "why"
rule explanation to produce the correct value in microns.
templayers. This permits some useful interactions like growing to
the size of a bounding box, or abutment box, as well as many other
possibilities. Also: Corrected the use of "cif see" for the boundary
(abutment box) layer, which was not working because the "cif see"
command uses a flattened CellDef that does not have the boundary
property of the cell it was flattened from.
DRC records contain an index into a string array instead of containing
a copy of a string. This is preliminary to changing the way the DRC
error plane is painted, so that the types painted will mark the error
type. This will (1) allow "drc why" to simply scan the DRC error
plane rather than running the DRC engine, (2) allow DRC errors to be
counted by area rather than by tile, and (3) let the DRC count be the
same whether done by "drc listall why" or "drc count".
flag definition had been put in database.h instead of database.h.in,
and so was deleted on "make clean". Also, corrected a problem that
causes the cif output style to be lost when running DRC-CIF checks
if the first output style is the DRC style.
error whenever there are no DRC-CIF rules in the techfile. The
same error will be raised anyway when reading the techfile if
DRC-CIF rules are declared without a style being specified.
reduction of memory and startup time, which was to maintain only
one CIF style in memory. The new method is just to read in and
keep the DRC CIF style separately from the output CIF style.
Because the CIF sections of the techfile are read before the DRC
sections, and the CIF DRC style is declared in the DRC section,
the CIF DRC style is read in on the fly during the first DRC
checking.