Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise Analysis Issue with PDK Resistor in Transimpedance Amplifier Design #318

Closed
rupokdas147 opened this issue Jan 7, 2025 · 34 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@rupokdas147
Copy link

I am designing a Transimpedance Amplifier (TIA) using the PDK and have encountered a significant issue during noise analysis. Below are the details:

Problem Statement:
Noise performance is critical for my TIA design. I initially tested the circuit using ideal resistors and inductors, and the noise levels were in the expected range of pA/√Hz. However, upon replacing the ideal resistor with the PDK resistor, the noise levels changed drastically, increasing from pA/√Hz to nA/√Hz. This discrepancy raises concerns about the accuracy of noise analysis with the PDK resistor.

Simulation Setup:

Simulator: Ngspice 44
Schematic Editor: Qucs-s 24.4.1

Circuit Details: The design uses a combination of ideal and PDK components. The issue arises specifically when substituting ideal resistors with PDK resistors.

Steps to Reproduce:
Design a TIA circuit in Qucs-s using Ngspice as the simulator.
Perform noise analysis using ideal resistors and note the results (pA/√Hz range).
Replace the ideal resistor with a PDK resistor.
Rerun noise analysis and observe the noise level (nA/√Hz range).

Observed Behavior:
The noise levels jump significantly from the practical range of pA/√Hz to an unrealistic nA/√Hz after replacing the ideal resistor with the PDK resistor.
There is uncertainty about whether the noise analysis is functioning correctly with the PDK resistor.

Expected Behavior:
The noise levels should remain consistent with practical expectations (in the pA/√Hz range) when using the PDK resistor, assuming it is modeled correctly.
Noise analysis should work properly with PDK components, providing reliable results.

Additional Context:
This issue might indicate an error in the noise model of the PDK resistor or a compatibility issue with Ngspice.
If the noise analysis for the PDK resistor is not supported or requires specific configuration, additional clarification in the documentation would be helpful.

Request for Support:
Could you please investigate if this issue is related to the PDK resistor model or its compatibility with noise analysis in Ngspice? Any guidance on resolving this problem or verifying the noise analysis would be greatly appreciated.

Attachments:
CE_Buffer_3_noise_analysis.zip
image
image

@KrzysztofHerman
Copy link
Contributor

@rupokdas147 thank you for reporting this issue. My first guess is that the ideal resistor do not have flicker noise component and ngspice is only calculating thermal noise spectral density, which is proportional to the actual value of the resistor.
Our resistors models in the PDK contain parameters like KF, AF, EF, which extend resistor noise bahavior by a flikcer noise. You can checkout the definitions of the parameters in the chapter 3.3.3 of the manual.

Warning

Please be aware that this flicker noise is only calculated by ngspice, Xyce does not support these extended model by default.

.MODEL res_rsil R (DEFW=0.5e-6 RSH=rsh_rsil TC1=3100e-6 TC2=0.3e-6 KF=2.812e-12 AF=1.607 EF=1.267)
.MODEL res_rhigh R (DEFW=1e-6 RSH=rsh_rhigh TC1=-2300e-6 TC2=2.1e-6 KF=5.205e-10 AF=1.935 EF=0.9086)
.MODEL res_rppd R (DEFW=0.5e-6 RSH=rsh_rppd TC1=170e-6 TC2=0.4e-6 KF=4.601e-11 AF=1.886 EF=0.9963)

Let us check the numerical values and figure out are calculated correctly.

@KrzysztofHerman KrzysztofHerman self-assigned this Jan 7, 2025
@KrzysztofHerman
Copy link
Contributor

@rupokdas147
I have made a simple testcase where the results of the simulation of a resistor divider seem to match for the same value of the resistance ($R_{SH} = 260 \Omega$).

image

@rupokdas147
Copy link
Author

@KrzysztofHerman If it is flicker noise, it should decrease with increasing frequency, shouldn't it?

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 7, 2025

@KrzysztofHerman PDK's resistor and Ideal Resistor noise are the same in the simulation below. Taking w=1 and l=10 produces 2654 Ohm, not 2600 Ohm. I guess If you use a 2654 Ohm ideal resistor your result will be the same for both cases.
image
image
image

@KrzysztofHerman
Copy link
Contributor

@rupokdas147 As shown in the equation (16) of the manual the flicker noise should be proportional to ~ $1/f^{EF}$. The previous example was wrong because the resistors had no DC bias. Here goes the update.

