====== Namespace std ====== The ''std'' namespace contains a collection of standard definitions for channels, data types, and other components. This can be viewed as ACT's equivalent of the C++ standard template library. ====== Functions ====== ===== Parameter-type functions ===== export function max(pint a, b) : pint; Returns the larger of the two ''pint''s. export function min(pint a, b) : pint; Returns the smaller of the two ''pint''s. export function ceil_log2 (pint a) : pint; Computes the smallest power of two that is at least as large as ''a''. export function pow(pint n, m) : pint; Computes the quantity ''n'' to the power of ''m''. Note that ''pint''s use 64-bit representation. ===== Runtime Functions ===== export template function fib_lfsr (int state) : int; 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 ====== export template defproc rom (chan?(int) addr; chan!(int) dout); (This can be used after ''actsim'' is installed.) export template defproc ram (chan?(int<2>) rd; chan?(int) addr; chan?(int) din; chan!(int) dout); export defcell buf_arbiter(bool? a, b; bool! u, v) ; export defcell ideal_arbiter(bool? a, b; bool! u, v) ; export template defproc arbiter(chan?(int) A; chan?(int) B; chan!(int) Ap; chan!(int) Bp); ====== Nested namespaces ====== The ''std'' namespace contains a number of nested namespaces: * [[data|data]]: Standard data types * [[channels|channels]]: Standard channel definitions * [[gates|gates]]: Commonly used gates * [[cells|cells]]: A simple synchronous standard-cell library * [[io|io]]: Standard I/O primitives * [[bit|bit]]: Bit-manipulation functions