Commit Graph

95 Commits

Author SHA1 Message Date
Tim Edwards edbefbd1c4 Corrected an error in handling partial buses connected to a
full-bus pin in a module instance.
2019-06-15 03:05:50 -04:00
Tim Edwards 527cdb3dab Corrected error in detecting S and M. 2019-06-12 11:11:28 -04:00
Tim Edwards ee66c00121 Further refined the last commit based on the change in definition of
a "critical property".  This lets a device define multiple critical
properties, all of which must match before additive properties can
be combined in the same device.
2019-05-17 14:33:26 -04:00
Tim Edwards f40a50d3b8 Corrected property value merging (again). By the rules of the
re-worked property command, "critical" properties must match
across devices so that all other properties can be combined as
specified (addition, parallel combination, or none).  The code was
still based on the older notion of the "critical" property being
the one to add (and thus preventing multiple properties from being
added in different ways).  This has now been fixed.
2019-05-17 11:25:34 -04:00
Tim Edwards 8e0371e09b Corrected handling of verilog backslash-escaped names in the
verilog netlist parser.
2019-05-05 10:52:07 -04:00
Tim Edwards 7889e2ae73 Small typo, large effect; wrong reference to ob1 (instead of ob2) in
flatten.c can cause a segfault when analyzing whether flattening
cells generates a better circuit match.
2019-01-21 20:29:42 -05:00
Tim Edwards 56b4174646 Fairly substantial overhaul of the tokenizing routine to better
handle verilog syntax.  Also:  Added SPICE voltage and current
sources as separate classes (as opposed to being converted to
subcircuits, which was how they were previously handled).  That
allowed voltage sources to be checked for zero value and removed
by shorting the ends together, as was being done for zero value
resistors (note that like zero-value resistors, removal is only
done if removing the component makes a better match than leaving
it in).  In particular, yosys has SPICE netlist output that
converts equality assignments ("assign a = b") into zero-value
voltage sources, so these components need to be treated as
non-physical elements.
2019-01-09 20:26:38 -05:00
Tim Edwards ef914e8d46 Corrected two instances of missing values on return from a function. 2018-11-19 08:12:12 -05:00
Tim Edwards 2cdf3c450f Extended the series/parallel merging setup commands to include
the possibility that a device (e.g., resistor or capacitor) may
not be a semiconductor device (in other words, a parasitic or
ideal device), and therefore uses "value" but not width and
length, and therefore "value" is a critical property to merge
both in series and parallel.  Corrected the series/parallel
network optimization to prevent it from setting both M and S
records > 1 on the same device (which is ambiguous).  To try
to get number of devices to match, where there are both series
and parallel devices, they will be merged across the critical
property early (before property matching).
2018-11-18 13:04:57 -05:00
Tim Edwards 079e0ab5d3 Corrected an error in the handling of node names in verilog that was
accidentally erasing array delimiters from node names, a move that
surprisingly has no effect at all on LVS until the cell containing
the truncated nodes is flattened, at which point it causes odd and
confusing behavior that seems to have nothing to do with node names
at all.
2018-11-14 19:53:19 -05:00
Tim Edwards 4fb892a64f Fixed configure script error that reports python3 as being
configured even when it is not found on the system.  This was only
a reporting error, and had no other repercussions.
2018-11-14 13:45:02 -05:00
Tim Edwards 13c45c6d0c Encountered a problem with parsing non-inlined ports of a module and
tracked it down to a "to be completed" comment in the source code.
So it is now completed.
2018-11-12 16:32:33 -05:00
Tim Edwards 09b2bb3316 Extended the verilog parser to account for the fact that there can
be whitespace between a wire/register name and its array delimiter.
2018-10-29 15:19:13 -04:00
Tim Edwards 0de1c232e4 Corrected property matching so that properties are promoted to
type double before sorting (previously, property promotion was
being done after parallel sorting).  Also, modified the verilog
file reading so that parameters and definitions that are numeric
are stored as numeric (not string) properties.
2018-09-26 10:46:55 -04:00
Tim Edwards 3a03e769af Substantially improved verilog parsing (although almost certainly not
perfect).  Given the complexities of the verilog language, the simple
strtok() tokenizer used by the SPICE parser is not sufficient.  Wrote
a better tokenizer that can distinguish between whitespace and
functional tokens like parentheses, semicolons, etc., which are tokens
themselves but also token separators.
2018-09-24 15:09:29 -04:00
Tim Edwards 036e1f0947 Modified the verilog reading code so that it will automatically
determine if a parameter is a floating-point number, integer, or
string, and set the parameter accordingly.  Found an error in the
parameter comparison if the subcircuit definitions don't agree
on the type of parameter. Now all values are promoted to a single
type based on preference order (double, integer, string).  Tested
on a verilog file with a primitive device type defined as a module
with its properties encoded as parameters.  This successfully
matched against the SPICE primitive device.
2018-08-01 15:40:23 -04:00
Tim Edwards dd6145463e Modified the SPICE parser to at least sanely deal with (possibly
CDL syntax) parameters that have values which are multi-word and
space separated (who the hell comes up with these things?).  One
can presumably safely assume that additional pin names are not
intermixed with parameters, so now if a multi-token parameter
value is encountered, the first word is taken as the value and
the remaining words are ignored, generating a warning message.
Since I have no idea what these values are used for, I cannot say
with certainty whether or not this would break LVS, but in the
test case given to me, the parameter had no impact on LVS, but
was apparently an annotation for the layout editor.
2018-06-25 21:21:45 -04:00
Tim Edwards 1c08e5a48d Corrected missing tcl.h includes, which are needed in files that
call FREE(), since the Tcl/Tk version makes that a macro for the
subroutine Tcl_Free().  Thanks to Laurent Charrier for the bug
fix.
2018-06-17 15:05:15 -04:00
Tim Edwards 534ea839c0 Revised the verilog parser to correctly identify and parse
parameters passed to instances, so that these can match critical
parameters in the SPICE netlist being compared against.
2018-05-23 13:04:31 -04:00
Tim Edwards 1fe341833c Expanded the verilog parsing to include simple handling of ifdef,
ifndef, endif conditional statements.  Pre-define the key "LVS"
for use with netgen.  Also corrected some problems stemming from
the way delimiters are handled and the flexible use of whitespace
in verilog.
2018-04-25 15:00:49 -04:00
Tim Edwards aee4b846e2 Corrected the known issue with pin bus index matching that was in
the last commit and which was expected to be corrected by this
commit.
2018-04-16 17:19:26 -04:00
Tim Edwards 58d7e17231 Corrected basic problem with verilog instance pins not needing to
be in any specific order since all ports are named.  Also corrected
problem with pin names not using the same string matching function
as used for nets in general (which affects the ability to match
against different bus delimiters).
2018-04-16 15:41:20 -04:00
Tim Edwards 4d65b0006d Added new handling for verilog structural netlists, and fixed
some problems stemming from comparing a case-sensitive netlist
against a case-insensitive one.  Verilog netlist reading does
not yet have support for macros other than "`include", and it
does not yet have support for bit vectors constructed with
braces ({}).
2018-04-12 17:09:10 -04:00
Tim Edwards 4166408576 Discovered a subtle error caused by running a setup script that
calls "equate pins".  This could fail because the routine that forces
uniqueness of pins was being called by the "compare" command but
outside of PinMatch.  Fixed by duplicating the call to force uniqueness
of pins inside the "equate" function.  Redundant calls should not
matter as uniqueness is resolved on the first call and subsequent calls
will need no further action.
2018-04-05 10:06:32 -04:00
Tim Edwards 0fb5efd914 Corrected a crash condition during pin matching if any subcell has
no pins at all.
2018-03-28 12:39:40 -04:00
Tim Edwards 440f61d540 Corrected a number of function returns, mainly to avoid compile-
time warnings and errors.  Removed the "-lazy" option from the
Tcl load command, which is not needed when the stubs libraries
are compiled in correctly, and which causes issues on some
systems (e.g., Mac OS).  Thanks to Matt Guthaus for the patch.
2018-01-26 11:56:41 -05:00
Tim Edwards 87e44b0d8c Corrected an issue in which netgen would attempt to find a file
from a ".include" line by trying alternate extensions.  This
should be discouraged, as it happened that a file included
"name.defparams", a file that didn't exist, and instead of calling
out the missing file, it recast it to "name.spice" and caused it
to drop into an infinite loop.  Oops.
2017-12-14 21:48:01 -05:00
Tim Edwards 4098b7d5fd Completed an unimplemented method that sets missing properties to
the default before comparing instances against each other for
serial/parallel combination.  In particular, this avoids a
failure to serially combine a device with M = 1 vs. a device with
no M declared.
2017-10-12 15:26:29 -04:00
Tim Edwards f860244700 Provide additional output for mismatched serial/parallel networks.
Netgen was incorrectly treating mismatched networks as a missing
set of parameters on whichever device had more property records,
resulting in misleading output.
2017-10-12 14:17:24 -04:00
Tim Edwards 66015511cb Corrected mismatch count, which was prematurely declaring a
mismatch on "M=" even though some conditions pass.
2017-10-12 12:30:33 -04:00
Tim Edwards b3277ca53e Modified reading of SPICE files so that parameters in quotes get
treated monolithically instead of being broken up into separate
tokens according to space characters, which screws up the parameter
parsing.
2017-10-12 12:11:30 -04:00
Tim Edwards 95bce5dbd6 Corrected another error in the serial combination in which the
attempt to resolve values by combining over serial chains was
attempting to access a property "S" in the component's master
record, which generally won't exist unless it has been explicitly
set in the netlist (which is unlikely since "S" is not a standard
SPICE/CDL parameter like "M").
2017-10-12 10:51:13 -04:00
Tim Edwards b5f188de42 Corrected two errors in the serial combine function, one which
misses a device if it has been already moved due to earlier
merging in the serial combine routine, and runs off the end of
the list;  the other if the pin check routine falls on the last
device in the list, leading to an incorrect check for a record
where there is only a NULL.
2017-10-10 22:24:09 -04:00
Tim Edwards af3982766e Prevented a crash condition in the error case in which ports are
unordered at the time of reaching reorderpins().  Pins will be
ordered arbitrarily (in the order of appearance in the linked
list), but netgen will not crash.
2017-08-24 09:50:40 -04:00
Tim Edwards ab9659af17 Corrected coding error in tilde expansion of .include filenames. 2017-06-22 08:12:41 -04:00
Tim Edwards b9e26f6fce Implemented better black-box handling. Netlist with "stub" entries
for subcircuits (.subckt ... .ends pair with cellname and pin names
and pin order, but no contents) are automatically treated as black-
box circuits if found and if the "-blackbox" option is passed to the
"lvs" (scripted) command.  The "equate pins" command can be used
outside of a comparison to force two circuits (black-box or
otherwise) to be matched by pin name (if not a black-box circuit,
then this is a provisional name match, as a circuit comparison will
order based on connectivity first, not pin names).  So two sets of
black-box circuit libraries can be used as long as their pin names
match.  One hack added to ignore the "!" at the end of global names
when comparing pin names for matching.  Otherwise, pin names must
compare by case-insensitive string match.
2017-06-20 22:50:31 -04:00
Tim Edwards 78779ce2e9 Corrected the "property parallel none" command option so that it
gets applied properly to all existing cells (as well as all
future cells, but normally the former is applicable in a setup
file for LVS).
2017-06-19 22:22:08 -04:00
Tim Edwards 70bb33cc62 Finally reworked "cells" command behavior into something
consistent.
2017-06-19 21:04:33 -04:00
Tim Edwards 05d4225e97 New command option "model blackbox on|off" makes "readnet spice"
treat empty subcircuits as blackbox cells automatically without
requiring specific callse to "model <cell> blackbox" for each.
Enabled in LVS script by giving option "-blackbox" at the end
of the LVS command.
2017-06-19 17:41:31 -04:00
Tim Edwards af7bc39bbf Added tilde expansion handling for .INCLUDE statements to the
SPICE netlist read routine.
2017-06-19 12:38:27 -04:00
Tim Edwards 24cc7d0c94 Update to add "property parallel none" command option. 2017-06-18 22:47:51 -04:00
Tim Edwards fd019b4afd Corrected the same error as a few commits back that causes a message
about property errors to show up, not due to property errors, but
due to proxy pins being inserted in the middle of a device record.
However, the first one was fixed for the case of proxy pins being
added to circuit 1, but the same fix was not made for the opposite
case of proxy pins being added to circuit 2.  This commit corrects
that omission.
2017-05-15 16:29:12 -04:00
Tim Edwards cdfd74bac4 Removed old comment from code referring to the development state. 2017-05-08 21:00:43 -04:00
Tim Edwards ccdd47bc0b Corrected rare case where a cell that is flattened is the first
instance in a cell, and is empty, and causes the cell contents
to be nulled out.
2017-05-08 20:55:58 -04:00
Tim Edwards ace1c28507 Corrected an error placing proxy pins after the first pin of the
first object if the (presumably top-level) cell has no pins
(top-level cells not in a subcircuit definition satisfy this
condition).
2017-05-05 21:08:09 -04:00
Tim Edwards 1471f0c09f Corrected error in combining property records of serial devices. 2017-05-05 17:35:57 -04:00
Tim Edwards 7cac67c81b Corrected an error in the property match subroutine that was failing
to stop at the end of an instance record without properties, leading
to strange errors where netgen declares "There were property errors"
but does not print any errors (because there aren't any).
2017-02-27 09:35:18 -05:00
Tim Edwards 0ad5730701 Corrected an error where snprintf() was not used when printing
formatted side-by-side output, causing a crash for names that
exceed the 40-column limit.
2017-02-08 15:16:24 -05:00
Tim Edwards b1924bff65 Finished implementing the Tcl list output format, and added a
routine to convert the list output format to a JSON output file,
for easy readback, parsing, and display using python.
2017-01-09 12:51:31 -05:00
Tim Edwards 8deccaad9c Fixed a bug in the combine routine that causes a segfault; added
preliminary support for a Tcl list output format.
2017-01-07 06:56:51 -05:00