Avoid unnecessary calculations for utgate.

This commit is contained in:
Brian Taylor 2022-12-08 11:31:34 -08:00 committed by Holger Vogt
parent bf14ec6d10
commit f6250183c6
1 changed files with 50 additions and 49 deletions

View File

@ -2579,6 +2579,23 @@ static char *get_delays_utgate(char *rem)
struct timing_data *tdp3, *tdp4, *tdp5, *tdp6; struct timing_data *tdp3, *tdp4, *tdp5, *tdp6;
char *tplz, *tphz, *tpzl, *tpzh, *larger, *larger1, *larger2, *larger3; char *tplz, *tphz, *tpzl, *tpzh, *larger, *larger1, *larger2, *larger3;
tdp1 = create_min_typ_max("tplh", rem);
estimate_typ(tdp1);
rising = get_estimate(tdp1);
tdp2 = create_min_typ_max("tphl", rem);
estimate_typ(tdp2);
falling = get_estimate(tdp2);
if (rising && strlen(rising) > 0) {
if (falling && strlen(falling) > 0) {
larger = larger_delay(rising, falling);
delays = tprintf("(delay = %s)", larger);
} else {
delays = tprintf("(delay = %s)", rising);
}
} else if (falling && strlen(falling) > 0) {
delays = tprintf("(delay = %s)", falling);
} else {
/* No lh/hl delays, so try the largest lz/hz/zl/zh delay */
tdp3 = create_min_typ_max("tplz", rem); tdp3 = create_min_typ_max("tplz", rem);
estimate_typ(tdp3); estimate_typ(tdp3);
tplz = get_estimate(tdp3); tplz = get_estimate(tdp3);
@ -2624,34 +2641,18 @@ static char *get_delays_utgate(char *rem)
larger3 = larger2; larger3 = larger2;
} }
tdp1 = create_min_typ_max("tplh", rem);
estimate_typ(tdp1);
rising = get_estimate(tdp1);
tdp2 = create_min_typ_max("tphl", rem);
estimate_typ(tdp2);
falling = get_estimate(tdp2);
if (rising && strlen(rising) > 0) {
if (falling && strlen(falling) > 0) {
larger = larger_delay(rising, falling);
delays = tprintf("(delay = %s)", larger);
} else {
delays = tprintf("(delay = %s)", rising);
}
} else if (falling && strlen(falling) > 0) {
delays = tprintf("(delay = %s)", falling);
} else {
if (larger3) { if (larger3) {
delays = tprintf("(delay = %s)", larger3); delays = tprintf("(delay = %s)", larger3);
} else { } else {
delays = tprintf("(delay=1.0e-12)"); delays = tprintf("(delay=1.0e-12)");
} }
}
delete_timing_data(tdp1);
delete_timing_data(tdp2);
delete_timing_data(tdp3); delete_timing_data(tdp3);
delete_timing_data(tdp4); delete_timing_data(tdp4);
delete_timing_data(tdp5); delete_timing_data(tdp5);
delete_timing_data(tdp6); delete_timing_data(tdp6);
}
delete_timing_data(tdp1);
delete_timing_data(tdp2);
return delays; return delays;
} }