Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
intro_example:loops [2025/05/17 11:59] rajitintro_example:loops [2025/08/24 16:48] (current) – [Array, loops and selection] rajit
Line 1: Line 1:
 ====== Array, loops and selection ====== ====== Array, loops and selection ======
  
-Apart from variables used for parameters (e.g. ''pint'' variables), all variables in ACT correspond to +
-names for circuit components/wires. So the instance ''one_place_buffer b;''  +
-creates the variable ''b'' that is used to refer to all the elements of the circuit component defined by a new ''one_place_buffer'' process. Connecting two variables makes them refer to the same circuit element. Connecting two processes makes the two variables correspond to one process, and connecting two channels makes them the same channel. The two connected variables can be viewed as aliases, i.e. different ways to refer to the same process. ACT provides flexible syntax to support different ways to connect variables.+
  
 Complex datapath designs are often designed with array of simpler cells. The following example show how to create array of simple cells and connect them using loop constructs in ACT. Complex datapath designs are often designed with array of simpler cells. The following example show how to create array of simple cells and connect them using loop constructs in ACT.
Line 19: Line 17:
   ( i : 8 : fa[i](a[i], b[i], c[i], s[i], c[i+1]);)     ( i : 8 : fa[i](a[i], b[i], c[i], s[i], c[i+1]);)  
 } }
 +</code>
 +
 +In this example we assume that ''adder.act'' has a full adder definition with a prototype that looks like this:
 +<code act>
 +defproc fulladder (bool? a, b, ci; bool! s, co)
 +{ ... }
 </code> </code>