efabless / skywater-pdk-libs-sky130_fd_pr

Apache License 2.0
5 stars 0 forks source link

Diode breakdown voltages are in the models, but misspelled? #19

Open psychogenic opened 2 months ago

psychogenic commented 2 months ago

I have noticed something odd in the sky130 models I'm using (version cd1748bb197f9b7af62a54507de6624e30363943): there are what I believe are breakdown voltages for diodes in many spice models, but they seem to be misnamed 'vb' rather than 'bv':

+ vb = 11.7 ; Units: volt
+ ibv = 0.00106 ; Units: amper

If I change this to 'bv' as ngspice wants, which also matches the ibv data present, then I get successful simulated breakdowns, as attached.

This is true of both sky130_fd_prdiode type things and parasitic__diode type things

sky_diode_breakdown

RTimothyEdwards commented 2 months ago

Great observation, Pat!

This seems to come from the "quick & dirty" implementation of the level 3 diode in ngspice, which is a recent addition (prompted by the existence of sky130). Level 3 diodes are a Cadence thing, so without the (proprietary) level 3 model equations, the best the ngspice developers could do was to implement the basic underlying idea of a diode whose parameters are based on physical dimensions instead of a scale factor (which is how the original level 1 diode is defined).

Apparently they did not notice some aspects of the level 3 definition; at least what I found by googling "level 3 diode model breakdown voltage" was a reference at which states

Diode Model Parameters  - Level = 3

Name | Description | Units | Default

BV, VB, VAR, VRB | Reverse breakdown voltage | V | ∞

So apparently the official Level 3 definition allows any of BV, VB, VAR, and VRB to represent reverse breakdown voltage (that has all the trappings of a model created from a bunch of people's independent hacks to solve the same problem).

Therefore the correct solution is to encourage the ngspice developers to allow all four variants of the breakdown voltage parameter. The quickest solution is for me to change vb to bv in the diode models, as that should be compatible with the most simulators.

psychogenic commented 2 months ago

Ah, well that explains it. If you want the quick & dirty, I can go through and do a PR.

psychogenic commented 2 months ago

Ah, screw it, I did the right thing instead. Or tried to. I now have added breakdown voltage synonym support to ngspice and made a PR:

https://sourceforge.net/p/ngspice/ngspice/merge-requests/17/

The change was minor, basically 3 lines: https://sourceforge.net/u/psychogenic/ngspice/ci/80209f021565dc05c7c0ef47cf6965f9f7a39530/

Logging into sourceforge after all this time was the most exciting part.

RTimothyEdwards commented 2 months ago

@psychogenic: PR #20 fixes the issue within the PDK itself, so that can take effect immediately while waiting for your pull request to be merged into the next ngspice distribution. Thanks again for investigating the issue!

dwarning commented 2 months ago

Meanwhile parameter aliases VB, VAR, and VRB are implemented in pre-master-43. Basic mask and etching offsets are now considered with XW model parameter for level=3 diodes. Further TLEV=2 uses now an alternative bandgap calculation with GAP1 and GAP2. There are still open topics for this temperature model e.g. saturation currents etc.

Would be helpful to get response after checking with sky-water-libs.