<@U016EM8L91B> This might be a dumb question but I...
# analog-design
e
@Tim Edwards This might be a dumb question but I am trying to create a circuit with some diodes from sky130 and am witnessing some strange simulation results. I did a DC sweep from 0 to 5V of a voltage source connected to the terminals of a diode and got the plot below. According to the device details page, the model is valid from 0 to 5V, but a current of ~4.25mA for a 5V forward bias seems extremely low. I am using the diode_pw2nd_11v0 with an area of 1e12 (the default area). The number for the area was also quite surprising to me, and I was unable to find what units it was in. I tried instantiating a 10um x 10um diode directly in Magic and generated a spice netlist to see how the area was represented, and saw that it was written as 1e+14p. To me this implies that the area is in terms of m^2, which doesn’t add up with how it was written in xschem (1e12). Am I doing something wrong in my setup/simulation? Thanks in advance.
t
There are no dumb questions related to diodes. Diodes are a huge mess for such a simple device (just a p-n junction!). Sky130 uses level 3 diodes, which are actually a proprietary model. The underlying purpose of the level 3 model is to make the diode models based on physical dimensions (e.g., area of microns^2), because the original SPICE3 diode model was just based on a "multiplication factor" (e.g., the diode is modeled at 1um^2, so if you have a 2um^2 diode you specify a multiplication factor of 2). Unfortunately the level 3 definition is schizophrenic, because if you declare area as a parameter, then area is used, but if you don't, then a multiplying factor is used. . . in completely different units! (For the record, ngspice implements level 3 diodes to the extent of handling the physical dimensions, although it is missing some of the effects that are in the proprietary model; xyce does not yet implement level 3 diodes). The units in the sky130 diodes are extremely weird, and my best guess on that is that it is due to the combination of the SkyWater built-in scalefactor of 1e-6 and what happens if the area parameter is left out. This understanding is based on some simulations that Stephan Schippers did. While an area of 1e+12 seems like it implies an area of 1e+6 * 1e+6 which, applying the SkyWater built-in scalefactor, implies an area of 1m x 1m. But in the simulation output, this acts like a 1um x 1um area diode. The conclusion is that all the model parameters for the diode are scaled such that the units are correct if they are given in picometers. Now, on top of that, you may have an outdated installation of the sky130 PDK, because based on Stephan's observations, I ended up correcting the extracted output from Magic to scale the diode areas accordingly. If I create a 1um x 1um ndiode layout in magic with the current PDK and extract it, I get in the netlist:
Copy code
.subckt sky130_fd_pr__diode_pw2nd_05v5_4P6XRR a_n100_n100# a_n202_n202#
D0 a_n202_n202# a_n100_n100# sky130_fd_pr__diode_pw2nd_05v5 pj=4e+06 area=1e+12
.ends
which matches xschem. I have also updated magic recently (version 8.3.367) to stop printing "p" after every area dimension and "u" after every length dimension and then multiplying by 1e12 and 1e6, respectively, to make the units come out right in the netlist, so the output should look more normal now. If any of that explanation needs more elaboration, please let me know.
👍 1
l
Does Efabless have any lab data for the various diodes that can be shared with everyone? That way, people who have created spice device models in the past, can make their own spice models. Also, I have not yet designed a Bandgap voltage reference in the Sky130 process. How accurate are the BJT models? I have always seen Fabs miss some important tempCo parameters on the BJT. There is a very good book from Tektronix : "Modeling the Bipolar Transistor" by Ian Getreu, published in 1976, which I suggest the people who are generating the BJT models read.
e
Thanks for your detailed response! Does this mean that it would be necessary for me to update magic before trying to extract a layout that includes diodes into a spice netlist to test in xschem? I instantiated a diode in xschem using the same notation used in the spice list (area=1e+12p) and got very different results, since I think the units were still in picometers squared
t
@Emmi Wyttenbach: There's an update in magic which is useful for no longer producing such weird units when it writes SPICE output in sky130, but the value itself is the same. The update that makes a difference is the PDK installation from open_pdks, which has an update to the sky130 tech file for magic that looks like this:
Copy code
# NOTE: SkyWater diode models have bizarre units requiring bizarre scaling
 device pdiode sky130_fd_pr__diode_pd2nw_05v5 *pdiode nwell a=area*1E12 p=pj*1E6
 device pdiode sky130_fd_pr__diode_pd2nw_05v5_lvt *pdiodelvt nwell a=area*1E12 p=pj*1E6
 device pdiode sky130_fd_pr__diode_pd2nw_05v5_hvt *pdiodehvt nwell a=area*1E12 p=pj*1E6
 device pdiode sky130_fd_pr__diode_pd2nw_11v0 *mvpdiode nwell a=area*1E12 p=pj*1E6

 device ndiode sky130_fd_pr__diode_pw2nd_05v5 *ndiode pwell,space/w a=area*1E12 p=pj*1E6
 device ndiode sky130_fd_pr__diode_pw2nd_05v5_lvt *ndiodelvt pwell,space/w a=area*1E12 p=pj*1E6
 device ndiode sky130_fd_pr__diode_pw2nd_05v5_nvt *nndiode pwell,space/w a=area*1E12 p=pj*1E6
 device ndiode sky130_fd_pr__diode_pw2nd_11v0 *mvndiode pwell,space/w a=area*1E12 p=pj*1E6
If you have those lines in your tech file, then you'll get the right dimensions in the netlist.
e
Ok I see, thank you!
s
Diodes are in Bizarre units (picometers). A netlist with such a diode with AREA=1e12 PJ=4e6 seems to behave correctly as a 1um x 1um diode as far as DC simulation is concerned. For transient analysis it's a different story. The diode behaves as an open circuit.
t
@Stefan Schippers: That's odd. Does it behave differently if you apply a voltage source instead of a current source?
s
@Tim Edwards no, in transient the diode behaves (in)consistently as an open circuit either if current driven or voltage driven.
That's weird since the exact same circuit works as expected in dc forward bias: