Hi, does anyone about this error? I was trying to ...
# analog-design
j
Hi, does anyone about this error? I was trying to do use .measure for trise in ngspice
s
The error is in the tran command. You can not specify a timestep as zero. .tran
0
1u Use something like: .tran
1n
1u
j
I fix it, but I have this error
s
Please send the complete netlist.
j
inverter.spice
s
Move the
.measure
line before the
.control
block
Dot-commands must be outside .control blocks
also a note: the first
set appendwrite
must be after the first
dc
simulation, otherwise you keep appending data on the raw file. The setplot dc3 must be changed to setplot tran1, since it follows the first tran command.
Also do not write
.end
in your xschem code block. xschem adds .end at end of netlist. you of course should close the .
control
with
.endc
, but do not use .end.
j
Do you know why the theoretical calculation does not coincide with this result? I am calculating 10% and 90% and subtracting the times and it gives me very different
theoretical in the curve 3.618e-10 and in that function it is 6.75e-10
s
I get this from ngspice:
trise               =  9.365834e-10 targ=  2.764366e-08 trig=  2.670708e-08
and this result matches my measurement:
j
why? did you modify the measurement command?
ddd.PNG
s
try this netlist: remember to put the first set appendwrite after the first dc line otherwise you always see the same old simulations and your raw file keeps growing with data appended at the end
j
modify this, is it wrong? 10%*1.8 and 90%*1.8
do you mean just put the append write command once? so as not to be seeing the old ones?
s
ok, then you should get different results. With your values I get:
trise               =  6.756497e-10 targ=  2.747200e-08 trig=  2.679635e-08
j
Yes, I have that same value, but measuring on the graph gives me 3
s
Look at the netlist I sent to you, the position of the various set appendwrite commands
j
look this
I don't understand why it doesn't match
s
Don't know, my plot shows peftect match, 0.67us rise time
May be you measured from 0.8V to 1.62V instead of 0.18 to 1.62?
j
You right jaja I'm sorry, thanks for all
One last question, can I also calculate the propagation time or does that happen manually?
s
propagation you mean from input at 0.9V rising to output at 0.9V falling?
j
yes
ddd.PNG
s
.measure tran tprop   TRIG v(vin) TD=20n VAL=0.9 FALL=1  TARG v(vout) TD=20n VAL=0.9 RISE=1
j
in this case I could take TD with 0ns?
s
yes you can calculat also at TD=0 these two measurements calculate both propagation delays:
.measure tran tprop1   TRIG v(vin) TD=20n VAL=0.9 FALL=1  TARG v(vout) TD=20n VAL=0.9 RISE=1
.measure tran tprop2   TRIG v(vin) TD=0n VAL=0.9 RISE=1  TARG v(vout) TD=0n VAL=0.9 FALL=1
One of the two is negative since the inverter has a switching threshold that is lower than 0.9V
j
Ok, thanks for all! 🙂
s
here you see one of the two is negative if you use 0.9V.
j
oh ok ok, thanks