Added a script that parses a SPICE file and prints the parameters that
are on the .subckt line, and the parameters that are internal to the
subcircuit in a .param statement. Also, corrected spectre_to_spice.py
to not add braces around an expression that is already encapsulated by
single quotes, as that causes grief to ngspice.
diff --git a/common/spectre_to_spice.py b/common/spectre_to_spice.py
index 824b306..0bba1c6 100755
--- a/common/spectre_to_spice.py
+++ b/common/spectre_to_spice.py
@@ -103,6 +103,8 @@
if is_number(value):
fmtline.append(value)
+ elif value.strip().startswith("'"):
+ fmtline.append(value)
else:
fmtline.append('{' + value + '}')
@@ -533,13 +535,6 @@
# Copy line as-is
spicelines.append(line)
- # Make sure any pending model lines are taken care of
- if modellines != []:
- for line in modellines:
- spicelines.append(line)
- modellines = []
- inmodel = False
-
# Output the result to out_file.
with open(out_file, 'w') as ofile:
for line in spicelines: