The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> A problem of the function $random
https://designers-guide.org/forum/YaBB.pl?num=1392200363

Message started by UUInfini on Feb 12th, 2014, 2:19am

Title: A problem of the function $random
Post by UUInfini on 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

Title: Re: A problem of the function $random
Post by boe on 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

Title: Re: A problem of the function $random
Post by Andrew Beckett 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.

Title: Re: A problem of the function $random
Post by UUInfini on Feb 20th, 2014, 2:17am

Thank you. :)


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.


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.