From 564fab96679855a14bb7c3e95d1fb39429f3a99d Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 11 Nov 2016 09:49:37 -0500 Subject: [PATCH] Corrected an error in which property types were not promoted if an instance property did not match the cell property type, as long as the cell property types of the two compared cells matched. Along with a recent change that left "M" as a type double during SPICE netlist read-in, this caused "M" mismatches to be ignored, because the double value was ignored and the integer value was always zero. --- base/netcmp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/base/netcmp.c b/base/netcmp.c index 860a825..9f22604 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -3708,11 +3708,13 @@ int PropertyMatch(struct objlist *ob1, struct objlist *ob2, int do_print) SetPropertyDefault(kl2, vl2); } + /* Promote properties as necessary to make sure they all match */ + if (kl1->type != vl1->type) PromoteProperty(kl1, vl1); + if (kl2->type != vl2->type) PromoteProperty(kl2, vl2); + if (kl1->type != vl2->type) PromoteProperty(kl1, vl2); + if (vl1->type != kl2->type) PromoteProperty(kl2, vl1); + if (vl1->type != vl2->type) { - if (kl1->type != vl1->type) PromoteProperty(kl1, vl1); - if (kl2->type != vl2->type) PromoteProperty(kl2, vl2); - if (vl1->type != vl2->type) PromoteProperty(kl1, vl2); - if (vl1->type != vl2->type) PromoteProperty(kl2, vl1); if (do_print && (vl1->type != vl2->type)) { if (mismatches == 0) Fprintf(stdout, "%s vs. %s:\n", @@ -3752,8 +3754,9 @@ int PropertyMatch(struct objlist *ob1, struct objlist *ob2, int do_print) } Fprintf(stdout, " (property type mismatch)\n"); } - if (vl1->type != vl2->type) mismatches++; + mismatches++; } + else switch (kl1->type) { case PROP_DOUBLE: case PROP_VALUE: