From 0eada90eaba4e3e5cc27ef9803a53f5d37d085e0 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 29 May 2020 11:19:37 -0400 Subject: [PATCH] Corrected the readspice.tcl routine to correctly handle input without filename extensions. --- tcltk/readspice.tcl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tcltk/readspice.tcl b/tcltk/readspice.tcl index 7308075e..923bc69a 100644 --- a/tcltk/readspice.tcl +++ b/tcltk/readspice.tcl @@ -16,33 +16,33 @@ global Opts proc readspice {netfile} { if [catch {open $netfile r} fnet] { set netname [file rootname $netfile] - if [catch {open ${netfile} r} fnet] { - # Check for standard extensions (.spi, .spc, .spice, .sp, .ckt) + # Check for standard extensions (.spi, .spc, .spice, .sp, .ckt) - set testnetfile ${netfile}.spi + set testnetfile ${netname}.spi + if [catch {open ${testnetfile} r} fnet] { + set testnetfile ${netname}.spc if [catch {open ${testnetfile} r} fnet] { - set testnetfile ${netfile}.spc + set testnetfile ${netname}.spice if [catch {open ${testnetfile} r} fnet] { - set testnetfile ${netfile}.spice + set testnetfile ${netname}.sp if [catch {open ${testnetfile} r} fnet] { - set testnetfile ${netfile}.sp + set testnetfile ${netname}.ckt if [catch {open ${testnetfile} r} fnet] { - set testnetfile ${netfile}.ckt - if [catch {open ${testnetfile} r} fnet] { - puts stderr "Can't read netlist file $netfile" - return 1; - } + puts stderr "Error: Can't read netlist file $netfile" + return 1; } } } } } + set netfile $testnetfile } # Read data from file. Remove comment lines and concatenate # continuation lines. + puts stderr "Annotating port orders from $netfile" set fdata {} set lastline "" while {[gets $fnet line] >= 0} {