From 7314066deb9543436c76c817015f8554f09efdb0 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 12 Jan 2024 09:08:33 -0500 Subject: [PATCH] Corrected the spi2xspice.py script to correctly handle signals that feed back into the same subcircuit; any port signal which is a subcell output should never be re-cast as an input. Thanks to Harald Pretl for uncovering this error. --- VERSION | 2 +- scripts/spi2xspice.py.in | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index febd763..164682c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.101 +1.4.102 diff --git a/scripts/spi2xspice.py.in b/scripts/spi2xspice.py.in index f8e27f6..22a38c4 100755 --- a/scripts/spi2xspice.py.in +++ b/scripts/spi2xspice.py.in @@ -13,6 +13,9 @@ # May 17, 2017 # Updated Dec. 22, 2018 to accomodate in-lined standard cell subcircuits # (i.e., not from a .include statement) and corrected duplicate .end statement. +# Updated Jan. 12, 2024 to fix port direction when inputs and outputs are not +# buffered, and a subcircuit output signal is also fed back to other gates in +# the subcircuit. # # This script is in the public domain #-------------------------------------------------------------------------- @@ -514,7 +517,8 @@ def read_spice(filein, fileout, celldefs, debug, modelfile, timing): if len(pins) > i: inlist.append(pins[i]) if pins[i] in pindefs: - pindefs[pins[i]] = 'input' + if pindefs[pins[i]] != 'output': + pindefs[pins[i]] = 'input' else: print('Pin ' + subpinname + ' of subckt ' + cellname + ' does not have a connecting net', file=sys.stderr)