<@U01BJBTNN9E> I ran the resistor temperature simu...
# analog-design
y
@User I ran the resistor temperature simulations varying the temperature (
.temp 27
) and the parameter (
.param temp 27
) and still see no temperature effect on those suffix devices. So my hunch was wrong and it must be something else happening.
t
@yrrapt : What does your netlist look like? The devices all have
tc1
and
tc2
defined; e.g.,
sky130_fd_pr__res_high_po_0p35.model.spice
has
.model resbody  r tc1 = {tc1rpolybody} tc2 = {tc2rpolybody} tnum = 30.0
and
sky130_fd_pr__model__r+c.model.spice
has
tc1rpolybody = 0.514E-3
and
tc2rpolybody = 0.122E-5
. Are you getting any warnings out of ngspice?
y
@Tim Edwards this is the netlist https://github.com/xorbit/sky130-power-blocks/blob/yrrapt_resistors/primitive-test/resistor-tc.spice. basically the same as @Patrick Van Oosterwijck original one. I tried to do the for loop in ngspice control structure but couldn't get it working so in the end used a Python script that modifies the netlist to change the temperature (param and .temp) before each run
I've been looking further into it and believe I may have found the reason it's not working. I've distilled it down to this simple test:
Copy code
** Simplified test
.param temp=27

Rnov 0 r_nov 0 resbody r = {10e3}
Rv 0 r_v 0 resbody r = {10e3*(1 + v(0,r_v)*1e-6)}

.model resbody r tc1=1e-3 tc2=1e-6 tnom = 30.0

VRnov 0 r_nov dc 1
VRv 0 r_v dc 1


.control
dc temp -40 120 10
plot 1/i(VRnov) 1/i(VRv)
.endc

.end
When the resistor value includes a voltage measurement the temperature coefficients don't have any effect. The no suffix model uses a different resistor model which is based on physical dimensions (w, l, sheet resistance) which is why it's not affected. So it seems to me that either the temperature coefficient needs to be added algebraically to the resistor value expression and not count on setting separate tc's and/or ngspice probably needs to be changed to avoid this behaviour
p
Thanks for confirming @yrrapt