RE: [Fwd: Minutes of Verilog-AMS meeting - 31 Jan 2008]

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Feb 11 2008 - 07:54:03 PST
This is the description of $urandom:

The system function $urandom provides a mechanism for generating
pseudo-random numbers. The function returns a new 32-bit random number
each time it is called. The number shall be unsigned.

The syntax for $urandom is as follows:
function int unsigned $urandom [ (int seed ) ] ;

The seed is an optional argument that determines the sequence of random
numbers generated. The seed can be any integral expression. The random
number generator (RNG) shall generate the same sequence of random
numbers every time the same seed is used.
The RNG is deterministic. Each time the program executes, it cycles
through the same random sequence.
This sequence can be made nondeterministic by seeding the $urandom
function with an extrinsic random variable, such as the time of day. 

For example:

bit [64:1] addr;
bit [ 3:0] number;
addr[32:1] = $urandom( 254 ); // Initialize the generator,
                              // get 32-bit random number
addr = {$urandom, $urandom }; // 64-bit random number
number = $urandom & 15; // 4-bit random number

Shalom

> Option #3: Have an equivalent function for the distribution 
> functions amsrand or absrand which extends the current 
> distribution function to take in parameter and constant 
> expressions and we can keep the current random and 
> distribution functions the same as the system verilog 
> counterpart. Apparently SV has already done this by having 
> urand (?) as an extension to 1364 which will return an 
> unsigned number.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Feb 11 08:01:05 2008

This archive was generated by hypermail 2.1.8 : Mon Feb 11 2008 - 08:01:38 PST