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
Previous revision
Next revision Both sides next revision
sim:start [2022/07/17 06:43]
rajit [Namespace sim::rand]
sim:start [2022/08/01 11:31]
rajit [Namespace sim::rand]
Line 29: Line 29:
  
 <code act> <code act>
-export template<pint ID; pbool LOOP; pint W>+template<pint ID; pbool LOOP; pint W>
 defproc file_source(chan!(int<W>) O); defproc file_source(chan!(int<W>) O);
 </code> </code>
Line 35: Line 35:
  
 <code act> <code act>
-export template<pint ID; pbool LOOP; pint W>+template<pint ID; pbool LOOP; pint W>
 defproc check_sink(chan?(int<W>) I); defproc check_sink(chan?(int<W>) I);
 </code> </code>
Line 42: Line 42:
 ===== Namespace sim::rand ===== ===== Namespace sim::rand =====
  
-The ''sim::rand'' namespace contains support for random number generation, and includes the definition of a random source.+The ''sim::rand'' namespace contains support for random number generation, and includes the definition of a number of processes that use this random number generation functionality. The underlying random number generator used is a pseudo-random number generator, and hence the sequence of "random" numbers is deterministic. To ensure that these numbers remain unchanged on different platforms, we use a local mirror of the ''rand_r'' function from glibc.
  
 <code act> <code act>
Line 48: Line 48:
 defproc source(chan!(int<W>) O); defproc source(chan!(int<W>) O);
 </code> </code>
-This defines a source whose output is generated using the underlying library's pseudo-random number generator.+This defines a source whose output is generated using the underlying library's pseudo-random number generator.
  
 <code act> <code act>