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

Statistical modeling with parameter mc_ok #149

Open
miesli opened this issue Jun 25, 2024 · 5 comments
Open

Statistical modeling with parameter mc_ok #149

miesli opened this issue Jun 25, 2024 · 5 comments
Assignees

Comments

@miesli
Copy link

miesli commented Jun 25, 2024

Expected Behavior

Turning on and off statistical modeling by choosing different corners

Actual Behavior

Turning on and off statistical modeling by choosing different corners PLUS option to change the sigma of the Gaussian function using mc_ok.

Fix

There are multiple options depending on the wanted behavior. The most obvious is:

Replace all mc_ok appearances with Sigma in the ngspice/models/cornerXXX.lib files

Thanks

I report this here after someone else reported this to me.

@dwarning
Copy link
Contributor

No, this is partly a misunderstanding:
In a former version of the PDK lib with different library concept mc_ok was used to switch on/off statistical simulation with Monte Carlo.
Actual the selection followed by mos_tt_stat library parameter. Everything works well as we can see in attached picture:
Bildschirmfoto vom 2024-06-25 15-24-21
The problem is that the name mc_ok is not correct anymore. He has now the meaning of Sigma.
The simulation is made with Sigma=6.

@simi1505
Copy link

simi1505 commented Jan 30, 2025

@dwarning Can you share your testbench or at least how you invoke this corner with Sigma=6?

.lib cornerMOSlv.lib mos_tt_stat ...?

I want to try the Monte Carlo simulation in combination with CACE.

What is a suitable value for Sigma = mc_ok? Where do you get 6 from?

Thanks!

Edit: Ok, never mind. Just make .param mc_ok = x.

@dwarning
Copy link
Contributor

dwarning commented Jan 30, 2025

@simi1505
Please at first read the ngspice manual (or hspice/spectre) about the meaning of the gauss() and agauss() function parameters.
Assuming the standard deviation values in IHP statistical libraries (I am not sure about this!) are standing for 3 Sigma. Then you get 3 Sigma deviations with mc_ok = 1. Widening the spread to 6 Sigma needs setting mc_ok to 0.5.
A reworked corner/mismatch library concept is pending: #333
Would be interesting to see spec compliance of a practical circuit with this high deviations.

@sergeiandreyev
Copy link
Contributor

sergeiandreyev commented Jan 30, 2025

Assuming the standard deviation values in IHP statistical libraries (I am not sure about this!) are standing for 3 Sigma.

Yes, these should be 3-Sigma

@simi1505
Copy link

Thanks for the fast support!

However, there is something I do not understand. I thought mc_ok equals sigma?

The Ngspice manual defines gauss() as follows:

Image

define gauss(nom, rvar, sig) (nom + (nom*rvar)/sig * sgauss(0))

And in the sg13g2_moslv_stat.lib file it is called with .param sg13g2_lv_nmos_vfbo_mm ='gauss(sg13g2_lv_nmos_vfbo_mm_norm , 0.004, mc_ok)'.

If I now define .param mc_ok = 3, I should get sigma = 3, right? I do not understand, where you get mc_ok = 1 --> sigma = 3 and mc_ok = 0.5 --> sigma = 6?

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

No branches or pull requests

5 participants