Menu

#535 regression in pre-master branch

v1.0 (example)
closed-fixed
None
5
2020-12-07
2020-12-02
stefan
No

Hi,
Following netlist runs correctly in ngspice commit
701c295c9fc276ff794abc3711d9fc9fae182ab1 of pre-master branch, while commit
7fa453bfeb86ceaddb3078fce9a0fb7b524cce14 bails out with errors (something related to parameter expansion).

It is a poly resistor simulation in the skywater130 design kit.
I have collected all the parameters and definitions spread all over the pdk in the following netlist to make it self consistent.

While older commit 701c295c9... from Nov. 11 runs without errors,
commit 7fa453bfeb... of Nov. 30 gives following error:

Circuit: ** test_res p m b

Original line no.: 0, new internal line no.: 53:
Undefined number [null]
Original line no.: 0, new internal line no.: 53:
Cannot compute substitute
 Copies=17 Evals=54 Placeholders=19 Symbols=29 Errors=2
Numparam expansion errors: Run Spice anyway? y/n ?
y
Error on line 0 :
  b.xr6.brend m xr6.ra i= v(m,xr6.ra) / ( (    5.89990000000000009e+02  ) * (   1.0000000000e+00 + min ( ( abs ( v(m,net1) )  -1.7000000000e+00 ) ,   3.0000000000e-01 ) * ( (   -2.01999999999999992e-02  ) / pwr ( (    1.00000000000000000e+00  ) ,   5.0000000000e-01 ) * (   1.0000000000e+00 + (   -7.10000000000000041e-03  ) * ( temper -   3.0000000000e+01 ) ) ) + pow ( min ( abs ( v(m,net1) )  -1.7000000000e+00 ,   3.0000000000e-01 ) ,   2.0000000000e+00 ) * ( (    1.54999999999999999e-01  ) / pwr ( (    1.00000000000000000e+00  ) ,   5.0000000000e-01 ) * (   1.0000000000e+00 + (   -7.10000000000000041e-03  ) * ( temper -   3.0000000000e+01 ) ) ) + pow ( min ( abs ( v(m,net1) )  -1.7000000000e+00 ,   3.0000000000e-01 ) ,   3.0000000000e+00 ) * ( (    4.61000000000000021e-02  ) / pwr ( (    1.00000000000000000e+00  ) ,   5.0000000000e-01 ) * (   1.0000000000e+00 + (   -7.10000000000000041e-03  ) * ( temper -   3.0000000000e+01 ) ) ) ) ) ( (  numparm__________0000000b  ) ) reciproctc=   1.0000000000e+00
  unknown parameter (numparm__________0000000b) 
    Simulation interrupted due to error!

Here the test netlist:

** test_res P M B
Vr6 P net1 0
XR6 M net1 B sky130_fd_pr__res_high_po_0p35 W=0.35 L=1 mult=1 m=1

vp P 0 1.8
vm M 0 0
vb B 0 0
.control
dc temp -40 140 1
plot v(p,m) / vr6#branch
.endc

.param sky130_fd_pr__res_high_po__var_mult = 0

+ sky130_fd_pr__res_high_po__slope_spectre = 0
+ sky130_fd_pr__res_high_po__con_slope_spectre = 0
+ crpf_precision = 1.06e-04 
+ crpfsw_precision_1_1 = 5.04e-11

.subckt  sky130_fd_pr__res_high_po_0p35 r0 r1 b
+
.param  w = 0.350 l = 5 mult = 1.0
+

