Differences

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

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
sim:start [2022/07/17 05:59]
rajit created
sim:start [2022/07/17 06:02]
rajit
Line 4: Line 4:
  
 <code act> <code act>
-export template<pint W, V> defproc source (chan!(int<W>) O);+template<pint W, V>  
 +defproc source (chan!(int<W>) O);
 </code> </code>
 This creates a data source that has bit-width ''W'', and that repeatedly sends the constant value ''V'' on the output port ''O''. This creates a data source that has bit-width ''W'', and that repeatedly sends the constant value ''V'' on the output port ''O''.
  
 <code act> <code act>
-export template<pbool LOG; pint W> defproc sink(chan?(int<W>) I);+template<pbool LOG; pint W>  
 +defproc sink(chan?(int<W>) I);
 </code> </code>
 This process acts as a data sink; it repeatedly receives ''W''-bit input on the input port ''I''. If the ''LOG'' parameter is set to true, then it also displays the value received using the ''log()'' command. This process acts as a data sink; it repeatedly receives ''W''-bit input on the input port ''I''. If the ''LOG'' parameter is set to true, then it also displays the value received using the ''log()'' command.
  
 +<code act>
 +template<pint W; pbool REP; pint N; pint data[N]>
 +defproc source_seq(chan!(int<W>) O);
 +</code>
 +This process also provides a ''W''-bit source. Values generated by this source are specified in the ''N''-entry ''data[]'' array. The outputs produced are ''data[0]'', ''data[1]'', ..., ''data[N-1]''. If ''REP'' is set to true, then this sequence is repeated forever.