Fix: Noise Analysis showing ngspice internal constants.#18
Open
ImranFarhat01 wants to merge 3 commits into
Open
Fix: Noise Analysis showing ngspice internal constants.#18ImranFarhat01 wants to merge 3 commits into
ImranFarhat01 wants to merge 3 commits into
Conversation
Problem: - Noise Analysis output showed V(false), V(true), V(boltz), V(pi) etc. - Control block used wrong vector names and wrong plot switching Fix: - Changed noise control block to use setplot noise1 then print all - ngspice 31 outputs noise data in tabular format when print all is used after setplot noise1 - this goes through the graph parser correctly - Added NGSPICE_INTERNAL_VARS filter in parse.py as additional safeguard - Noise Analysis now correctly shows inoise_spectrum and onoise_spectrum with graph output
After rebasing onto updated develop, the noiseMode variable (setplot noise1 vs noise2 based on outputSpectrum toggle) was introduced but not used in the control block, which was hardcoded to setplot noise1. Use noiseMode so the toggle correctly switches between: - noise1: inoise_spectrum/onoise_spectrum (frequency-domain) - noise2: inoise_total/onoise_total (integrated totals) Both modes verified working with correct vector names and no ngspice internal variable pollution.
This change was a carry-over fix for a different bug (Ctrl+S null crash) that doesn't belong in this PR. Keeping this branch scoped to only the noise analysis fix (Bug 2).
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
Noise Analysis output showed ngspice internal constants like V(false),
V(true), V(boltz), V(pi) etc. mixed into the results. The control block
also used the wrong vector names and wrong plot switching, causing
incorrect/failed output.
Fix
setplot noise1/setplot noise2(via the existing noiseMode toggle) then
print allprint allis usedafter
setplot, going through the graph parser correctlyNGSPICE_INTERNAL_VARSfilter in parse.py as an additionalsafeguard against internal variable leakage
noiseModein the control block so the "Show Noise Spectrum"toggle correctly switches between:
Testing
frequency, inoise_spectrum, onoise_spectrum columns correctly
onoise_total correctly in the output table