+ body_pelgrom = 0.0347
+ rend_mm = 0.085
+ rcon = 589.99
+ rsheet = 1112.41
+ tc1_voltco = -7.1e-3
+ vc1_body = -8.46e-3
+ vc2_body = 1.97e-3
+ vc3_body = 3.30e-5
+ vc1_raw_end = -2.02e-2
+ vc2_raw_end = 1.55e-1
+ vc3_raw_end = 4.61e-2
+ r0_var = 50.97
+ r1_var = 34.74
+ vc1_end = {vc1_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temper-30))}
+ vc2_end = {vc2_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temper-30))}
+ vc3_end = {vc3_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temper-30))}
+ rtot_var = {sky130_fd_pr__res_high_po__var_mult*sqrt(2*pow(r0_var,2)+pow((r1_var*l),2))}
+ rend_var = {sky130_fd_pr__res_high_po__var_mult*sqrt(2)*r0_var}
+ rbody_var = {rtot_var-rend_var}
+ res_match = {(body_pelgrom/sqrt(w*l*mult))*sky130_fd_pr__res_high_po__slope_spectre}
+ rend = {(rcon+rend_var)*(1+rend_mm/sqrt(mult)*sky130_fd_pr__res_high_po__con_slope_spectre)}
+ rbody = {(l*rsheet+rbody_var)*(1+res_match)}
rend r0 ra r = {rend*(1+min((abs(v(r0,r1))-1.7),0.3)*vc1_end+pow(min(abs(v(r0,r1))-1.7,0.3),2)*vc2_end+pow(min(abs(v(r0,r1))-1.7,0.3),3)*vc3_end)}
rhrpoly_0p35 ra r1 r = {rbody*(1+abs(v(r0,r1))*vc1_body+pow(abs(v(r0,r1)),2)*vc2_body+pow(abs(v(r0,r1)),3)*vc3_body)}
+ tc1 = 0.514e-3
+ tc2 = 0.122e-5
*+ tnom=30
c1 r0 b c = {((l+2*2.08)*w*crpf_precision*1e-12+2*(l+2*2.08+w)*crpfsw_precision_1_1*1e-6)/2}
c2 r1 b c = {((l+2*2.08)*w*crpf_precision*1e-12+2*(l+2*2.08+w)*crpfsw_precision_1_1*1e-6)/2}
.ends sky130_fd_pr__res_high_po_0p35

Thank you.
Stefan

Discussion

  • Holger Vogt

    Holger Vogt - 2020-12-02
    • status: open --> open-accepted
    • assigned_to: Holger Vogt
     
    • stefan

      stefan - 2020-12-02

      Hi, Holger,

      The TNOM has always be difficult to understand for me (my fault!).
      Anyway, this is what i find in the HSPICE manual, just for information (no saying this is the way to go!):

      .TEMP t1
      Use this command to specify the circuit temperature for an HSPICE simulation.
      You can use either the .TEMP command or the TEMP parameter in
      the .DC, .AC, and .TRAN commands. HSPICE compares the circuit simulation
      temperature against the reference temperature in the TNOM option. HSPICE
      uses the difference between the circuit simulation temperature and the TNOM
      reference temperature to define derating factors for component values.

      .OPTION TNOM
      Sets the reference temperature for the simulation.
      Use this option to set the reference temperature for the HSPICE RF simulation.
      At this temperature, component derating is zero.

      In the equations manual i often see calculations like this:

      VTX = VT – DVTO ⋅ ( TEMP – TNOM )

      so yes, it appears TNOM refers to the temperature of the model extraction.

      Device models often have a TREF parameter in HSPICE and there is a total mess on the meaning of this parameter,
      in some models:
      "The TREF parameter is an exponent in an expression for mobility temperature dependence."
      in some other mos level models:
      "TNOM (TREF) : Temperature at which simulation extracts parameters. This
      parameter defaults to the TNOM option, which defaults to25° C."

      Moreover I don't know if TNOM is specified both as a .option and inside models which one has precedence.

      Is there a default value for TNOM in ngspice ?
      HSPICE quite unusually defaults to 25C instead of 27C (does not make much difference though).

      Another confusing item is the right variable to use in equations for temperature.
      HSPICE and NGSPICE offer 'TEMPER' as the current simulation temperatre, right?
      i have sent a patch to the sky130 design kit because they were using 'TEMP' .

      Thank you
      Stefan

       

      Last edit: stefan 2020-12-02
  • Holger Vogt

    Holger Vogt - 2020-12-02

    I am working on a fix.

    At the same time I have seen in your input file the instance parameter 'tnom' (commented out).

    In ngspice we have the instance parameters 'temp' (actual device temperature) and 'dtemp' (temperature difference for this device compared to glbal temperature). HSPICE does not offer 'temp', but 'tnom'. Is this equivalent?

    Unfortunately some ngspice device models have a 'tnom', which is the temperature where the model parameters have been evaluated.

    Depending on what the role of 'tnom' might be, we have to decide what to do.

     
  • Holger Vogt

    Holger Vogt - 2020-12-06
    • status: open-accepted --> open-fixed
     
  • Holger Vogt

    Holger Vogt - 2020-12-06

    I have uploaded a fix to ngspice git pre-master branch.

     
    • stefan

      stefan - 2020-12-06

      Thank you! . Updated ngspice and tested. it works again!

       
  • Holger Vogt

    Holger Vogt - 2020-12-07
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB