The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Psudo-Random $random gives Bus Error
https://designers-guide.org/forum/YaBB.pl?num=1256288231

Message started by eddie on Oct 23rd, 2009, 1:57am

Title: Psudo-Random $random gives Bus Error
Post by eddie on Oct 23rd, 2009, 1:57am

Hi.
I have the following code:

integer Rand;
Rand = $random;
$write("Rand = ");
$write(Rand);

The random function is the correct syntax, as checked by the compiler and me vs the reference manual. Rand and random are both 32 bit integers. My problem is that as soon as the VerilogA code gets to this line it gives a Bus Error, with the message to send Cadence the netlist (i.e. totally unhelpful).

I would rather use the normal distribution function as such:

integer Rand;
Rand = $dist_normal(seed, mean, standard deviation);

But this code gives me a value that is always the same and always saturated near to the mean point. I would for example like a random number uniformly distributed between -50 and +50, with a mean of zero and a standard deviation of 20.

Removing just the Rand = line of code, the module correctly simulates. Its not a syntax issue as the code compiles correctly. Why is this happening. It shouldn't be a memory error as I'm running on a Sun Blade 1500 with 2Gb RAM.

Thanks.
Ed

Title: Re: Psudo-Random $random gives Bus Error
Post by Geoffrey_Coram on Oct 23rd, 2009, 10:48am

What if you
$write("Rand = %d", Rand);

Could be that there's some bug in the $write code trying to format it for output.

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