image

Anyway still the values are out of range by a few orders of magnitude but this is a simulator issue.

@rupokdas147
Copy link
Author

@KrzysztofHerman As far as I know thermal noise is dominant comparatively flicker noise in High Frequency applications. But the resistor provided in the PDK has more dominant flicker noise. I am really confused. Could you please explain in more detail why it's happening?

@KrzysztofHerman
Copy link
Contributor

@rupokdas147 I suppose that the confusion comes from the fact how the data are presented.
What we have on the graphs is the total noise spectral density. While thermal noise does not depend on the frequency the flicker one does and keeps decreasing ( ~ $1/f^{EF}$ ). So at high frequency the dominant will be the thermal part. Keep in mind that the values are suspicious. We are looking for the root cause.

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 8, 2025

@KrzysztofHerman, I found nothing about which noises are calculated using Noise Analysis in the Ngspice 44 manual. I reviewed it again. They did not mention anything about Thermal Noise, Flicker Noise, or Shot Noise. However, in the Transient Analysis, I found Transient Noise, where they mentioned the Flicker noises but I could not find any way to calculate it in Qucs-s. What I found from the Manual:

1.1 Small signal noise
The noise analysis does analysis device-generated noise for the given circuit. When provided with an input source and an output port, the analysis calculates the noise contributions of each device (and each noise generator within the device) to the output port voltage. It also calculates the input noise to the circuit, equivalent to the output noise referred to the specified input source. This is done for every frequency point in a specified range - the calculated value of the noise corresponds to the spectral density of the circuit variable viewed as a stationary gaussian stochastic process.

1.2 Transient noise
Time domain noise analysis during transient simulation is enabled by providing voltage (and current) source options with white, 1/f and random telegraph signal noise signals.

@KrzysztofHerman
Copy link
Contributor

@rupokdas147 I guess @dwarning can answer this question better.

@rupokdas147
Copy link
Author

I have manually calculated the flicker noise for res_rppd using equations Mentioned in the documents:
757.pdf
chp8.pdf

Taking DC current flowing through the resistor is 1 mA. The flicker noise should be below 1 pA/sqrt(Hz) after 0.1 GHz. I am not sure if I am using the correct equation for the flicker noise.
Also according to my observations from the literature reviewed for TIA design, nobody was concerned about the flicker noise. Everyone tried to minimize the Thermal noise and Shot noise.

@KrzysztofHerman
Copy link
Contributor

@rupokdas147 we are looking at the noise calculation implementation in ngspice. You are completely right that the flicker can be neglected at high frequencies and the noise will be dominated by the thermal one.

@rupokdas147
Copy link
Author

@KrzysztofHerman Thank you for looking into this! I appreciate your effort in addressing the issue.

@dwarning
Copy link
Contributor

dwarning commented Jan 8, 2025

Sorry - I must disagree: Flicker noise follows in problems for mixers, oscillators, in phase noise of pll designs and in many other situations.

In ngspice we are using same formula as in hspice (and may be in spectre):

325_82_1

resnoise.c, l. 109:
noizDens[RESFLNOIZ] *= inst->RESm * model->RESfNcoef * pow(fabs(inst->REScurrent / inst->RESm), model->RESfNexp) / (inst->RESeffNoiseArea * pow(data->freq, model->RESef));

For the provided test case I got following subexpressions (R=2.654k, Vdc=0.5V, f=100GHz):

DC current in resistor r.xrppd2.x1.r1: 1.883599e-04 m: 1.000000e+00 Ncoef: 4.601000e-11 I/m**Nexp: 9.432529e-08 area: 1.006000e-11 area*f**ef: 9.160053e-01 Inoise: 4.737862e-18
Taking the sqrt from calculated Inoise and multiplying with resistance we get 5,78e-6 uV/sqrt(Hz) what is in range of the plotted value.
We have to investigate the remaining difference and compare it to other simulator resistor noise modelling.

@rupokdas147
Copy link
Author

@dwarning Thank you. Could you please compare the result with a resistor of similar type and dimension in Spectre? I do not have a Cadence license.

@rupokdas147
Copy link
Author

@KrzysztofHerman Is there any restriction for maximum resistor dimension? I need to increase the size of the resistors significantly to minimize the noise.

@dwarning
Copy link
Contributor

dwarning commented Jan 9, 2025

