From 52ef00c5abc2d0f93440735bb76a1b2b91cd8023 Mon Sep 17 00:00:00 2001 From: Niko Savola Date: Tue, 31 Dec 2024 16:54:08 +0200 Subject: [PATCH] Fix X SPICE element parsing for Calibre-style model names --- gplugins/klayout/netlist_spice_reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gplugins/klayout/netlist_spice_reader.py b/gplugins/klayout/netlist_spice_reader.py index 41620647..79a6a84b 100644 --- a/gplugins/klayout/netlist_spice_reader.py +++ b/gplugins/klayout/netlist_spice_reader.py @@ -54,7 +54,9 @@ def wants_subcircuit(self, name: str): @override def parse_element(self, s: str, element: str) -> kdb.ParseElementData: # Allow Calibre-style model name given as `$[model_name]` by removing the brackets - s = re.sub(r"\$\[([^\]]+)\]", r"\1", s) + # This is used for resistors and capacitors + if element != "X": + s = re.sub(r"\$\[([^\]]+)\]", r"\1", s) x_value, y_value = None, None if "$" in s: