Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
sim:start [2022/07/17 06:15]
rajit [Namespace sim::rand]
sim:start [2022/07/17 06:43]
rajit [Namespace sim::rand]
Line 45: Line 45:
  
 <code act> <code act>
-export template<pint W>+template<pint W>
 defproc source(chan!(int<W>) O); defproc source(chan!(int<W>) O);
 </code> </code>
Line 51: Line 51:
  
 <code act> <code act>
-export function init(int<8> width) : int<32>; +function init(int<8> width) : int<32>; 
-export function init_range(int<8> width; int<32> minval, maxval) : int<32>;+function init_range(int<8> width; int<32> minval, maxval) : int<32>;
 </code> </code>
 These functions are used to initialize a (pseudo) random number generator. They return an identifier to be used in subsequent calls to the functions below to access the generator. The first one initializes a random number generator of the specified bit-width, while the second one specifies an interval over which the random number is supposed to be uniformly distributed. These functions are used to initialize a (pseudo) random number generator. They return an identifier to be used in subsequent calls to the functions below to access the generator. The first one initializes a random number generator of the specified bit-width, while the second one specifies an interval over which the random number is supposed to be uniformly distributed.
  
 <code act> <code act>
-export function get(int<32> idx) : int<64>;+function get(int<32> idx) : int<64>;
 </code> </code>
 Returns the next random number from the generator specified by index ''idx''. Returns the next random number from the generator specified by index ''idx''.
  
 <code act> <code act>
-export function seed(int<32> idx; int<32> val) : bool;+function seed(int<32> idx; int<32> val) : bool;
 </code> </code>
 Set the seed for the random number generator ''idx'' to the value ''val''. Set the seed for the random number generator ''idx'' to the value ''val''.