@rupokdas147 Only for information: We investigating the problem and see a difference in geometry scaling between the ngspice an spectre model. As soon we have a solution we will come back.

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 10, 2025

I have searched the files in Ngspice and found that the total noise of a resistor is the summation of thermal noise and flicker noise:

noizDens[RESTOTNOIZ] = noizDens[RESTHNOIZ] + noizDens[RESFLNOIZ];
File: resnoise.c, Line: 114

Thermal Noise
Thermal noise is calculated using the equation:
4kT/R

inoise = 4.0 * CONSTboltz * (ckt->CKTtemp + param2) * param; /* param is the conductance of a resistor */
File: nevalsrc.c, Line: 283

Flicker Noise
Flicker noise is calculated using the equation:
(𝐾𝐹*(𝐼/𝑚)^𝐴𝐹) / (Area*𝑓^𝐸𝐹)

noizDens[RESFLNOIZ] *= inst->RESm * model->RESfNcoef *
                        pow(fabs(inst->REScurrent / inst->RESm), model->RESfNexp) /
                        (inst->RESeffNoiseArea * pow(data->freq, model->RESef));

File: resnoise.c, Line: 109

Observation
The resistor rppd is a p-doped poly-silicon resistor. I searched for articles analyzing noise in poly-silicon-based resistors and found this papers:
https://ieeexplore.ieee.org/abstract/document/925245.
https://ieeexplore.ieee.org/abstract/document/589331

According to the data in the paper, the flicker noise should become lower than thermal noise beyond the kHz frequency range.

However, when I simulated the resistor from the PDK, I observed that the noise aggressively dominates at the 100 GHz range.

Simulation Details
Resistor: 2 kΩ
Dimensions: 4 µm × 32 µm
DC Current: 1 µA
The measured noise current was significantly higher than expected.

@dwarning
Copy link
Contributor

@rupokdas147
We will change the model to r3_cmc Verilog-A) as it is in the commercial tool next week as pull request for current branch.
As a very raw and quick workaround you can lowering the KF model parameter by a factor of 1e-12 ... 1e-11. Should help you to come further with your initial problem.

@sergeiandreyev sergeiandreyev added the bug Something isn't working label Jan 17, 2025
dwarning pushed a commit to dwarning/IHP-Open-PDK that referenced this issue Jan 19, 2025
because of additional Verilog-A model reorganization of directory structure and install process was introduced

Signed-off-by: Dietmar Warning <warning@ihp-microelectronics.com>
@ArashKat
Copy link

Hello, I’m unable to access the commit cca441a that fixes the noise issue. My local repository is up-to-date with the dev branch (last commit: 3a9c016 from Jan 17, 2025). Could you confirm if the fix is in another branch or still pending merge?

Thank you.

@dwarning
Copy link
Contributor

I just submitted my PR for dev branch of IHP-Open-PDK.
I assume applying the PR will need weeks I would prefer to create a patch from this Pull Request. Try it with this approach: https://coderwall.com/p/6aw72a/creating-patch-from-github-pull-request

Any way - you must have openvaf available, same as for psp103 model.

@ArashKat
Copy link

Thank you, but still i have this error:

Applying: pyprozessor added
error: patch failed: ihp-sg13g2/libs.tech/klayout/python/pypreprocessor:1
error: ihp-sg13g2/libs.tech/klayout/python/pypreprocessor: patch does not apply
Patch failed at 0001 pyprozessor added
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@ArashKat
Copy link

git am --show-current-patch=diff

ihp-sg13g2/libs.tech/klayout/python/pypreprocessor | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ihp-sg13g2/libs.tech/klayout/python/pypreprocessor b/ihp-sg13g2/libs.tech/klayout/python/pypreprocessor
index cf1ff9ba..6ddd5783 160000
--- a/ihp-sg13g2/libs.tech/klayout/python/pypreprocessor
+++ b/ihp-sg13g2/libs.tech/klayout/python/pypreprocessor
@@ -1 +1 @@
-Subproject commit cf1ff9bad0fb5338cf1c5b990b2b816b1ea01a64
+Subproject commit 6ddd5783365718c41eb69bce4428358ace4d1fa2

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 22, 2025

@dwarning The verilog-a model of the resistor working fine in low frequency. But, there are difference between calculated input noise and simulated input noise in high frequency.
Simulation Setup:

