Fix: un-given device TEMP defaults to 0 °C instead of ambient $temperature#144
Open
Gerd-Vandersteen wants to merge 1 commit into
Open
Fix: un-given device TEMP defaults to 0 °C instead of ambient $temperature#144Gerd-Vandersteen wants to merge 1 commit into
Gerd-Vandersteen wants to merge 1 commit into
Conversation
…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.
Author
|
Companion PR: #145 fixes the nominal temperature ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a device does not specify
TEMP, VAJAX passes the parameter to the compiled model as0.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 thereforetakes
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-giventnom/tref/trwere special-cased but un-given
temp/temperaturefell through to the generic0.0fallback(
get_param_defaults()drops computed/sentinel defaults like-\NOT_GIVEN`, so nothing suppliedthe right value).
Fix
Default un-given
temp/temperatureto the-\NOT_GIVENsentinel (1e21) so the model's own "not given →$temperature`" branch runs.Evidence
On EKV at
Vg=0.7, Vd=1.0: the device now reportsT=300.15 K,Vt=0.025865, andIdmoves5.32 → 7.17 µA— matching an independent VACASK/OSDI run of the same.vaat the ambient.Note
A deeper alternative would be to teach the openvaf_py
get_param_defaults()extraction to emitcomputed/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).