Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
sim:start [2022/07/17 06:00] rajit |
sim:start [2022/07/17 06:15] rajit [Namespace sim::rand] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Namespace sim ====== | ====== Namespace sim ====== | ||
- | The '' | + | The '' |
<code act> | <code act> | ||
- | export | + | import sim; |
+ | </ | ||
+ | |||
+ | ===== Exported processes ===== | ||
+ | |||
+ | |||
+ | <code act> | ||
+ | template< | ||
+ | defproc source (chan!(int< | ||
</ | </ | ||
This creates a data source that has bit-width '' | This creates a data source that has bit-width '' | ||
<code act> | <code act> | ||
- | export | + | template< |
+ | defproc sink(chan? | ||
</ | </ | ||
This process acts as a data sink; it repeatedly receives '' | This process acts as a data sink; it repeatedly receives '' | ||
<code act> | <code act> | ||
- | export | + | template< |
defproc source_seq(chan!(int< | defproc source_seq(chan!(int< | ||
</ | </ | ||
+ | This process also provides a '' | ||
+ | <code act> | ||
+ | export template< | ||
+ | defproc file_source(chan!(int< | ||
+ | </ | ||
+ | This process is also a '' | ||
+ | <code act> | ||
+ | export template< | ||
+ | defproc check_sink(chan? | ||
+ | </ | ||
+ | This process is a '' | ||
+ | ===== Namespace sim::rand ===== | ||
+ | The '' | ||
+ | |||
+ | <code act> | ||
+ | export template< | ||
+ | defproc source(chan!(int< | ||
+ | </ | ||
+ | This defines a source whose output is generated using the underlying C library' | ||
+ | |||
+ | <code act> | ||
+ | export function init(int< | ||
+ | export function init_range(int< | ||
+ | </ | ||
+ | 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> | ||
+ | export function get(int< | ||
+ | </ | ||
+ | Returns the next random number from the generator specified by index '' | ||
+ | |||
+ | <code act> | ||
+ | export function seed(int< | ||
+ | </ | ||
+ | Set the seed for the random number generator '' | ||