Simulator: Ngspice 44.2
Schematic Editor: Qucs-s 24.4.1

Low Frequency:

Ideal Resistor:

Image

Image

PDK Resistor:

Image

Image

Test Case:
res_noise_low_freq.zip

High Frequncy:

Ideal Resistor:

Image

Image

PDK Resistor:

Image

Image

Test Case:
res_noise_high_freq.zip

@dwarning
Copy link
Contributor

I made an update for the PR yesterday. Because nothing else changed, you can use this fix:

models.zip

@rupokdas147 I will check your testcases later.

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 22, 2025

@dwarning The outputs remains same. Please check the test cases, I have attached both high frequency and low frequency test case files with the previous comment.

@dwarning
Copy link
Contributor

@rupokdas147
You must have in mind, that the poly resistors have capacitors on their ends which are modeled very well in our lib. If you comment out these both model parameters ca and cp you get the expected 7nV/sqrt(Hz) white noise.
So at very high frequencies the noise currents are conducted to ground. I am sure that also the signal will be decreased.

@ArashKat
Copy link

In the TIA that I'm designing the input-referred noise in lower frequencies with the poly resistor of the pdk is 10000 times (ten thousand times) more than using the ideal resistor. I conducted this simple test:

Ideal:

Image

Image

Poly:

Image

Image

TIA results with poly:

Image

TIA without:

Image

I have only one resistor in the TIA

@dwarning
Copy link
Contributor

@ArashKat
There are few inconsistencies, e.g. you show flicker noise with the poly resistors but the current sources have 0 A dc.

Anyway - it seems you have the old lib from dev branch. Could you please update in same way as rupokdas147 made. Or you have to wait for dev branch update, evaluation is on the way.

That I got with your testcase:

Image

As said, for higher frequencies then 1 GHz the device capacitors to ground comes in play, the model show this effect.

@ArashKat
Copy link

ArashKat commented Jan 22, 2025

@dwarning As I mentioned earlier the patch of the PR can not be executed. Also, I used the zip file here in this issue that you mentioned as updated model and simply replace it in this directory: IHP-Open-PDK\ihp-sg13g2\libs.tech\ngspice\models. After running I have the following error:

Error on line:
n.xr1.nr1 0 0 xr1.2 xr1.dt xr1:res_rppd l= 1.500000000000000e-06 w= 5.060000000000000e-07 m= 1.000000000000000e+00 a1= 5.900000000000000e-13 a2= 5.900000000000000e-13 p1= 2.860000000000000e-06 p2= 2.860000000000000e-06 c1=1 c2=1 trise= 0.000000000000000e+00 sw_et= 0.000000000000000e+00
could not find a valid modelname
Simulation interrupted due to error!

@dwarning
Copy link
Contributor

You have to compile the r3_cmc Verilog-A model with openvaf same way as with the psp103 model.
Or you take the zip file from https://github.com/dwarning/VA-Models/releases/tag/v2.2 and use the osdi command in your .spiceint file as shown above.

@ArashKat
Copy link

ArashKat commented Jan 22, 2025

@dwarning @KrzysztofHerman I might not installed everything correctly i did it my way and it was working .. now I installed it step by step following the guide and I have this error: Note: Compatibility modes selected: hs a

Circuit: ** sch_path: /home/arashka/ihp-open-pdk/ihp-sg13g2/libs.tech/xschem/sg13g2_tests/dc_hbt_13g2.sch

Too few parameters for subcircuit type "npn13g2" (instance: xxq1)
Simulation interrupted due to error! Also, when I try ti import resistors from pdk library xschem crushes and exit ......................if someone pls help me. BTW, CMOS are alright.

@rupokdas147
Copy link
Author

@ArashKat I am using Qucs-s for schematic design. I have successfully run the new vlog-a model of the resistor. I can help you if you use Qucs-s.

@rupokdas147
Copy link
Author

rupokdas147 commented Jan 23, 2025

@dwarning I have downloaded the verilog-a model of the resistors from https://github.com/dwarning/IHP-Open-PDK/tree/res_r3_model/ihp-sg13g2/libs.tech/verilog-a and Ngspice models from the same repository.
Please let me know if these are the correct models. I am going to close the issue.

Here is a test case of the resistor:

Image

@dwarning
Copy link
Contributor

Yes, same as mine, here with capacitance extraction:

Image

You can close. @ArashKat can open an new issue, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants