Hi, I hope you all are well. I'm currently worki...
# sky130
Hi, I hope you all are well. I'm currently working to characterize libraries using spice. I was using LTSPICE to find delays of a particular cell. For finding delay associated with the cell (cell_rise) I was manually dragging the cursor on 50% of the input voltage waveform and reporting the time, then repeating the same procedure to 50% of the output voltage waveform and minus them at the end to have a cell_delay. This is quite hectic as I need to record every cell_delay with a lot of input slews vs capacitive loads. Now I'm using NGSPICE, I've tried .meas directive to find such delays but in vain. Below is my spice deck with commented .meas directive.
* SPICE3 file created from sky130_inv.ext - technology: sky130A
.option scale=0.01u
.option TEMP=25C
.include ./pshort.lib
.include ./nshort.lib
//.subckt sky130_inv A Y VPWR VGND
M1000 Y A VPWR VPWR pshort_model.0 w=55 l=23
+  ad=2145 pd=188 as=2255 ps=192
M1001 Y A VGND VGND nshort_model.0 w=35 l=23
+  ad=1435 pd=152 as=1365 ps=148
Va A VGND PULSE(0V 1.8V 2ns 1.5000000000ns 1.5000000000ns 2ns 7ns)
C0 Y A 0.05fF
C1 VPWR Y 0.10fF
C2 VPWR A 0.06fF
C3 Y 0 0.21fF
C4 VPWR 0 0.59fF
CL Y 0 0.1812840000pF
.tran 1n 60n
*write slew.out v(A)
*meas tran vout PP V(A)
*meas TRAN Vavg AVG V(A)
*meas tran ipdelay WHEN V(A)=0.9V
*meas tran opdelay WHEN V(Y)=0.9V
*let cell=opdelay-ipdelay
*print cell
plot A Y
set color0=white
set xbrushwidth=2
I need help on how to measure cell_rise and cell_fall using ngspice commands and automatically write them in a .txt file? I'll remain highly thankful if you've a lead to the problem.
you need to use TRIG and TARG commands along with .meas
refer these pages to learn to use TRIG and TARG with means ,here they use measure which is in hspice.
Hi Varun, It was really helpful. Thanks alot. Can you please let me know from where this excerpt from? It is outstanding. I'm interested to read this whole book/document.
in this book spice simulation part,its very nice please refer it
Thanks, Varun.