From b1ae1d3309f279e4398081aa870ad851402c6d33 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Mon, 12 Oct 2020 10:28:28 +0200 Subject: [PATCH] netlist: Apply title patch to Python netlist backend --- xorn/src/backend/gnet_spice_sdb.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xorn/src/backend/gnet_spice_sdb.py b/xorn/src/backend/gnet_spice_sdb.py index 7a4939a2b..698c27c4e 100644 --- a/xorn/src/backend/gnet_spice_sdb.py +++ b/xorn/src/backend/gnet_spice_sdb.py @@ -976,6 +976,8 @@ def write_netlist(f, file_info_list, ls): pass # do nothing for subcircuit declaration. elif device == 'spice-IO': pass # do nothing for SPICE IO pins. + elif device == 'spice-title': + pass # do nothing for spice title blocks elif device == 'SPICE-ccvs': spice_common.write_ccvs(f, package) elif device == 'SPICE-cccs': @@ -1200,6 +1202,17 @@ def run(f, netlist, args): # Otherwise it's a regular schematic. Write out command line # followed by comments in file header. debug_spew("found normal type schematic\n") + + # If the schematic contains a spice-title device and the value + # attribute is a string, use that as the title of the spice netlist + for package in reversed(packages): + if package.get_attribute('device', None) == 'spice-title': + title = package.get_attribute('value', None) + if title is None: + continue + f.write(title + '\n') + break + f.write('* %s\n' % ' '.join(sys.argv)) write_top_header(f) -- 2.11.4.GIT