From 190234df58048a67da6c5603218f1957a633d1e4 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 12 Nov 2020 12:12:53 -0800 Subject: [PATCH] Add PININFO to outputs too --- compiler/base/hierarchy_spice.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/base/hierarchy_spice.py b/compiler/base/hierarchy_spice.py index d971492e..7e09b970 100644 --- a/compiler/base/hierarchy_spice.py +++ b/compiler/base/hierarchy_spice.py @@ -296,6 +296,18 @@ class spice(): sp.write("\n.SUBCKT {0} {1}\n".format(self.cell_name, " ".join(self.pins))) + # write a PININFO line + pin_info = ".PININFO" + for pin in self.pins: + if self.pin_type[pin] == "INPUT": + pin_info += " {0}:I".format(pin) + elif self.pin_type[pin] == "OUTPUT": + pin_info += " {0}:O".format(pin) + else: + pin_info += " {0}:B".format(pin) + sp.write(pin_info + "\n") + + # Also write pins as comments for pin in self.pins: sp.write("* {1:6}: {0} \n".format(pin, self.pin_type[pin]))