The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 7:29pm
Pages: 1
Send Topic Print
A problem of the function $random (Read 5477 times)
UUInfini
New Member
*
Offline



Posts: 2

A problem of the function $random
Feb 12th, 2014, 2:19am
 
Hello guys,
I have a problem with the function $random. In fact, I need generating a stochastic signal for a model for the Monte Carlos Analysis. Quand j'utilise $random, it can just generate a random signal in one simulation on discrete time, but for ten times of simulation for Monte Carlo, it didn't change. Does anyone has experience for this type of model? Thank you for you help and the interested.
Best regards,
UU
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: A problem of the function $random
Reply #1 - Feb 12th, 2014, 3:04am
 
UUInfini,
the standard method for MC is to vary a model parameter in the model file. If you use such a parameter as parameter for your V-A(MS) model, you can do MC variations.
- B O E
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: A problem of the function $random
Reply #2 - Feb 16th, 2014, 12:47am
 
I posted this in a reply to the same question (from the same person) on the Community Forums on the Cadence web site, but unfortunately it's down at the moment so I can't post a link.

You do this by using the cds_inherited_parameter attribute in your veriloga model, and then you can define a mismatch variation for that in the statistics block when you run a simulation. So here's the VerilogA model:
Code:
`include "disciplines.vams"

module res(vp, vn);

inout vp, vn;

electrical vp, vn;

(* cds_inherited_parameter *) parameter real monteres = 0;

parameter real r = 1k;

localparam real r_effective = r + monteres; // nominal resistance plus

// monte-carlo mismatch effect

analog

V(vp, vn) <+ (r_effective)*I(vp, vn);

endmodule 



And here's a spectre netlist to show it being used - just run "spectre monteres.scs" or whatever you've called it:
Code:
//

parameters monteres=0

statistics {
  mismatch {
    vary monteres dist=gauss std=5
  }
}

R1 (n1 0) res
I1 (n1 0) isource dc=1m

ahdl_include "monteres.va"

monte montecarlo numruns=10 variations=mismatch {
   dc dc
   export vdc=oceanEval("v(\"n1\" ?result 'dc)")
} 



If you were running from within ADE, you'd probably just create an include file (which you can reference with Setup->Model Libraries) containing the parameters and statistics statements from above.

Kind Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
UUInfini
New Member
*
Offline



Posts: 2

Re: A problem of the function $random
Reply #3 - Feb 20th, 2014, 2:17am
 
Thank you. Smiley

Andrew Beckett wrote on Feb 16th, 2014, 12:47am:
I posted this in a reply to the same question (from the same person) on the Community Forums on the Cadence web site, but unfortunately it's down at the moment so I can't post a link.

You do this by using the cds_inherited_parameter attribute in your veriloga model, and then you can define a mismatch variation for that in the statistics block when you run a simulation. So here's the VerilogA model:
Code:
`include "disciplines.vams"

module res(vp, vn);

inout vp, vn;

electrical vp, vn;

(* cds_inherited_parameter *) parameter real monteres = 0;

parameter real r = 1k;

localparam real r_effective = r + monteres; // nominal resistance plus

// monte-carlo mismatch effect

analog

V(vp, vn) <+ (r_effective)*I(vp, vn);

endmodule 



And here's a spectre netlist to show it being used - just run "spectre monteres.scs" or whatever you've called it:
Code:
//

parameters monteres=0

statistics {
  mismatch {
    vary monteres dist=gauss std=5
  }
}

R1 (n1 0) res
I1 (n1 0) isource dc=1m

ahdl_include "monteres.va"

monte montecarlo numruns=10 variations=mismatch {
   dc dc
   export vdc=oceanEval("v(\"n1\" ?result 'dc)")
} 



If you were running from within ADE, you'd probably just create an include file (which you can reference with Setup->Model Libraries) containing the parameters and statistics statements from above.

Kind Regards,

Andrew.

Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.