Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| language:langs:chp [2026/07/27 09:43] – [Arrays: dynamic v/s non-dynamic indices] rajit | language:langs:chp [2026/07/27 09:45] (current) – [Arrays: dynamic v/s non-dynamic indices] rajit |
|---|
| uses ''x'' with an index that is computed using the run-time value of ''i''. This second category of arrays are referred to as //dynamic arrays//---not because the array size is dynamic, but because the element of the array accessed depends on a value that is computed by the circuit. Such dynamic arrays have to be translated into memory structures, or other circuits where the element being accessed has to be specified at run-time. Arrays with constant references can be directly mapped to circuit implementations of asynchronous registers, since the element to be accessed can be determined statically. | uses ''x'' with an index that is computed using the run-time value of ''i''. This second category of arrays are referred to as //dynamic arrays//---not because the array size is dynamic, but because the element of the array accessed depends on a value that is computed by the circuit. Such dynamic arrays have to be translated into memory structures, or other circuits where the element being accessed has to be specified at run-time. Arrays with constant references can be directly mapped to circuit implementations of asynchronous registers, since the element to be accessed can be determined statically. |
| |
| <block 75%:0:#FFFFCC;black;1px dotted black;auto/10ptrounded>**Tip:** A dynamic array reference to a channel is not the same as a memory access, and hence has to always be re-written in a form where it is no longer dynamic. For example, a reference ''x[i]!3'' can be re-written ''[i=0->x[0]!3 [] i=1->x[1]!3 ...]''. The Act core library automatically performs this re-write, but it is useful to know this because it explains what the underlying circuit for the dynamically indexed channel will be. Interestingly, for small integer arrays, this circuit can be //cheaper// than creating a memory (memory circuits have overhead that gets amortized once the number of bits in the memory is large). The Act core library also includes support for re-writing small integer arrays using similar re-write rules. The ''act.decomp.mem_threshold'' configuration parameter controls the threshold at which this re-write is performed.</block> | <block 75%:0:#FFFFCC;black;1px dotted black;auto/10ptrounded>**Tip:** A dynamic array reference to a channel is not the same as a memory access, and hence has to always be re-written in a form where it is no longer dynamic. For example, a reference ''x[i]!3'' can be re-written ''[i=0->x[0]!3 [] i=1->x[1]!3 ...]''. The Act core library automatically performs this re-write, but it is useful to know this because it explains what the underlying circuit for the dynamically indexed channel will be. Interestingly, for integer dynamic arrays that are small, this circuit can be //cheaper// than creating a memory (memory circuits have overhead that gets amortized once the number of bits in the memory is large). The Act core library also includes support for re-writing small integer arrays using similar re-write rules. The ''act.decomp.mem_threshold'' configuration parameter controls the threshold at which this re-write is performed.</block> |
| |
| ===== Loops ===== | ===== Loops ===== |