Electronic – Simulation of a circuit

caddigital-logicsimulationspice

I am trying to simulate this circuit i want to know if the circuit i assembled is correct?

enter image description here

i want the current of VCCS element 1 and 2 plotted on a graph as i vary Vtun, Vsprog and Vdprog. I am using the following code is this correct?

CCapacitor_1 N_3 N_1  250f  
RResistor_1 Vsprog N_4  R=500  
MPMOS_1 N_3 N_1 N_2 Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
MPMOS_2 Vtun N_1 Vtun Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
MPMOS_3 N_4 N_1 Vdprog Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
GVCCS_G_Element_1 Vtun N_1 Vtun N_1  0.1  
GVCCS_G_Element_2 N_1 Vsprog Vsprog N_1 0.1 

v1 Vtun Gnd dc 0.01
v2 Vsprog Gnd dc 0.03
v3 Vdprog Gnd dc 0.02
.tran 1 10n
.print I(v1) I(v2) I(v3)

Best Answer

It's seem that you use conventional spice format. If your model "PMOS" is correct, then there are 3 error.

  1. First line is comment line
  2. There must be an .end at the end of file.
  3. The TSTEP must be smaller or equal to TSTOP

Here is the correct format:

****** Comment of this circuit
CCapacitor_1 N_3 N_1  250f  
RResistor_1 Vsprog N_4  R=500  
MPMOS_1 N_3 N_1 N_2 Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
MPMOS_2 Vtun N_1 Vtun Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
MPMOS_3 N_4 N_1 Vdprog Gnd PMOS W=2.5u L=250n AS=2.25p PS=6.8u AD=2.25p PD=6.8u  
GVCCS_G_Element_1 Vtun N_1 Vtun N_1  0.1  
GVCCS_G_Element_2 N_1 Vsprog Vsprog N_1 0.1 

v1 Vtun Gnd dc 0.01
v2 Vsprog Gnd dc 0.03
v3 Vdprog Gnd dc 0.02
.tran 1n 10n
.print I(v1) I(v2) I(v3)
.end