The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> How can I get real random number in Verilog-A?
https://designers-guide.org/forum/YaBB.pl?num=1217265671

Message started by seefree on Jul 28th, 2008, 10:21am

Title: How can I get real random number in Verilog-A?
Post by seefree on Jul 28th, 2008, 10:21am

Hi,

I tried create a model with random value at each run, below is the code:

parameter integer seed = 2;
integer myseed, newseed;
real vrand;
  analog begin
        myseed=seed+$random();
        newseed=seed*$random(myseed);
        vrand = $rdist_normal( newseed, vmean, vsdev );
        V(vp,vn) <+ vrand;
  end
endmodule

I can run monte carlo analysis with different values, but same value for different runs, which makes it repeatable. In other words, when I re-run simulation, the value sequence from Random() function is the same. Can I create a model with the real random number? I tried to find a function in Verilog-A to get the system clock time to generize the rendom but couldn't find the function...

Thanks,

Title: Re: How can I get real random number in Verilog-A?
Post by icsoul on Aug 5th, 2008, 4:32am

I don't think you can do that.

Becacuse any software including veriloga is based on some fixed algorithm. So there is no "real random".

Your original seed is fixed to 2, so the myseed and newseed are also in a fixed change mode.

If the seed is changed random or is deleted, the result may be better.

Good luck!~

Title: Re: How can I get real random number in Verilog-A?
Post by jbdavid on Aug 6th, 2008, 9:44am

setup montecarlo to give you a random value of the seed parameter.

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