10/28/2020, 1:39 AM
Earlier this week I hit a brick wall when trying to model temperature variation in my design and decided to look into the resistor models for at least a rule of thumb. I ended up reading the ngspice manual, a couple bug reports and the source code. The result of this is a patch that fixes temperature dependence for the numbered high_po and xhigh_po models and the low variation in the xhigh_po model. Combined with @User's temper patch, all resistor models seem to work and look realistic. @User had noted a few weeks ago that the behavioral resistors seemed to disregard TC parameters. The heart of the issue was that behavioral resistors won't inherit TC parameters from a resistor model as is attempted in the primitive models. The simple fix is that they must be applied directly to the resistor as constants (not parameters) with some caution about ordering. Known issues remain: * Parameter parsing in B source based resistors (specifically TC1 and TC2) seems to happen too early for any params. Even constant ones. This forces the scattering of the same constant in a bunch of files. * B sources have a hard coded Tnom of 27degC. Both of the above can be avoided if temperature dependence is explicitly modeled in the resistance equation with temper. And constants can be kept in a single file.