More fixes on the two spectre-to-SPICE conversion scripts.
diff --git a/common/convert_spectre.py b/common/convert_spectre.py index a207bd5..e83cce0 100755 --- a/common/convert_spectre.py +++ b/common/convert_spectre.py
@@ -270,6 +270,13 @@ imatch = stdsubrex.match(line) if imatch: + # If a model block is pending, then dump it + if modellines != []: + for line in modellines: + spicelines.append(line) + modellines = [] + inmodel = False + insub = True subname = imatch.group(1) if isspectre:
diff --git a/common/split_spice.py b/common/split_spice.py index 75cea9e..d8c5539 100755 --- a/common/split_spice.py +++ b/common/split_spice.py
@@ -48,6 +48,9 @@ for line in inplines: + if subname == 'xrdn': + print('handling line in xrdn, file ' + in_file + ': "' + line + '"') + # Item 1. Handle comment lines if line.startswith('*'): if subcktlines != []: @@ -66,7 +69,17 @@ if inpinlist: inpinlist = False - # Item 3. Handle continuation lines + # Item 3. Handle blank lines like comment lines + if line.strip() == '': + if subname == 'xrdn': + print('blank line in xrdn subcircuit') + if subcktlines != []: + subcktlines.append(line) + else: + spicelines.append(line) + continue + + # Item 4. Handle continuation lines if contline: if inparam: # Continue handling parameters @@ -76,7 +89,7 @@ spicelines.append(line) continue - # Item 4. Regexp matching + # Item 5. Regexp matching # If inside a subcircuit, remove "parameters". If outside, # change it to ".param"