Jul-10-2017, 06:39 PM
(This post was last modified: Jul-10-2017, 07:32 PM by ichabod801.)
I search for lines starts with '+', splits and take the 2nd part and add to the previous line:
Code:
.subckt inv in out vss vdd
mp1 out in vdd vdd pfet w=80e-9 l=30e-9 nf=1 ps=312e-9 pd=312e-9 as=6.08e-15 $ anything after a dollar sign$ on a line is a comment
+ad=6.08e-15 sa=76e-9 sb=76e-9 sd=96e-9 ptwell=0 plorient=1 pccrit=1 p_la=0 ngcon=1
output I get:
'mp1 out in vdd vdd pfet w=80e-9 l=30e-9 nf=1 ps=312e-9 pd=312e-9 as=6.08e-15 'ad=6.08e-15 sa=76e-9 sb=76e-9 sd=96e-9 ptwell=0 plorient=1 pccrit=1 p_la=0 ngcon=1
Question:
why I am getting the 1st line in ' ' ex: 'mp1 --- as'
PS. script removed things after $ - as coded.
Thanks for your help.
Uttam
Code:
if line.startswith('+'):
line2 = line.split('+',1) [1]
outfile.write(repr(prev)+(line2))
print repr(prev)+(line2),"\n"
if not line.startswith('m')|line.startswith('+'):
outfile.write(line),"\n"
prev = line input:.subckt inv in out vss vdd
mp1 out in vdd vdd pfet w=80e-9 l=30e-9 nf=1 ps=312e-9 pd=312e-9 as=6.08e-15 $ anything after a dollar sign$ on a line is a comment
+ad=6.08e-15 sa=76e-9 sb=76e-9 sd=96e-9 ptwell=0 plorient=1 pccrit=1 p_la=0 ngcon=1
output I get:
'mp1 out in vdd vdd pfet w=80e-9 l=30e-9 nf=1 ps=312e-9 pd=312e-9 as=6.08e-15 'ad=6.08e-15 sa=76e-9 sb=76e-9 sd=96e-9 ptwell=0 plorient=1 pccrit=1 p_la=0 ngcon=1
Question:
why I am getting the 1st line in ' ' ex: 'mp1 --- as'
PS. script removed things after $ - as coded.
Thanks for your help.
Uttam
