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
Last revision Both sides next revision
std:start [2022/07/17 06:34]
rajit [Definitions]
std:start [2023/04/08 12:16]
rajit [Functions]
Line 4: Line 4:
  
 ====== Functions ====== ====== Functions ======
 +
 +===== Parameter-type functions =====
  
 <code act> <code act>
Line 24: Line 26:
 </code> </code>
 Computes the quantity ''n'' to the power of ''m''. Note that ''pint''s use 64-bit representation.  Computes the quantity ''n'' to the power of ''m''. Note that ''pint''s use 64-bit representation. 
 +
 +===== Runtime Functions =====
 +
 +<code act>
 +export template<pint W; pint N; pint taps[N]> function fib_lfsr (int<W> state) : int<W>;
 +</code>
 +Given the current ''W''-bit state of a Fibonacci-style linear feedback shift register (LFSR), compute the next state. The LFSR has ''N'' taps, and the ith tap is at location ''taps[i]''.
 +
 +
 +
 +
  
 ====== Definitions ====== ====== Definitions ======
Line 35: Line 48:
 <code act> <code act>
 export template<pint N, W> export template<pint N, W>
-defproc ram (chan?(int<2>) rd; chan?(int<std::ceil_log2(N)>) addr;  chan?(int<W>) din;  chan!(int<W>) dout);+defproc ram (chan?(int<2>) rd; chan?(int<std::ceil_log2(N)>) addr;   
 +             chan?(int<W>) din;  chan!(int<W>) dout);
 </code> </code>
  
Line 55: Line 69:
 The ''std'' namespace contains a number of nested namespaces: The ''std'' namespace contains a number of nested namespaces:
  
-  * [[channels|channels]]: Standard channel definitions 
   * [[data|data]]: Standard data types   * [[data|data]]: Standard data types
 +  * [[channels|channels]]: Standard channel definitions
   * [[gates|gates]]: Commonly used gates   * [[gates|gates]]: Commonly used gates
   * [[cells|cells]]: A simple synchronous standard-cell library   * [[cells|cells]]: A simple synchronous standard-cell library