Rana Muhammad Shahid Jamil
10/19/2021, 10:02 AMRana Muhammad Shahid Jamil
10/19/2021, 10:02 AMChristoph Maier
10/19/2021, 10:32 AMGMIN
to me ... whatever diode you put into the netlist is probably invisible to SPICE.
For what it's worth test_diode.sch
misbehaves the same way in my simulation environment.Rana Muhammad Shahid Jamil
10/19/2021, 10:44 AMRana Muhammad Shahid Jamil
10/19/2021, 10:45 AMChristoph Maier
10/19/2021, 10:45 AMRana Muhammad Shahid Jamil
10/19/2021, 10:48 AMChristoph Maier
10/19/2021, 11:07 AMRana Muhammad Shahid Jamil
10/19/2021, 11:10 AMStefan Schippers
10/19/2021, 11:09 PMStefan Schippers
10/19/2021, 11:30 PMtest_diode.spice
file after xschem generates the netlist and before doing the simulation.
My understanding is that you should give the layout area of the diode with an AREA parameter, and since the skywater has a .option scale=1e-6
a value of AREA=1 should correspond to 1um^2 diode. However in model definition default value for area is area = 1.0e+12
. I don't know what does 1e12
area diode correspond to in physical dimensions. Is it a 1um^2 area? or a 1 square meter (1000000um x 1000000um = 1e12um^2)? @Tim Edwards
In order to make simulation produce realistic data i have changed the default AREA to 1e12, same as the default value in model files.
Thank you for pointing out this issue.Tim Edwards
10/22/2021, 8:20 PM.option scale
applies to area as well, so area=1
should correspond to 1um^2. Apparently it doesn't, though. I'm not sure where that discrepancy comes from.Stefan Schippers
10/22/2021, 9:19 PMarea
and .option scale
.Stefan Schippers
10/22/2021, 9:50 PM** test diode scaling with area and .option scale **
.option scale=1
vvcc vcc 0 0.65
d1 vcc 0 D1N4148 area=1
.control
op
print vvcc#branch
quit
.endc
.MODEL D1N4148 D
+ IS = 4.352E-9 N = 1.906 BV = 110 IBV = 0.0001 RS = 0.6458 CJO = 7.048E-13
+ VJ = 0.869 M = 0.03 FC = 0.5 TT = 3.48E-9
.end
...with diode area=1
and .option scale=1
yields -2.24933e-03
diode current.
Same example with diode area=100
and .option scale=0.1
yields -2.24933e-01
current.
So the diode area
parameter is taken as an absolute multiplier, not affected by .option scale
.
I don't remember (and i have no more access to) hspice behavior, so i don't know if above behavior is a bug or not.Stefan Schippers
10/22/2021, 9:57 PMStefan Schippers
10/22/2021, 10:01 PMRana Muhammad Shahid Jamil
10/22/2021, 10:32 PMStefan Schippers
10/22/2021, 10:44 PMunrecognized parameter (vb) - ignored
unrecognized parameter (gap1) - ignored
unrecognized parameter (gap2) - ignored
unrecognized parameter (xw) - ignored
I hope these are second order parameters, however, yes, this is another issue to be fixed.Stefan Schippers
10/22/2021, 11:41 PMawk -2^2 -->-4, tcl -2**2 -->4
so best thing to avoid ambiguity is use parenthesis)
Anyway, this is the bug report.Rana Muhammad Shahid Jamil
10/23/2021, 6:16 AMStefan Schippers
10/23/2021, 9:06 AM.option scale
Stefan Schippers
10/23/2021, 9:17 AM...
here->DIOarea = here->DIOarea * scale * scale;
...
So diode should be scaled. Ngspice devs are looking into the issue.Stefan Schippers
10/23/2021, 9:59 AMLEVEL=3
is present in the diode model, and we have that level parameter in diode models. I have manually changed the .option scale=1e-6
to .option scale=100e-6
in .../share/pdk/sky130A/libs.tech/ngspice/all.spice
and I/V characteristics of diodes change considerably (bottom picture with .option scale = 100e-6
show a much lower Vbe for both diodes, since they are now 10000 times bigger).
Both simulations below are done with AREA=1e12 set on diode lines:
**.subckt test_diode
I1 net1 0 0
Vk1 net1 K1 0
.save i(vk1)
D1 0 K1 sky130_fd_pr__diode_pw2nd_05v5 area=1e12
Vk2 net2 K2 0
.save i(vk2)
D2 0 K2 sky130_fd_pr__diode_pw2nd_11v0 area=1e12
F1 0 net2 vk1 1
.control
save all
dc i1 0 50u 0.1u
plot k1 k2
.endc
.lib /home/schippes/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
.end
What is not clear to me is what AREA parameter do i need to specify on diode lines to simulate a 1um^2 diode.
From the pictures it seems that AREA=1e12 yields an I/V characteristics that is compatible for a 1um^2 device, although considering the .option scale=1e-6 and AREA=1e12 this would be the specification of a 1 square meter diode.Stefan Schippers
10/23/2021, 10:14 AMRana Muhammad Shahid Jamil
10/23/2021, 10:32 AM.option scale=1u
scales area
parameter by 1u (10^-6)
or by 1u^2 (10-12)
?
nvm i saw diosetup.c code . it is scaled by 10^-12
Tim Edwards
10/23/2021, 4:09 PMStefan Schippers
10/23/2021, 6:44 PMSCALE
(so, W, L, perimeters and so on). All area parameters (usually for Diodes and BJTs) scale with SCALE^2