Skip to content

Fix: un-given device TEMP defaults to 0 °C instead of ambient $temperature#144

Open
Gerd-Vandersteen wants to merge 1 commit into
ChipFlow:mainfrom
Gerd-Vandersteen:upstream-temp-fix
Open

Fix: un-given device TEMP defaults to 0 °C instead of ambient $temperature#144
Gerd-Vandersteen wants to merge 1 commit into
ChipFlow:mainfrom
Gerd-Vandersteen:upstream-temp-fix

Conversation

@Gerd-Vandersteen

Copy link
Copy Markdown

Problem

When a device does not specify TEMP, VAJAX passes the parameter to the compiled model as
0.0 — read by the model as "0 °C was given" — instead of the Verilog-A "not given" sentinel
-\NOT_GIVEN (= +1e21for models using ``define NOT_GIVEN -1.0e21``). The model therefore
takes T = TEMP + 273.15 = 273.15 K (0 °C) rather than falling back to the ambient
`$temperature`. Every device silently runs 27 °C too cold.

Root cause: in prepare_static_inputs (vajax/analysis/openvaf_models.py), un-given tnom/tref/tr
were special-cased but un-given temp/temperature fell through to the generic 0.0 fallback
(get_param_defaults() drops computed/sentinel defaults like -\NOT_GIVEN`, so nothing supplied
the right value).

Fix

Default un-given temp/temperature to the -\NOT_GIVEN sentinel (1e21) so the model's own "not given → $temperature`" branch runs.

Evidence

On EKV at Vg=0.7, Vd=1.0: the device now reports T=300.15 K, Vt=0.025865, and Id moves
5.32 → 7.17 µA — matching an independent VACASK/OSDI run of the same .va at the ambient.

Note

A deeper alternative would be to teach the openvaf_py get_param_defaults() extraction to emit
computed/sentinel defaults (so the runtime fallback need not special-case temperature names). This
PR is the minimal, targeted runtime fix. A companion PR fixes the nominal temperature (TNOM).

…ture

prepare_static_inputs special-cased tnom/tref/tr -> 27.0 but let an un-given
device `temp`/`temperature` parameter fall through to the 0.0 fallback, because
openvaf_py get_param_defaults() drops computed defaults like EKV's
`TEMP = -`NOT_GIVEN`` (= 1e21). The model then evaluated `T = TEMP + 273.15 =
273.15 K` (0 C) instead of `T = $temperature` (the ambient, 300.15 K / 27 C),
so EKV ran ~27 C too cold. Surfaced by a VACASK cross-check: EKV Id was
bias-dependently off (-46% subthreshold .. +1% strong inversion).

Fix: default un-given temp/temperature to the 1e21 "not given" sentinel so the
model's own `if (TEMP == -`NOT_GIVEN)` branch selects $temperature. EKV_DEBUG
now shows T=300.15, Vt=0.025865; EKV Id 5.32 -> 7.17 uA at Vg=0.7/Vd=1.0.

Only EKV carries a TEMP param among bundled models; device_models + corners
tests unaffected. Deeper fix belongs in openvaf_py get_param_defaults()
(capture sentinel/computed defaults). NB: this unmasks a separate, residual
MIR-eval-vs-OSDI EKV difference (VP/if_/KP_Weff, +20%->-7% across bias) that the
temperature error was partially cancelling.
@Gerd-Vandersteen

Copy link
Copy Markdown
Author

Companion PR: #145 fixes the nominal temperature (TNOM). Same temperature-defaults family; independent (either can merge alone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant