Hi <!here> M vs NF. We are creating a design and w...
# analog-design
a
Hi <!here> M vs NF. We are creating a design and we are working now on finishing some of the layout and when I looked closely to the netlist from xscheme I saw something like this:
Copy code
XM6 Vout net2 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=0.5 W=20 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
+ sa=0 sb=0 sd=0 mult=20 m=20
nf = 1, mult=20 and m = 20. I'm a little bit confused because I'm not sure if the model will take source/drain sharing correctly in that case? Nor does it takes the LOD effects.
t
As far as the schematic goes, "nf = 1, M= 20" implies 20 transistors not sharing any source/drain area. As far as magic goes, it is a known issue in magic that it does not recognize or output device fingers, mainly because the extraction method long pre-dates the BSIM model. I am hoping to fix this along with other issues related to parasitic extraction in the near future.
a
@Tim Edwards Oh, I see. Great to know.
@Tim Edwards That was my understanding and I was really confused when I saw that it's extracted as m=20.
It seems that xschem played along what is being done in magic to match LVS.
t
I don't get that. Xschem just outputs whatever you tell it to. If you want fingered devices, then you set W and nf appropriately.
a
The above is from Xschem.
@Tim Edwards Do you mean I need to change nf itself in xschem?
t
I'm not sure what you're doing in xschem, but if you want, e.g.,
XM6
from your example above to be properly represented in xschem, you would want to set
W=20
nf=20
m=1
mult=1
.
a
W=400 ?
@Tim Edwards I could do that.
@Eslam Morsie Could you please play with this and test it out?
e
@Amro Tork ok
t
No. According to the BSIM definition,
W
is the total width of all fingers.
a
@Tim Edwards agree.
But with m=20 then the total width would be 20 * 20 = 400.
If we use NF = 20, then and W = 20, then a single finger width = 1um.
To get the same size we need to set W = 400
t
Unfortunately, the ngspice developers have decided that interpreting BSIM models according to the BSIM definition should not be the default behavior, so make sure you are using the latest version of ngspice and the
spinit
file that is distributed with open_pdks and sets the right behavior for correctly interpreting
W
,
nf
, and
M
.
a
@Tim Edwards path to the "spinit"?
@Tim Edwards Great to know as well.
Didn't know that.
t
And yes, sorry, to match the example you would want
W=400
. I was not sure of the intent of the example.
In open_pdks, you'll find it in
sky130A/libs.tech/xschem/spinit
. The ngspice documentation claims that the file can be either
spinit
or
.spiceinit
, but I could only make it work by copying it to my local (simulation) directory as
.spiceinit
.
Oops, wrong path . . .
should be
sky130A/libs.tech/ngspice/spinit
.
The contents of the file are just this:
Copy code
set ngbehavior=hsa
set ng_nomodcheck
It's the
ngbehavior
that makes the BSIM handling correct.
a
@Eslam Morsie Could you please make sure we have those switches set properly in our models?
@Tim Edwards as always, thanks for all the help. Great insights.
@mina_maksimous Please read.